Giter Club home page Giter Club logo

himoseg's Introduction

History Repeats Itself: Human Motion Prediction via Motion Attention

Docker commands

Create container with local dataset: Both the repo and the dataset: docker run -it --network=host -e DISPLAY=$DISPLAY --gpus all -v ~/implements/HisRepItself/.:/workspace/HisRepItself -v ~/dataset/.:/workspace/HisRepItself/datasets/ --rm hisrepeat

Only the repo: docker run -it --network=host -e DISPLAY=$DISPLAY --gpus all -v ~/dataset/.:/workspace/HisRepItself/datasets/ --rm hisrepeat

This is the code for the paper

Wei Mao, Miaomiao Liu, Mathieu Salzmann. History Repeats Itself: Human Motion Prediction via Motion Attention. In ECCV 20.

Wei Mao, Miaomiao Liu, Mathieu Salzmann, Hongdong Li. Multi-level Motion Attention for Human Motion Prediction. In IJCV 21.

Dependencies

  • cuda 10.0
  • Python 3.6
  • Pytorch >1.0.0 (Tested on 1.1.0 and 1.3.0)

Get the data

Human3.6m in exponential map can be downloaded from here.

Directory structure:

H3.6m
|-- S1
|-- S5
|-- S6
|-- ...
`-- S11

AMASS from their official website..

Directory structure:

amass
|-- ACCAD
|-- BioMotionLab_NTroje
|-- CMU
|-- ...
`-- Transitions_mocap

3DPW from their official website.

Directory structure:

3dpw
|-- imageFiles
|   |-- courtyard_arguing_00
|   |-- courtyard_backpack_00
|   |-- ...
`-- sequenceFiles
    |-- test
    |-- train
    `-- validation

Put the all downloaded datasets in ./datasets directory.

Training

All the running args are defined in opt.py. We use following commands to train on different datasets and representations. To train,

python main_h36m_3d.py --kernel_size 10 --dct_n 20 --input_n 50 --output_n 10 --skip_rate 1 --batch_size 32 --test_batch_size 32 --in_features 66
python main_h36m_ang.py --kernel_size 10 --dct_n 20 --input_n 50 --output_n 10 --skip_rate 1 --batch_size 32 --test_batch_size 32 --in_features 48
python main_amass_3d.py --kernel_size 10 --dct_n 35 --input_n 50 --output_n 25 --skip_rate 5 --batch_size 128 --test_batch_size 128 --in_features 54 

Training of multi-level attention

To train joint-level attention

python main_h36m_3d_joints.py --in_features 66 --kernel_size 10 --dct_n 20 --input_n 50 --output_n 10 --skip_rate 1 --batch_size 32 --test_batch_size 32

To train part-level attention

python main_h36m_3d_parts.py --in_features 66 --kernel_size 10 --dct_n 20 --input_n 50 --output_n 10 --skip_rate 1 --batch_size 32 --test_batch_size 32

To train post fusion model. (Since the pretrained joint and part-level attantion models exceed the github file limit, we compress the checkpoints.)

python python main_h36m_3d_post_fusion.py --in_features 66 --kernel_size 10 --dct_n 20 --input_n 50 --output_n 10 --skip_rate 1 --batch_size 32 --test_batch_size 32 --epoch 20

Evaluation

To evaluate the pretrained model,

python main_h36m_3d_eval.py --is_eval --kernel_size 10 --dct_n 20 --input_n 50 --output_n 25 --skip_rate 1 --batch_size 32 --test_batch_size 32 --in_features 66 --ckpt ./checkpoint/pretrained/h36m_3d_in50_out10_dctn20/
python main_h36m_ang_eval.py --is_eval --kernel_size 10 --dct_n 20 --input_n 50 --output_n 25 --skip_rate 1 --batch_size 32 --test_batch_size 32 --in_features 48 --ckpt ./checkpoint/pretrained/h36m_ang_in50_out10_dctn20/
python main_amass_3d_eval.py --is_eval --kernel_size 10 --dct_n 35 --input_n 50 --output_n 25 --skip_rate 5 --batch_size 128 --test_batch_size 128 --in_features 54 --ckpt ./checkpoint/pretrained/amass_3d_in50_out25_dctn30/

Citing

If you use our code, please cite our work

@inproceedings{wei2020his,
  title={History Repeats Itself: Human Motion Prediction via Motion Attention},
  author={Wei, Mao and Miaomiao, Liu and Mathieu, Salzemann},
  booktitle={ECCV},
  year={2020}
}

@article{mao2021multi,
  title={Multi-level motion attention for human motion prediction},
  author={Mao, Wei and Liu, Miaomiao and Salzmann, Mathieu and Li, Hongdong},
  journal={International Journal of Computer Vision},
  volume={129},
  number={9},
  pages={2513--2535},
  year={2021},
  publisher={Springer}
}

Acknowledgments

The overall code framework (dataloading, training, testing etc.) is adapted from 3d-pose-baseline.

The predictor model code is adapted from LTD.

Some of our evaluation code and data process code was adapted/ported from Residual Sup. RNN by Julieta.

Licence

MIT

himoseg's People

Contributors

savicktso avatar wei-mao-2019 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.