Skip to content

πŸ‚ Training-Free Human Mesh Recovery from Videos, based on SAM-3, Diffusion-VAS, and SAM-3D-Body.

License

Notifications You must be signed in to change notification settings

gaomingqi/sam-body4d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‚ SAM-Body4D

Mingqi Gao, Yunqi Miao, Jungong Han

SAM-Body4D is a training-free method for temporally consistent and robust 4D human mesh recovery from videos. By leveraging pixel-level human continuity from promptable video segmentation together with occlusion recovery, it reliably preserves identity and full-body geometry in challenging in-the-wild scenes.

[ πŸ“„ Paper] [ 🌐 Project Page] [ πŸ“ BibTeX]

✨ Key Features

  • Temporally consistent human meshes across the entire video
  • Robust multi-human recovery under heavy occlusions
  • Robust 4D reconstruction under camera motion

πŸ•ΉοΈ Gradio Demo

gradio_demo.mp4

πŸ“Š Resource & Profiling Summary

For detailed GPU/CPU resource usage, peak memory statistics, and runtime profiling, please refer to:

πŸ‘‰ resources.md

πŸ–₯️ Installation

1. Create and Activate Environment

conda create -n body4d python=3.12 -y
conda activate body4d

2. Install PyTorch (choose the version that matches your CUDA), Detectron, and SAM3

pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu118
pip install 'git+https://github.com/facebookresearch/detectron2.git@a1ce2f9' --no-build-isolation --no-deps
pip install -e models/sam3

If you are using a different CUDA version, please select the matching PyTorch build from the official download page: https://pytorch.org/get-started/previous-versions/

3. Install Dependencies

pip install -e .

πŸš€ Run the Demo

1. Setup checkpoints & config (recommended)

We provide an automated setup script that:

  • generates configs/body4d.yaml from a release template,
  • downloads all required checkpoints (existing files will be skipped).

Some checkpoints (SAM 3 and SAM 3D Body) require prior access approval on Hugging Face. Before running the setup script, please make sure you have accepted access on their Hugging Face pages.

If you plan to use these checkpoints, login once:

huggingface-cli login

Then run the setup script:

python scripts/setup.py --ckpt-root /path/to/checkpoints

2. Run

python app.py

Manual checkpoint setup (optional)

If you prefer to download checkpoints manually (SAM 3, SAM 3D Body, MoGe-2, Diffusion-VAS, Depth-Anything V2), please place them under the directory with the following structure:

${CKPT_ROOT}/
β”œβ”€β”€ sam3/                                
β”‚   └── sam3.pt
β”œβ”€β”€ sam-3d-body-dinov3/
β”‚   β”œβ”€β”€ model.ckpt
β”‚   └── assets/
β”‚       └── mhr_model.pt
β”œβ”€β”€ moge-2-vitl-normal/
β”‚   └── model.pt
β”œβ”€β”€ diffusion-vas-amodal-segmentation/
β”‚   └── (directory contents)
β”œβ”€β”€ diffusion-vas-content-completion/
β”‚   └── (directory contents)
└── depth_anything_v2_vitl.pth

After placing the files correctly, you can run the setup script again. Existing files will be detected and skipped automatically.

πŸ“ Citation

If you find this repository useful, please consider giving a star ⭐ and citation.

@article{gao2025sambody4d,
  title   = {SAM-Body4D: Training-Free 4D Human Body Mesh Recovery from Videos},
  author  = {Gao, Mingqi and Miao, Yunqi and Han, Jungong},
  journal = {arXiv preprint arXiv:2512.08406},
  year    = {2025},
  url     = {https://arxiv.org/abs/2512.08406}
}

πŸ‘ Acknowledgements

The project is built upon SAM-3, Diffusion-VAS and SAM-3D-Body. We sincerely thank the original authors for their outstanding work and contributions.

About

πŸ‚ Training-Free Human Mesh Recovery from Videos, based on SAM-3, Diffusion-VAS, and SAM-3D-Body.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages