Skip to content

PyTorch implementation of "Affinity Contrastive Learning for Skeleton-based Human Activity Understanding"

License

Notifications You must be signed in to change notification settings

firework8/ACLNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACLNet

This is the official PyTorch implementation for "Affinity Contrastive Learning for Skeleton-based Human Activity Understanding". [PDF] [Hugging Face]

Installation

git clone https://github.com/aclnet/ACLNet.git
cd ACLNet
conda env create -f aclnet.yaml
conda activate aclnet
pip install -e .

Data Preparation

PYSKL provides links to the pre-processed skeleton pickle annotations.

For Kinetics-Skeleton, since the skeleton annotations are large, please use the Kinetics Annotation Link to download the kpfiles and extract it under $ACLNet/data/k400 for Kinetics-Skeleton.

Note that the kpfiles needs to be extracted under Linux. Additionally, Kinetics-Skeleton requires the dependency Memcached to run, which could be referred to here.

You could check the official Data Doc of PYSKL for more detailed instructions.

Training & Testing

Please change the config file depending on what you want. You could use the 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 on NTU RGB+D X-Sub (Joint Modality) with 1 GPU, with validation, and test the checkpoint.
bash tools/dist_train.sh configs/ntu60_xsub/j.py 1 --validate --test-last --test-best
# Testing
bash tools/dist_test.sh {config_name} {checkpoint_file} {num_gpus} {other_options}
# For example: test on NTU RGB+D X-Sub (Joint Modality) with metrics `top_k_accuracy`, and dump the result to `result.pkl`.
bash tools/dist_test.sh configs/ntu60_xsub/j.py checkpoints/CHECKPOINT.pth 1 --eval top_k_accuracy --out result.pkl
# Ensemble the results
cd tools
python ensemble.py

Pretrained Models

All the checkpoints can be downloaded from here.

For the detailed performance of pretrained models, please go to the Model Doc.

Acknowledgements

This repo is mainly based on PYSKL. We also refer to MS-G3D, CTR-GCN, and FR-Head.

Thanks to the original authors for their excellent work!

Citation

If you find ACLNet useful in your research, please consider citing our paper:

@article{liu2026affinity,
  title={Affinity Contrastive Learning for Skeleton-based Human Activity Understanding},
  author={Liu, Hongda and Liu, Yunfan and Ren, Min and Sui, Lin and Wang, Yunlong and Sun, Zhenan},
  journal={arXiv preprint arXiv:2601.16694},
  year={2026}
}

Contact

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

About

PyTorch implementation of "Affinity Contrastive Learning for Skeleton-based Human Activity Understanding"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published