qubvel-hf HF staff commited on
Commit
e186d7e
1 Parent(s): 20de702

Relocate GPU

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -84,7 +84,6 @@ def get_v2_model(model_name):
84
  return model
85
 
86
 
87
- @spaces.GPU
88
  def predict_depth_v1(image, model_name):
89
  if model_name not in depth_anything_v1_pipelines:
90
  depth_anything_v1_pipelines[model_name] = get_v1_pipe(model_name)
@@ -92,7 +91,6 @@ def predict_depth_v1(image, model_name):
92
  return pipe(image)
93
 
94
 
95
- @spaces.GPU
96
  def predict_depth_v2(image, model_name):
97
  if model_name not in depth_anything_v2_models:
98
  depth_anything_v2_models[model_name] = get_v2_model(model_name)
@@ -116,6 +114,7 @@ def compute_depth_map_v1(image, model_select):
116
  return colored_depth
117
 
118
 
 
119
  def on_submit(image, model_v1_select, model_v2_select):
120
  logger.info(f"Computing depth for V1 model: {model_v1_select} and V2 model: {model_v2_select}")
121
  colored_depth_v1 = compute_depth_map_v1(image, model_v1_select)
 
84
  return model
85
 
86
 
 
87
  def predict_depth_v1(image, model_name):
88
  if model_name not in depth_anything_v1_pipelines:
89
  depth_anything_v1_pipelines[model_name] = get_v1_pipe(model_name)
 
91
  return pipe(image)
92
 
93
 
 
94
  def predict_depth_v2(image, model_name):
95
  if model_name not in depth_anything_v2_models:
96
  depth_anything_v2_models[model_name] = get_v2_model(model_name)
 
114
  return colored_depth
115
 
116
 
117
+ @spaces.GPU
118
  def on_submit(image, model_v1_select, model_v2_select):
119
  logger.info(f"Computing depth for V1 model: {model_v1_select} and V2 model: {model_v2_select}")
120
  colored_depth_v1 = compute_depth_map_v1(image, model_v1_select)