Skip to content
/ BRL Public

PyTorch implementation of "Balanced Representation Learning for Long-tailed Skeleton-based Action Recognition"

License

Notifications You must be signed in to change notification settings

firework8/BRL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BRL

PyTorch implementation of "Balanced Representation Learning for Long-tailed Skeleton-based Action Recognition" [PDF]

Dependencies

  • Python >= 3.6
  • PyTorch >= 1.5.0
  • PyYAML, tqdm, tensorboardX
  • We provide the dependency file of the 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 .

Data Preparation

Download Datasets

There are 4 datasets to download:

  • NTU RGB+D 60
  • NTU RGB+D 120
  • NW-UCLA
  • Kinetics-Skeleton

Please check Data Download for the download links and descriptions of the annotation format. After finishing the download and placement, the BRL code is now ready to run.

Instruction for Data Processing

We provide the long-tailed settings for NTU 60-LT and NTU 120-LT, which are generated by imblance_gentxt. Additionally, we use ucla_data to construct NW-UCLA-LT. Through the config, BRL will directly apply the corresponding long-tailed settings during training.

If you would like to construct the experiments with classical methods, a detailed download instructions is provided here. You could follow the official processing of these classical methods for the raw data.

For a fair comparison, we provide the processing script imblance_gendata_from_txt that helps to generate the same long-tailed version of the raw data.

Training & Testing

You can use following commands for training and testing. Basically, we support distributed training on a single server with multiple GPUs.

# Training
bash tools/dist_train.sh {config_name} {num_gpus} {other_options}
# For example: train BRL on NTURGB+D XSub (Joint Modality) with one GPU, with validation, and test the last and the best (with best validation metric) checkpoint.
bash tools/dist_train.sh configs/BRL/ntu60_xsub_LT/j.py 1 --validate --test-last --test-best
# Testing
bash tools/dist_test.sh {config_name} {checkpoint} {num_gpus} --out {output_file} --eval {optional_arguments}
# For example: test BRL on NTURGB+D XSub (Joint Modality) with metrics `top_k_accuracy`, and dump the result to `result.pkl`.
bash tools/dist_test.sh configs/BRL/ntu60_xsub_LT/j.py checkpoints/SOME_CHECKPOINT.pth 1 --eval top_k_accuracy --out result.pkl
# Ensemble the results
cd ./tools
python ensemble.py

Experimental Results

We present the results trained on NTU RGB+D 60, NTU RGB+D 120 and Kinetics-400 in the long-tailed training setting. We also provide checkpoints for six modalities: Joint, Bone, Skip, Joint Motion, Bone Motion, and Skip Motion.

BRL Checkpoint

We release numerous checkpoints for BRL trained with various modalities, annotations on NTU RGB+D 60, NTU RGB+D 120 and Kinetics-400. The accuracy of each modality links to the weight file.

Dataset Annotation Joint Top1 Bone Top1 Skip Top1 Joint Motion Top1 Bone Motion Top1 Skip Motion Top1 Two Stream Top1 Four Stream Top1 Six Stream Top1
NTURGB+D XSub Official 3D Skeleton joint_config: 76.7 bone_config: 76.1 skip_config: 77.7 joint_motion_config: 75.0 bone_motion_config: 72.8 skip_motion_config: 73.4 79.6 81.0 81.8
NTURGB+D XView Official 3D Skeleton joint_config: 81.4 bone_config: 80.3 skip_config: 81.1 joint_motion_config: 78.5 bone_motion_config: 76.2 skip_motion_config: 77.2 84.0 84.9 85.4
NTURGB+D 120 XSub Official 3D Skeleton joint_config: 65.3 bone_config: 65.3 skip_config: 64.2 joint_motion_config: 59.7 bone_motion_config: 59.8 skip_motion_config: 59.6 68.7 69.4 69.7
NTURGB+D 120 XSet Official 3D Skeleton joint_config: 66.8 bone_config: 66.6 skip_config: 65.9 joint_motion_config: 63.5 bone_motion_config: 62.2 skip_motion_config: 61.6 69.7 71.0 71.3
Kinetics-400 HRNet 2D Pose joint_config: 45.6 bone_config: 45.2 joint_motion_config: 42.0 bone_motion_config: 41.2 48.1 (1:1) 48.6 (3:3:1:1)

Supported Algorithms

For specific examples and other pre-trained models, please go to the README.

Acknowledgements

This repo is based on MS-G3D, CTR-GCN, and PYSKL.

Thanks to the authors for their work!

Citation

@article{liu2023balanced,
  title={Balanced Representation Learning for Long-tailed Skeleton-based Action Recognition},
  author={Liu, Hongda and Wang, Yunlong and Ren, Min and Hu, Junxing and Luo, Zhengquan and Hou, Guangqi and Sun, Zhenan},
  journal={arXiv preprint arXiv:2308.14024},
  year={2023}
}

Contact

For any questions, feel free to contact: hongda.liu@cripac.ia.ac.cn

About

PyTorch implementation of "Balanced Representation Learning for Long-tailed Skeleton-based Action Recognition"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published