-
Python >= 3.6
-
PyTorch >= 1.1.0
-
PyYAML, tqdm, tensorboardX
-
We provide the dependency file of our experimental environment, you can install all dependencies by creating a new anaconda virtual environment and running
pip install -r requirements.txt -
Run
pip install -e torchlight
- NTU RGB+D 60 Skeleton
- NTU RGB+D 120 Skeleton
- NW-UCLA
- Request dataset here: http://rose1.ntu.edu.sg/Datasets/actionRecognition.asp
- Download the skeleton-only datasets:
nturgbd_skeletons_s001_to_s017.zip(NTU RGB+D 60)nturgbd_skeletons_s018_to_s032.zip(NTU RGB+D 120)- Extract above files to
./data/nturgbd_raw
- Download dataset from here
- Move
all_sqeto./data/NW-UCLA
Put downloaded data into the following directory structure:
- data/
- NW-UCLA/
- all_sqe
... # raw data of NW-UCLA
- ntu/
- ntu120/
- nturgbd_raw/
- nturgb+d_skeletons/ # from `nturgbd_skeletons_s001_to_s017.zip`
...
- nturgb+d_skeletons120/ # from `nturgbd_skeletons_s018_to_s032.zip`
...
- Generate NTU RGB+D 60 or NTU RGB+D 120 dataset:
cd ./data/ntu # or cd ./data/ntu120
# Get skeleton of each performer
python get_raw_skes_data.py
# Remove the bad skeleton
python get_raw_denoised_data.py
# Transform the skeleton to the center of the first frame
python seq_transformation.py
- To train model on NTU RGB+D 60/120 with bone or motion modalities, setting
bonearguments in the config filedefault.yamlor in the command line.
# Example: training on NTU RGB+D 120 cross subject under bone modality
python main_ddpm2.py --config config/nturgbd120-cross-subject/default.yaml --train_feeder_args bone=True --test_feeder_args bone=True --work-dir work_dir/ntu120/csub/gcn_bone --device 0
- To train model on NW-UCLA with others modalities, you need to modify
data_pathintrain_feeder_argsandtest_feeder_argsto "bone" or "motion" or "bone motion", and run
python main_ddpm2.py --config config/ucla/default.yaml --work-dir work_dir/ucla/gcn_xxx --device 0
- To test the trained models saved in <work_dir>, run the following command:
python main.py --config <work_dir>/config.yaml --work-dir <work_dir> --phase test --save-score True --weights <work_dir>/xxx.pt --device 0
- To ensemble the results of different modalities, run
# Example: ensemble six streams of GCN on NTU RGB+D cross subject
python ensemble.py --dataset ntu/csub --joint-dir work_dir/ntu/csub/joint ... --joint-curl-dir work_dir/ntu/csub/mask ...