Skip to content

lizishi/DeTRC

Repository files navigation

Efficient Action Counting with Dynamic Queries

Project Page YouTube

This is the official PyTorch implementation of the paper "Efficient Action Counting with Dynamic Queries". It provides a novel perspective to tackle the Temporal Repetition Counting problem using a simple yet effective representation for action cycles, reducing the computational complexity from quadratic to linear with SOTA performance.

Installation

We build our code based on the MMaction2 project (1.3.10 version). See here for more details if you are interested. MMCV is needed before install MMaction2, which can be install with:

pip install mmcv-full-f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
# For example, to install the latest mmcv-full with CUDA 11.1 and PyTorch 1.9.0, use the following command:
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html

For other CUDA or pytorch version, please refer to mmcv.

Then, our code can be built by

cd DeTRC
pip3 install -e .

Then, Install the 1D Grid Sampling and RoI Align operators.

cd DeTRC/model
python setup.py build_ext --inplace

Data

We use the TSN feature of RepCountA and UCFRep datasets. Please refer to the guidance here.

Train

Our model can be trained with

python tools/train.py DeTRC/configs/repcount_tsn_feature_enc_contrastive.py --validate

We recommend to set the --validate flag to monitor the training process.

Test

If you want to test the pretrained model, please use the following code. We provide the pretrained model here.

python tools/test.py DeTRC/configs/repcount_tsn_feature_enc_contrastive.py PATH_TO_CHECKPOINT

Results

pose_1 pose_1

Comparison with SOTA:

cmp_1

Citation

If you find our work useful for your project, please cite the paper as below:

@article{li2024efficient,
  title={Efficient Action Counting with Dynamic Queries},
  author={Li, Zishi and Ma, Xiaoxuan and Shang, Qiuyan and Zhu, Wentao and Ci, Hai and Qiao, Yu and Wang, Yizhou},
  journal={arXiv preprint arXiv:2403.01543},
  year={2024}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published