Resolve SMPL/SMPLX family model path with sensible defaults. Env overrides: - SMPLX_MODEL_PATH for smplx - SMPLH_MODEL_PATH for smplh Fallback to project-local body_models/{smpl_type}
(smpl_type: str)
| 29 | |
| 30 | |
| 31 | def _default_smpl_model_path(smpl_type: str) -> str: |
| 32 | """Resolve SMPL/SMPLX family model path with sensible defaults. |
| 33 | |
| 34 | Env overrides: |
| 35 | - SMPLX_MODEL_PATH for smplx |
| 36 | - SMPLH_MODEL_PATH for smplh |
| 37 | Fallback to project-local body_models/{smpl_type} |
| 38 | """ |
| 39 | if smpl_type == "smplx": |
| 40 | env_path = os.environ.get("SMPLX_MODEL_PATH") |
| 41 | fallback = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "data", "body_models", "smplx")) |
| 42 | elif smpl_type == "smplh": |
| 43 | env_path = os.environ.get("SMPLH_MODEL_PATH") |
| 44 | fallback = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "data", "body_models", "smplh")) |
| 45 | else: |
| 46 | raise ValueError(f"Unsupported smpl_type: {smpl_type}") |
| 47 | return env_path or fallback |
| 48 | |
| 49 | |
| 50 | def get_video_properties(video_path: str) -> Tuple[int, int, int]: |