4D-Humans

shubham-goelMIT更新放缓

用 Transformer 从单目视频里重建并跟踪三维人体,输出带 SMPL 参数的动作序列,适合做人体建模和动作分析。

4DHumans: Reconstructing and Tracking Humans with Transformers

暂无版本1,731star180fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/shubham-goel/4D-Humans.git
cd 4D-Humans
conda env create -f environment.yml
conda activate 4D-humans
硬件要求按 README 说明

README 未说明推理所需显存;训练部分说明作者用 8 张 A100 训练 7 天,环境为 PyTorch 1.13.1、CUDA 11.6、Linux。

需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 Transformer 从图像和视频中重建并跟踪人体三维姿态与形状

用 Transformer 从单目视频里重建并跟踪三维人体,输出带 SMPL 参数的动作序列,适合做人体建模和动作分析。

核心能力

  • 用 ViTDet 检测人体、HMR2.0 回归 SMPL 三维姿态与形状
  • 支持对图片批量推理并渲染正视图、侧视图和 obj 网格
  • 基于 PHALP 在视频中重建并跟踪多人,输出带三维姿态的 pkl
  • 输入源支持视频文件、帧文件夹和 YouTube 链接
  • 提供训练与多数据集评测脚本,含 HMR2.0a/b 两版 checkpoint

容易踩的坑

需自行到 SMPL 官网注册下载 neutral 模型并放到 ./data/,否则无法运行 demo;视频跟踪需先额外 pip 安装 PHALP;首次运行会自动下载 checkpoint 和 data 到 $HOME/.cache/4DHumans,需保证网络与磁盘空间。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    4DHumans: Reconstructing and Tracking Humans with Transformers

    Code repository for the paper: Humans in 4D: Reconstructing and Tracking Humans with Transformers Shubham Goel, Georgios Pavlakos, Jathushan Rajasegaran, Angjoo Kanazawa*, Jitendra Malik*

    arXiv Website shields.io Open In Colab Hugging Face Spaces

    teaser

    Installation and Setup

    First, clone the repo. Then, we recommend creating a clean conda environment, installing all dependencies, and finally activating the environment, as follows:

    git clone https://github.com/shubham-goel/4D-Humans.git
    cd 4D-Humans
    conda env create -f environment.yml
    conda activate 4D-humans
    

    If conda is too slow, you can use pip:

    conda create --name 4D-humans python=3.10
    conda activate 4D-humans
    pip install torch
    pip install -e .[all]
    

    All checkpoints and data will automatically be downloaded to $HOME/.cache/4DHumans the first time you run the demo code.

    Besides these files, you also need to download the SMPL model. You will need the neutral model for training and running the demo code. Please go to the corresponding website and register to get access to the downloads section. Download the model and place basicModel_neutral_lbs_10_207_0_v1.0.0.pkl in ./data/.

    Run demo on images

    The following command will run ViTDet and HMR2.0 on all images in the specified --img_folder, and save renderings of the reconstructions in --out_folder. --batch_size batches the images together for faster processing. The --side_view flags additionally renders the side view of the reconstructed mesh, --full_frame renders all people together in front view, --save_mesh saves meshes as .objs.

    python demo.py \
        --img_folder example_data/images \
        --out_folder demo_out \
        --batch_size=48 --side_view --save_mesh --full_frame
    

    Run tracking demo on videos

    Our tracker builds on PHALP, please install that first:

    pip install git+https://github.com/brjathu/PHALP.git
    

    Now, run track.py to reconstruct and track humans in any video. Input video source may be a video file, a folder of frames, or a youtube link:

    # Run on video file
    python track.py video.source="example_data/videos/gymnasts.mp4"
    
    # Run on extracted frames
    python track.py video.source="/path/to/frames_folder/"
    
    # Run on a youtube link (depends on pytube working properly)
    python track.py video.source=\'"https://www.youtube.com/watch?v=xEH_5T9jMVU"\'
    

    The output directory (./outputs by default) will contain a video rendering of the tracklets and a .pkl file containing the tracklets with 3D pose and shape. Please see the PHALP repository for details.

    Training

    Download the training data to ./hmr2_training_data/, then start training using the following command:

    bash fetch_training_data.sh
    python train.py exp_name=hmr2 data=mix_all experiment=hmr_vit_transformer trainer=gpu launcher=local
    

    Checkpoints and logs will be saved to ./logs/. We trained on 8 A100 GPUs for 7 days using PyTorch 1.13.1 and PyTorch-Lightning 1.8.1 with CUDA 11.6 on a Linux system. You may adjust batch size and number of GPUs per your convenience.

    Evaluation

    Download the evaluation metadata to ./hmr2_evaluation_data/. Additionally, download the Human3.6M, 3DPW, LSP-Extended, COCO, and PoseTrack dataset images and update the corresponding paths in hmr2/configs/datasets_eval.yaml.

    Run evaluation on multiple datasets as follows, results are stored in results/eval_regression.csv.

    python eval.py --dataset 'H36M-VAL-P2,3DPW-TEST,LSP-EXTENDED,POSETRACK-VAL,COCO-VAL' 
    

    By default, our code uses the released checkpoint (mentioned as HMR2.0b in the paper). To use the HMR2.0a checkpoint, you may download and untar from here

    Preprocess code

    To preprocess LSP Extended and Posetrack into metadata zip files for evaluation, see hmr2/datasets/preprocess.

    Training data preprocessing coming soon.

    Acknowledgements

    Parts of the code are taken or adapted from the following repos:

    Additionally, we thank StabilityAI for a generous compute grant that enabled this work.

    Citing

    If you find this code useful for your research, please consider citing the following paper:

    @inproceedings{goel2023humans,
        title={Humans in 4{D}: Reconstructing and Tracking Humans with Transformers},
        author={Goel, Shubham and Pavlakos, Georgios and Rajasegaran, Jathushan and Kanazawa, Angjoo and Malik, Jitendra},
        booktitle={ICCV},
        year={2023}
    }