Skip to content

ICCV'23 Dual Learning with Dynamic Knowledge Distillation for Partially Relevant Video Retrieval

Notifications You must be signed in to change notification settings

HuiGuanLab/DL-DKD

Repository files navigation

DL-DKD++

This repository contains the source code of DL-DKD model and the extended DL-DKD++ model. If you would like to visit the DL-DKD model, please switch to the ICCV branch.

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 setup a deep learning workspace that supports PyTorch. Run the following script to install the required packages.

conda create --name DLDKD python=3.8
conda activate DLDKD
git clone https://github.com/HuiGuanLab/DL-DKD.git # 
cd DL-DKD
pip install -r requirements.txt
conda deactivate

DL-DKD++ on TVR

Required Data

Run the following script to download the video feature and text feature of the TVR dataset and place them in the specified path. The data can also be downloaded from Kuake pan. Please refer to here for more description of the dataset.

When you set label_style=hard, the model results are based on the results of the ICCV conference version paper.

DLDKD++ defaults to label_style=soft

Training

Run the following script to train DL-DKD++ network on TVR. It will save the chechpoint that performs best on the validation set as the final model.

label_style

root_path=$HOME/VisualSearch
mkdir -p $root_path && cd $root_path
unzip tvr.zip
#Add project root to PYTHONPATH (Note that you need to do this each time you start a new session.)
source setup.sh

conda activate DLDKD

root_path=$HOME/VisualSearch

./do_tvr.sh $root_path

Evaluation

The model is placed in the directory $root_path/results/$collection/$model_dir after training. To evaluate it, please run the following script:

collection=tvr
visual_feature=i3d_resnet
root_path=$HOME/VisualSearch
model_dir=tvr_DLDKD++

./do_test.sh $collection $visual_feature $root_path $model_dir

We also provide the trained checkpoint on TVR, run the following script to evaluate it. The model can also be downloaded from Here, passward=daNQ.

collection=tvr
visual_feature=i3d_resnet
root_path=$HOME/VisualSearch
model_dir=tvr/tvr_DLDKD++

unzip DLDKD++_checkpoint.zip -d $ROOTPATH/

./do_test.sh $collection $visual_feature $root_path $model_dir

$collection is the dataset that the model trained and evaluate on.

$visual_feature is the video feature corresponding to the dataset.

$model_dir is the path of checkpoints saved.

Expected performance

R@1 R@5 R@10 R@100 SumR
Text-to-Video 15.3 36.0 47.5 86.0 184.8

DL-DKD++ on Activitynet

Required Data

Run the following script to download the video feature and text feature of the Activitynet dataset and place them in the specified path. The data can also be downloaded from Kuake pan. Please refer to here for more description of the dataset.

When you set label_style=hard, the model results are based on the results of the ICCV conference version paper.

DLDKD++ defaults to label_style=soft

root_path=$HOME/VisualSearch
mkdir -p $root_path && cd $root_path
unzip activitynet.zip

Training

Run the following script to train DL-DKD++ network on Activitynet.

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

conda activate DLDKD

root_path=$HOME/VisualSearch

./do_activitynet.sh $root_path

Evaluation

The model is placed in the directory $root_path/$collection/results/$model_dir after training. To evaluate it, please run the following script:

collection=activitynet
visual_feature=i3d
root_path=$HOME/VisualSearch
model_dir=ac_DLDKD++

./do_test.sh $collection $visual_feature $root_path $model_dir

We also provide the trained checkpoint on Activitynet, run the following script to evaluate it. The model can also be downloaded from Here, passward=daNQ.

collection=activitynet
visual_feature=i3d
root_path=$HOME/VisualSearch
model_dir=activitynet/ac_DLDKD++

unzip DLDKD++_checkpoint.zip -d $ROOTPATH/

./do_test.sh $collection $visual_feature $root_path $model_dir

Expected performance

R@1 R@5 R@10 R@100 SumR
Text-to-Video 8.3 25.5 38.3 77.8 149.9

DL-DKD++ on Charades-STA

Required Data

Run the following script to download the video feature and text feature of the Charades-STA dataset and place them in the specified path. The data can also be downloaded from Baidu pan. Please refer to here for more description of the dataset.

When you set label_style=hard, the model results are based on the results of the ICCV conference version paper.

DLDKD++ defaults to label_style=soft

root_path=$HOME/VisualSearch
mkdir -p $root_path && cd $root_path
unzip charades.zip -d $root_path

Training

Run the following script to train DL-DKD++ network on Charades-STA.

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

conda activate DLDKD

root_path=$HOME/VisualSearch

./do_charades.sh $root_path

Evaluation

The model is placed in the directory $root_path/$collection/results/$model_dir after training. To evaluate it, please run the following script:

collection=charades
visual_feature=i3d
root_path=$HOME/VisualSearch
model_dir=charades_DLDKD++

./do_test.sh $collection $visual_feature $root_path $model_dir

We also provide the trained checkpoint on Charades-STA, run the following script to evaluate it. The model can also be downloaded from Here, passward=daNQ.

collection=charades
visual_feature=i3d
root_path=$HOME/VisualSearch
model_dir=charades/charades_DLDKD++

unzip DLDKD++_checkpoint.zip -d $ROOTPATH/

./do_test.sh $collection $visual_feature $root_path $model_dir

Expected performance

R@1 R@5 R@10 R@100 SumR
Text-to-Video 1.9 7.1 12.3 49.8 71.1

Reference

@inproceedings{dong2023dual,
  title={Dual learning with dynamic knowledge distillation for partially relevant video retrieval},
  author={Dong, Jianfeng and Zhang, Minsong and Zhang, Zheng and Chen, Xianke and Liu, Daizong and Qu, Xiaoye and Wang, Xun and Liu, Baolong},
  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
  pages={11302--11312},
  year={2023}
}

Acknowledgement

The codes are modified from TVRetrieval and ReLoCLNet.

This work was supported by the National Key R&D Program of China (2018YFB1404102), NSFC (62172420,61902347, 61976188, 62002323), the Public Welfare Technology Research Project of Zhejiang Province (LGF21F020010), the Open Projects Program of the National Laboratory of Pattern Recognition, the Fundamental Research Funds for the Provincial Universities of Zhejiang, and Public Computing Cloud of RUC.

About

ICCV'23 Dual Learning with Dynamic Knowledge Distillation for Partially Relevant Video Retrieval

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •