Rawal Khirodkar commited on
Commit
94742fe
·
1 Parent(s): 39aae70

Pose: enable all 4 sizes; default = 1B (shipped)

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -63,7 +63,7 @@ POSE_MODELS = {
63
  "config": os.path.join(CONFIGS_DIR, "sapiens2_5b_keypoints308_shutterstock_goliath_3po-1024x768.py"),
64
  },
65
  }
66
- DEFAULT_SIZE = "0.4B" # iteration mode — only this is preloaded; others lazy-load on click
67
 
68
  DETECTOR_MODEL_ID = "facebook/detr-resnet-50" # COCO person = label 1
69
 
@@ -110,13 +110,10 @@ def _get_pose_model(size: str):
110
  return _pose_model_cache[size]
111
 
112
 
113
- # Iteration mode: only preload the default (0.4B) for fast Space boot.
114
- # Re-enable full preload by uncommenting the loop below.
115
- print("[startup] pre-loading detector + 0.4B (iteration mode) ...")
116
  _get_detector()
117
- _get_pose_model(DEFAULT_SIZE)
118
- # for _size in POSE_MODELS:
119
- # _get_pose_model(_size)
120
  print("[startup] ready.")
121
 
122
 
@@ -296,7 +293,7 @@ with gr.Blocks(title="Sapiens2 Pose", theme=gr.themes.Soft(), css=CUSTOM_CSS) as
296
 
297
  with gr.Row():
298
  size = gr.Radio(
299
- choices=["0.4B"], # iteration mode — re-add other sizes when shipping
300
  value=DEFAULT_SIZE,
301
  label="Model",
302
  scale=2,
 
63
  "config": os.path.join(CONFIGS_DIR, "sapiens2_5b_keypoints308_shutterstock_goliath_3po-1024x768.py"),
64
  },
65
  }
66
+ DEFAULT_SIZE = "1B"
67
 
68
  DETECTOR_MODEL_ID = "facebook/detr-resnet-50" # COCO person = label 1
69
 
 
110
  return _pose_model_cache[size]
111
 
112
 
113
+ print("[startup] pre-loading detector + all pose sizes ...")
 
 
114
  _get_detector()
115
+ for _size in POSE_MODELS:
116
+ _get_pose_model(_size)
 
117
  print("[startup] ready.")
118
 
119
 
 
293
 
294
  with gr.Row():
295
  size = gr.Radio(
296
+ choices=list(POSE_MODELS.keys()),
297
  value=DEFAULT_SIZE,
298
  label="Model",
299
  scale=2,