The project is developed under the following environment:
- Python 3.10.x
- PyTorch 2.2.1
- CUDA 12.1 For installation of the project dependencies, please run:
pip install -r requirements.txt
- We follow the previous state-of-the-art method MotionBERT for dataset setup. Download the MotionBERT's preprocessed H3.6M data here and unzip it to 'data/motion3d'.
- Slice the motion clips by running the following python code in
data/preprocess
directory:
For our model with T = 243:
python h36m.py --n-frames 243
or T = 81
python h36m.py --n-frames 81
or T = 27
python h36m.py --n-frames 81
Please refer to P-STMO for dataset setup. After preprocessing, the generated .npz files (data_train_3dhp.npz
and data_test_3dhp.npz
) should be located at data/motion3d
directory.
After dataset preparation, you can train the model as follows:
You can train Human3.6M with the following command:
python train.py --config <PATH-TO-CONFIG>
where config files are located at configs/h36m
.
python train.py --config configs/h36m/TCPFormer_h36m_243.yaml
You can train MPI-INF-3DHP with the following command:
python train_3dhp.py --config <PATH-TO-CONFIG>
where config files are located at configs/mpi
.
python train_3dhp.py --config configs/mpi/TCPFormer_mpi_81.yaml
Dataset | frames | Checkpoint |
---|---|---|
Human3.6M | 81 | download |
Human3.6M | 243 | download |
MPI-INF-3DHP | 9 | download |
MPI-INF-3DHP | 27 | download |
MPI-INF-3DHP | 81 | download |
After downloading the weight from table above, you can evaluate Human3.6M models by:
python train.py --eval-only --checkpoint <CHECKPOINT-DIRECTORY> --checkpoint-file <CHECKPOINT-FILE-NAME> --config <PATH-TO-CONFIG>
For example if TCPFormer with T = 243 of H.36M is downloaded and put in checkpoint
directory, then you can run:
python train.py --eval-only --checkpoint checkpoint --checkpoint-file TCPFormer_h36m_243_379.pth.tr --config configs/h36m/TCPFormer_h36m_243.yaml
Similarly, TCPFormer with T = 81 of H.36M is downloaded and put in checkpoint
directory, then you can run:
python train.py --eval-only --checkpoint checkpoint --checkpoint-file TCPFormer_h36m_81_405.pth.tr --config configs/h36m/TCPFormer_h36m_81.yaml
For MPI-INF-3DHP dataset, you can download the checkpoint with T = 81 and put in checkpoint_mpi
directory, then you can run:
python train_3dhp.py --eval-only --checkpoint checkpoint_mpi --checkpoint-file TCPFormer_mpi_81.pth.tr --config configs/mpi/TCPFormer_mpi_81.yaml