Spaces:
Running
on
Zero
Running
on
Zero
Relocate GPU
Browse files
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)
|