A unified Human Mesh Recovery (HMR) benchmarking framework that integrates multiple state-of-the-art HMR models for easy comparison and evaluation.
- Unified Interface: Run different HMR models through a unified command-line interface
- Multi-Model Support: Integrates multiple state-of-the-art HMR models including WHAM, TokenHMR, CameraHMR, 4D Human, PromptHMR, and more (WIP)
- Video Processing: Supports human mesh recovery on video inputs
- Standardized Output: All models output in a unified format for easy comparison
- Easy to Extend: Modular design makes it easy to add new models
This project integrates the following HMR models:
- WHAM - Whole-Body Human Activity and Motion
- TokenHMR - Token-based Human Mesh Recovery
- CameraHMR - Camera-aware Human Mesh Recovery
- 4D Human (HMR2.0) - 4D Human Mesh Recovery
- PromptHMR - Prompt-based Human Mesh Recovery
- NLF - Neural Light Field (WIP)
- Python 3.10+
- CUDA 12.8+ (recommended)
- Linux system
git clone https://github.com/SijiaLii/hmr_benchmark.git --recursive
cd hmr_benchmarkconda create -n hmr python=3.10 -y
conda activate hmrFor detailed installation instructions, please refer to docs/INSTALL.md.
Basic dependency installation:
pip install -r requirements.txtEach model needs to be installed separately. Please follow the instructions in docs/INSTALL.md.
python run.py --model WHAM --video_pth videos/gymnasts.mp4 --output_pth output/WHAM# Run WHAM
python scripts/run_WHAM.py --video videos/gymnasts.mp4 --output_pth output/WHAM
# Run TokenHMR
python scripts/run_TokenHMR.py --video videos/gymnasts.mp4 --output_pth output/TokenHMR
# Run CameraHMR
python scripts/run_CameraHMR.py --video videos/gymnasts.mp4 --output_folder output/CameraHMR
# Run 4D Human
python scripts/run_4dHuman.py --video videos/gymnasts.mp4 --output_pth output/4dHumanpython run.py \
--model <MODEL_NAME> \
--video_pth <VIDEO_PATH> \
--output_pth <OUTPUT_DIR> \
[--extra_args ...]Arguments:
--model: Model name (e.g., WHAM, TokenHMR, CameraHMR, etc.)--video_pth: Path to input video file--output_pth: Path to output directory--extra_args: Additional arguments passed to the specific model
Each model has its own run script in the scripts/ directory:
run_WHAM.py: Run WHAM modelrun_TokenHMR.py: Run TokenHMR modelrun_CameraHMR.py: Run CameraHMR modelrun_4dHuman.py: Run 4D Human model
For specific arguments of each script, use --help:
python scripts/run_WHAM.py --helpAll models output in a unified format, saved in output/<MODEL_NAME>/<VIDEO_NAME>/ directory:
-
<model>_output.pkl: Pickle file containing model predictionspose: SMPL pose parameters (N, 72) - includes root and body jointstrans: Translation vector (N, 3)betas: Shape parameters (10,)verts: 3D vertex coordinates (N, V, 3)frame_ids: Frame indices (N,)
-
output.mp4: Visualization video (if supported by the model)
import joblib
# Load results
results = joblib.load('output/WHAM/gymnasts/wham_output.pkl')
# Access results for specific person
for person_id, data in results.items():
pose = data['pose'] # (N, 72)
trans = data['trans'] # (N, 3)
betas = data['betas'] # (10,)
verts = data['verts'] # (N, V, 3)
frame_ids = data['frame_ids'] # (N,)This project depends on multiple third-party libraries. Main dependencies include:
- PyTorch (recommended with CUDA 12.8)
- SMPL-X
- Detectron2
- OpenCV
- NumPy, SciPy
- Hydra (configuration management)
- Other model-specific dependencies
For a complete list of dependencies, please refer to requirements.txt and docs/INSTALL.md.
This project integrates multiple third-party models, each of which may have its own license. Please check the license files of each model before use.
This project integrates the following excellent open-source projects:
Thanks to all contributors for their hard work!