Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ from torchvision import transforms
|
|
13 |
|
14 |
# ----------------- HELPER FUNCTIONS ----------------- #
|
15 |
|
16 |
-
|
17 |
|
18 |
LABELS_TO_IDS = {
|
19 |
"Background": 0,
|
@@ -133,8 +133,8 @@ def create_legend_image(labels_to_ids: dict[str, int], filename="legend.png"):
|
|
133 |
# ----------------- MODEL ----------------- #
|
134 |
|
135 |
URL = "https://huggingface.co/facebook/sapiens/resolve/main/sapiens_lite_host/torchscript/depth/checkpoints/sapiens_0.3b/sapiens_0.3b_render_people_epoch_100_torchscript.pt2?download=true"
|
136 |
-
|
137 |
-
model_path = os.path.join(os.path.dirname(__file__), "sapiens_0.
|
138 |
|
139 |
if not os.path.exists(model_path):
|
140 |
os.makedirs(CHECKPOINTS_DIR, exist_ok=True)
|
|
|
13 |
|
14 |
# ----------------- HELPER FUNCTIONS ----------------- #
|
15 |
|
16 |
+
ASSETS_DIR = os.path.join(os.path.dirname(__file__), "assets")
|
17 |
|
18 |
LABELS_TO_IDS = {
|
19 |
"Background": 0,
|
|
|
133 |
# ----------------- MODEL ----------------- #
|
134 |
|
135 |
URL = "https://huggingface.co/facebook/sapiens/resolve/main/sapiens_lite_host/torchscript/depth/checkpoints/sapiens_0.3b/sapiens_0.3b_render_people_epoch_100_torchscript.pt2?download=true"
|
136 |
+
CHECKPOINTS_DIR = os.path.join(ASSETS_DIR, "checkpoints")
|
137 |
+
model_path = os.path.join(os.path.dirname(__file__), "sapiens_0.3b_render_people_epoch_100_torchscript.pt2")
|
138 |
|
139 |
if not os.path.exists(model_path):
|
140 |
os.makedirs(CHECKPOINTS_DIR, exist_ok=True)
|