This repo is the official implementation for the paper "DD-GCN: Directed Diffusion Graph Convolutional Network for Skeleton-based Human Action Recognition", (ICME 2023). Please jump to the master branch for codes.
- DD-GCN (a) has ten STGC layers, and each layer contains two modules: CAGC (b) and STSE (d). After global average pooling, Softmax is utilized for action classification. CAGC is the unit of channel-wise correlation modeling and Graph Convolution (GC) with activity partition strategy (c). STSE employs a Multi-head Attention Mechanism (MSA) and Group Temporal Convolution (GTC) for synchronized spatio-temporal embedding.
-
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: https://rose1.ntu.edu.sg/dataset/actionRecognition
- 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 the above files to
./data/nturgbd_raw
- Download the dataset from here
- Move
all_sqe
to./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
- Change the config file depending on what you want.
- Example: training DDGCN on NTU RGB+D 60 cross subject with bone data
python main.py --config config/nturgbd-cross-subject/train.yaml # default
- To train the model on joint, motion, and bone motion modalities, setting
bone
orvel
arguments in the config filetrain.yaml
or in the command line.
- 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
- Example: training DDGCN on NTU RGB+D 60 cross subject with bone data
python main.py --config config/nturgbd-cross-subject/test.yaml # default
This repo is based on CTR-GCN. Thanks to the original authors for their work!
Please cite this work if you find it useful.
@INPROCEEDINGS{ChangLi2023,
author={Li, Chang and Huang, Qian and Mao, Yingchi},
booktitle={2023 IEEE International Conference on Multimedia and Expo (ICME)},
title={DD-GCN: Directed Diffusion Graph Convolutional Network for Skeleton-based Human Action Recognition},
year={2023},
pages={786-791},
doi={10.1109/ICME55011.2023.00140}
}