tsn pytorch
1.0.0
我们发布了MMACTION,这是一种基于Pytorch的完整动作理解工具箱。它包括针对TSN以及其他STOA框架的实施。我们在此存储库中学到的教训被整合到mmAction中,以使其成为赌注。我们强烈建议您切换到它。此存储库将留在这里进行历史参考。
注意:始终使用git clone --recursive https://github.com/yjxiong/tsn-pytorch克隆这个项目。否则,您将无法使用Inception系列CNN Archs。
这是pytorch中时间段网络(TSN)的重新实现。所有设置都与原始的CAFFE实施相同。
对于光流提取和视频列表的生成,您仍然需要使用原始的TSN代码库。
要训练新模型,请使用main.py脚本。
在UCF101上重现RGB模式的原始TSN实验的命令可以是
python main.py ucf101 RGB < ucf101_rgb_train_list > < ucf101_rgb_val_list >
--arch BNInception --num_segments 3
--gd 20 --lr 0.001 --lr_steps 30 60 --epochs 80
-b 128 -j 8 --dropout 0.8
--snapshot_pref ucf101_bninception_ 对于流模型:
python main.py ucf101 Flow < ucf101_flow_train_list > < ucf101_flow_val_list >
--arch BNInception --num_segments 3
--gd 20 --lr 0.001 --lr_steps 190 300 --epochs 340
-b 128 -j 8 --dropout 0.7
--snapshot_pref ucf101_bninception_ --flow_pref flow_ 对于RGB-DIFF模型:
python main.py ucf101 RGBDiff < ucf101_rgb_train_list > < ucf101_rgb_val_list >
--arch BNInception --num_segments 7
--gd 40 --lr 0.001 --lr_steps 80 160 --epochs 180
-b 128 -j 8 --dropout 0.8
--snapshot_pref ucf101_bninception_ 训练后,将由Pytorch保存的检查点,例如ucf101_bninception_rgb_checkpoint.pth 。
使用以下命令在标准TSN测试协议中测试其性能:
python test_models.py ucf101 RGB < ucf101_rgb_val_list > ucf101_bninception_rgb_checkpoint.pth
--arch BNInception --save_scores < score_file_name >
或用于流模型:
python test_models.py ucf101 Flow < ucf101_rgb_val_list > ucf101_bninception_flow_checkpoint.pth
--arch BNInception --save_scores < score_file_name > --flow_pref flow_