Views
No views yet
--pretrained_clip_name
1# From CLIP
2conda install --yes -c pytorch pytorch=1.7.1 torchvision cudatoolkit=11.0
3pip install ftfy regex tqdm
4pip install opencv-python boto3 requests pandaswget https://github.com/ArrowLuo/CLIP4Clip/releases/download/v0.0/msrvtt_data.zipwget https://www.robots.ox.ac.uk/~maxbain/frozen-in-time/data/MSRVTT.zipraw_captions can be found in the wonderful job collaborative-experts. For the convenience, you can also download them by,wget https://github.com/ArrowLuo/CLIP4Clip/releases/download/v0.0/msvd_data.zippython preprocess/compress_video.py --input_root [raw_video_path] --output_root [compressed_video_path]--features_pathis the video root path--linear_patchcan be set with2dor3d--sim_headercan be set withmeanP,seqLSTM,seqTransf, ortightTransf--pretrained_clip_namecan be set withViT-B/32orViT-B/16--resume_modelcan be used to reload the saved optimizer state to continuely train the model, Note: need to set the corresponding chechpoint via--init_modelsimultaneously.
--linear_patch and --sim_header. Test more hyperparameters for better performance.wget -P ./modules https://openaipublic.azureedge.net/clip/models/40d365715913c9da98579312b702a82c18be219cc2a73407c4526f58eba950af/ViT-B-32.ptwget -P ./modules https://openaipublic.azureedge.net/clip/models/5806e77cd80f8b59890b7e101eabd078d9fb84e6937f9e85e4ecb61988df416f/ViT-B-16.pt1DATA_PATH=[Your MSRVTT data and videos path]
2python -m torch.distributed.launch --nproc_per_node=4 \
3main_task_retrieval.py --do_train --num_thread_reader=0 \
4--epochs=5 --batch_size=128 --n_display=50 \
5--train_csv ${DATA_PATH}/MSRVTT_train.9k.csv \
6--val_csv ${DATA_PATH}/MSRVTT_JSFUSION_test.csv \
7--data_path ${DATA_PATH}/MSRVTT_data.json \
8--features_path ${DATA_PATH}/MSRVTT_Videos \
9--output_dir ckpts/ckpt_msrvtt_retrieval_looseType \
10--lr 1e-4 --max_words 32 --max_frames 12 --batch_size_val 16 \
11--datatype msrvtt --expand_msrvtt_sentences \
12--feature_framerate 1 --coef_lr 1e-3 \
13--freeze_layer_num 0 --slice_framepos 2 \
14--loose_type --linear_patch 2d --sim_header meanP \
15--pretrained_clip_name ViT-B/321DATA_PATH=[Your MSVD data and videos path]
2python -m torch.distributed.launch --nproc_per_node=4 \
3main_task_retrieval.py --do_train --num_thread_reader=2 \
4--epochs=5 --batch_size=128 --n_display=50 \
5--data_path ${DATA_PATH} \
6--features_path ${DATA_PATH}/MSVD_Videos \
7--output_dir ckpts/ckpt_msvd_retrieval_looseType \
8--lr 1e-4 --max_words 32 --max_frames 12 --batch_size_val 16 \
9--datatype msvd \
10--feature_framerate 1 --coef_lr 1e-3 \
11--freeze_layer_num 0 --slice_framepos 2 \
12--loose_type --linear_patch 2d --sim_header meanP \
13--pretrained_clip_name ViT-B/321DATA_PATH=[Your LSMDC data and videos path]
2python -m torch.distributed.launch --nproc_per_node=4 \
3main_task_retrieval.py --do_train --num_thread_reader=2 \
4--epochs=5 --batch_size=128 --n_display=50 \
5--data_path ${DATA_PATH} \
6--features_path ${DATA_PATH}/LSMDC_Videos \
7--output_dir ckpts/ckpt_lsmdc_retrieval_looseType \
8--lr 1e-4 --max_words 32 --max_frames 12 --batch_size_val 16 \
9--datatype lsmdc --feature_framerate 1 --coef_lr 1e-3 \
10--freeze_layer_num 0 --slice_framepos 2 \
11--loose_type --linear_patch 2d --sim_header meanP \
12--pretrained_clip_name ViT-B/321DATA_PATH=[Your ActivityNet data and videos path]
2python -m torch.distributed.launch --nproc_per_node=8 \
3main_task_retrieval.py --do_train --num_thread_reader=2 \
4--epochs=5 --batch_size=128 --n_display=50 \
5--data_path ${DATA_PATH} \
6--features_path ${DATA_PATH}/Activity_Videos \
7--output_dir ckpts/ckpt_activity_retrieval_looseType \
8--lr 1e-4 --max_words 64 --max_frames 64 --batch_size_val 16 \
9--datatype activity --feature_framerate 1 --coef_lr 1e-3 \
10--freeze_layer_num 0 --slice_framepos 2 \
11--loose_type --linear_patch 2d --sim_header meanP \
12--pretrained_clip_name ViT-B/321DATA_PATH=[Your DiDeMo data and videos path]
2python -m torch.distributed.launch --nproc_per_node=8 \
3main_task_retrieval.py --do_train --num_thread_reader=2 \
4--epochs=5 --batch_size=128 --n_display=50 \
5--data_path ${DATA_PATH} \
6--features_path ${DATA_PATH}/DiDeMo_Videos \
7--output_dir ckpts/ckpt_didemo_retrieval_looseType \
8--lr 1e-4 --max_words 64 --max_frames 64 --batch_size_val 16 \
9--datatype didemo --feature_framerate 1 --coef_lr 1e-3 \
10--freeze_layer_num 0 --slice_framepos 2 \
11--loose_type --linear_patch 2d --sim_header meanP \
12--pretrained_clip_name ViT-B/321@Article{Luo2021CLIP4Clip,
2 author = {Huaishao Luo and Lei Ji and Ming Zhong and Yang Chen and Wen Lei and Nan Duan and Tianrui Li},
3 title = {{CLIP4Clip}: An Empirical Study of CLIP for End to End Video Clip Retrieval},
4 journal = {arXiv preprint arXiv:2104.08860},
5 year = {2021},
6}