Ariamehr commited on
Commit
4ad0438
1 Parent(s): d67d90d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -14,6 +14,8 @@ from torchvision import transforms
14
  # ----------------- HELPER FUNCTIONS ----------------- #
15
 
16
  ASSETS_DIR = os.path.join(os.path.dirname(__file__), "assets")
 
 
17
 
18
  LABELS_TO_IDS = {
19
  "Background": 0,
@@ -134,6 +136,8 @@ def create_legend_image(labels_to_ids: dict[str, int], filename="legend.png"):
134
 
135
  URL = "https://huggingface.co/facebook/sapiens/blob/main/sapiens_lite_host/torchscript/normal/checkpoints/sapiens_2b/sapiens_2b_normal_render_people_epoch_70_torchscript.pt2?download=true"
136
  CHECKPOINTS_DIR = os.path.join(ASSETS_DIR, "checkpoints")
 
 
137
  model_path = os.path.join(CHECKPOINTS_DIR, "sapiens_2b_normal_render_people_epoch_70_torchscript.pt2")
138
 
139
  if not os.path.exists(model_path):
 
14
  # ----------------- HELPER FUNCTIONS ----------------- #
15
 
16
  ASSETS_DIR = os.path.join(os.path.dirname(__file__), "assets")
17
+ os.makedirs(ASSETS_DIR, exist_ok=True)
18
+
19
 
20
  LABELS_TO_IDS = {
21
  "Background": 0,
 
136
 
137
  URL = "https://huggingface.co/facebook/sapiens/blob/main/sapiens_lite_host/torchscript/normal/checkpoints/sapiens_2b/sapiens_2b_normal_render_people_epoch_70_torchscript.pt2?download=true"
138
  CHECKPOINTS_DIR = os.path.join(ASSETS_DIR, "checkpoints")
139
+ os.makedirs(CHECKPOINTS_DIR, exist_ok=True)
140
+
141
  model_path = os.path.join(CHECKPOINTS_DIR, "sapiens_2b_normal_render_people_epoch_70_torchscript.pt2")
142
 
143
  if not os.path.exists(model_path):