recommend installing pytorch and python packages using Anaconda
- cuda
- pytorch 0.4.0
- python3
- ffmpeg (can install using anaconda)
- tqdm
- pillow
- pretrainedmodels
- nltk
MSR-VTT. Test video doesn't have captions, so I spilit train-viedo to train/val/test. Extract and put them in ./data/
directory
- train-video: download link
- test-video: download link
- json info of train-video: download link
- json info of test-video: download link
以上链接已经失效,可以下载 16 版重新整理
https://www.mediafire.com/folder/h14iarbs62e7p/shared
(modified by mollnn)
all default options are defined in opt.py or corresponding code file, change them for your like.
Some code refers to ImageCaptioning.pytorch
you can use video-classification-3d-cnn-pytorch to extract features from video.
- preprocess videos and labels
python prepro_feats.py --output_dir data/feats/resnet152 --model resnet152 --n_frame_steps 40 --gpu 0
python prepro_vocab.py
(modified by mollnn)
- Training a model
python train.py --gpu 0 --epochs 3001 --batch_size 1 --checkpoint_path data/save --feats_dir data/feats/resnet152 --model S2VTAttModel --with_c3d 0 --dim_vid 2048
(modified by mollnn)
-
test
opt_info.json will be in same directory as saved model.
python eval.py --recover_opt data/save/opt_info.json --saved_model data/save/model_1000.pth --batch_size 100 --gpu 0
- lstm
- beam search
- reinforcement learning
- dataparallel (broken in pytorch 0.4)
Some code refers to ImageCaptioning.pytorch