Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -124,11 +124,11 @@ def create_legend_image(labels_to_ids: dict[str, int], filename="legend.png"):
|
|
124 |
|
125 |
# ----------------- MODEL ----------------- #
|
126 |
|
127 |
-
URL = "https://huggingface.co/facebook/sapiens/resolve/main/sapiens_lite_host/torchscript/
|
128 |
CHECKPOINTS_DIR = os.path.join(ASSETS_DIR, "checkpoints")
|
129 |
os.makedirs(CHECKPOINTS_DIR, exist_ok=True)
|
130 |
|
131 |
-
model_path = os.path.join(CHECKPOINTS_DIR, "
|
132 |
|
133 |
if not os.path.exists(model_path) or os.path.getsize(model_path) == 0:
|
134 |
print("Downloading model...")
|
@@ -192,7 +192,7 @@ with gr.Blocks(css=CUSTOM_CSS, theme=gr.themes.Monochrome(radius_size=sizes.radi
|
|
192 |
with gr.Column():
|
193 |
input_image = gr.Image(label="Input Image", type="pil", format="png")
|
194 |
with gr.Column():
|
195 |
-
result_image = gr.Image(label="
|
196 |
run_button = gr.Button("Run")
|
197 |
|
198 |
run_button.click(
|
|
|
124 |
|
125 |
# ----------------- MODEL ----------------- #
|
126 |
|
127 |
+
URL = "https://huggingface.co/facebook/sapiens/resolve/main/sapiens_lite_host/torchscript/depth/checkpoints/sapiens_1b/sapiens_1b_render_people_epoch_88_torchscript.pt2?download=true"
|
128 |
CHECKPOINTS_DIR = os.path.join(ASSETS_DIR, "checkpoints")
|
129 |
os.makedirs(CHECKPOINTS_DIR, exist_ok=True)
|
130 |
|
131 |
+
model_path = os.path.join(CHECKPOINTS_DIR, "sapiens_1b_render_people_epoch_88_torchscript.pt2")
|
132 |
|
133 |
if not os.path.exists(model_path) or os.path.getsize(model_path) == 0:
|
134 |
print("Downloading model...")
|
|
|
192 |
with gr.Column():
|
193 |
input_image = gr.Image(label="Input Image", type="pil", format="png")
|
194 |
with gr.Column():
|
195 |
+
result_image = gr.Image(label="Depth Output", format="png")
|
196 |
run_button = gr.Button("Run")
|
197 |
|
198 |
run_button.click(
|