CAVIGATE

September 16, 2025 · View on GitHub

This repository is the official PyTorch implementation of our paper CAVIGATE: Caption and Audio-Guided Video Representation Learning with Gated Attention for Partially Relevant Video Retrieval.

Table of Contents

Environments

  • Python 3.8
  • PyTorch 1.9.0
  • torchvision 0.10.0
  • TensorBoard 2.6.0
  • tqdm 4.62.0
  • easydict 1.9
  • h5py 2.10.0
  • CUDA 11.1

We used Anaconda to set up a deep learning workspace that supports PyTorch. Run the following commands to create the environment and install the required packages:

conda create --name CAIVGATE python=3.8
conda activate CAVIGATE
git clone https://github.com/LexingtonJd/CAVIGATE.git # 
cd CAVIGATE
pip install -r requirements.txt
conda deactivate

Datasets

You can download the complete feature sets for ActivityNet Captions and TV Show Retrieval (TVR) from here. These feature sets were generously provided by MS-SL, and we gratefully acknowledge their contribution.

After preparing the dataset, extract it and set the data path in the corresponding .sh file (e.g., do_activitynet.sh).

Train

To train CAVIGATE on Activitynet Captions:

#Add project root to PYTHONPATH (Note that you need to do this each time you start a new session.)
source setup.sh
./do_activitynet.sh

To train CAVIGATE on TVR:

#Add project root to PYTHONPATH (Note that you need to do this each time you start a new session.)
source setup.sh
./do_tvr.sh

Evaluation

The model is placed in the directory rootpath/results/root_path/results/model_dir after training. To evaluate it, first set the checkpoint path in the corresponding .sh file (e.g., test_a.sh). To evaluate CAVIGATE on Activitynet Captions:

#Add project root to PYTHONPATH (Note that you need to do this each time you start a new session.)
source setup.sh
./test_a.sh

To evaluate CAVIGATE on TVR:

#Add project root to PYTHONPATH (Note that you need to do this each time you start a new session.)
source setup.sh
./test_t.sh

CheckPoint

We provide the trained checkpoints on the ActivityNet Captions and TVR datasets here, with their expected performance metrics as follows:

RoBERTa + I3D + ResNet

DatasetR@1R@5R@10R@100SumR
ActivityNet Captions9.728.941.478.7158.7
TVR18.140.751.787.3197.7

CLIP-ViT/B32

DatasetR@1R@5R@10MedRMnR
ActivityNet Captions15.036.749.883.0184.5
TVR26.451.062.491.5231.2

Acknowledgement

The codes are modified from DLDKD and GMMFormer. We sincerely acknowledge and appreciate the significant contributions of their authors.