dingfengshi / TriDet

[CVPR2023] Code for the paper, TriDet: Temporal Action Detection with Relative Boundary Modeling
MIT License
160 stars 13 forks source link

[CVPR2023] TriDet: Temporal Action Detection with Relative Boundary Modeling

PWC PWC PWC PWC

Image Title

Overview

This repository contains the code for TriDet: Temporal Action Detection with Relative Boundary Modeling paper, which has been accepted for CVPR2023. Our code is built upon the codebase from ActionFormer and Detectron2, and we would like to express our gratitude for their outstanding work.

To quickly get start with the model architecture, you can focus mainly on the following files:

Update Log

Installation

  1. Please ensure that you have installed PyTorch and CUDA. (This code requires PyTorch version >= 1.11. We use version=1.11.0 in our experiments)

  2. Install the required packages by running the following command:

pip install  -r requirements.txt
  1. Install NMS
cd ./libs/utils
python setup.py install --user
cd ../..
  1. Done! We are ready to get start!

Data Preparation

Quick Start

We provide a list of scripts that allow you to reproduce our results with just one click. These scripts are located in the ./tools folder and include:

To easily reproduce our results, simply run the following command:

bash SCRIPT_PATH GPU_NUM

For example, if you want to train and eval our model on THUMOS14 dataset using the first GPU on you machine, you can run:

bash tools/thumos_i3d_script.sh 0

The mean average precision (mAP) results for each dataset are:

Dataset 0.3 0.4 0.5 0.6 0.7 Avg
THUMOS14 83.62 80.07 72.94 62.35 47.35 69.27
Dataset 0.1 0.2 0.3 0.4 0.5 Avg
EPIC-KITCHEN-noun 27.38 26.28 24.60 22.23 18.28 23.76
Dataset 0.1 0.2 0.3 0.4 0.5 Avg
EPIC-KITCHEN-verb 28.72 27.57 26.19 24.26 20.83 25.51
Dataset 0.5 0.75 0.95 Avg
HACS 56.90 39.33 11.24 38.69
Dataset 0.5 0.75 0.95 Avg
ActivityNet 54.71 38.01 8.35 36.77

There has been a slight improvement in the results of some datasets compared to those reported in the paper. Note: We conduct all our experiments on a single A100-40G GPU and the training results may vary depending on the type of GPU used.

Test

We offer pre-trained models for each dataset, which you can download the chechpoints from Google Drive. The command for test is

python eval.py ./configs/CONFIG_FILE PATH_TO_CHECKPOINT

Contact

If you have any questions about the code, feel free to contact shidingfeng at buaa dot edu dot cn.

References

If you find this work helpful, please consider citing our paper

@inproceedings{shi2023tridet,
  title={TriDet: Temporal Action Detection with Relative Boundary Modeling},
  author={Shi, Dingfeng and Zhong, Yujie and Cao, Qiong and Ma, Lin and Li, Jia and Tao, Dacheng},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={18857--18866},
  year={2023}
}