利用3D残差网络学习时空特征,应用于动作识别场景
我们的论文“时空3D CNN可以回溯2D CNN和ImageNet的历史吗?” 被CVPR2018接受!
我们更新纸质信息。
我们在UCF-101和HMDB-51上传了一些微调模型。
ResNeXt-101在UCF-101上进行了微调(split1)
在UCF-101(split1)上微调ResNeXt-101(64帧输入)
ResNeXt-101在HMDB-51上进行了微调(split1)
在HMDB-51(split1)上微调ResNeXt-101(64帧输入)
我们发表了一篇关于arXiv 的新论文。
我们还在此存储库中添加了以下新模型及其Kinetics预训练模型。
ResNet-50,101,152,200
预激活ResNet-200
广泛的ResNet-50
ResNeXt-101
DenseNet-121,201
此外,我们还支持新的数据集(UCF-101和HDMB-51)和微调功能。
包括一些细微的变化。
在测试中通过softmax对输出进行归一化。
如果您不想执行标准化,请使用--no_softmax_in_test
选项。
这是以下论文的PyTorch代码:
Kensho Hara,Hirokatsu Kataoka和Yutaka Satoh,
“用于动作识别的3D残余网络学习时空特征”,
ICCV行动,手势和情感识别研讨会论文集,2017年。
此代码包括对Kinetics,ActivityNet,UCF-101和HMDB-51的培训,微调和测试。
如果您想使用我们的预训练模型对视频进行分类或提取视频功能,请使用此代码。
此代码的Torch(Lua)版本可在此处获得。
请注意,Torch版本仅包括ResNet-18,34,50,101和152。
如果您使用此代码或预先训练的模型,请引用以下内容:
@article{hara3dcnns, author={Kensho Hara and Hirokatsu Kataoka and Yutaka Satoh}, title={Can Spatiotemporal 3D CNNs Retrace the History of 2D CNNs and ImageNet?}, journal={arXiv preprint}, volume={arXiv:1711.09577}, year={2017},}
这里提供预先训练的模型。
所有模型都接受了Kinetics的培训。
ResNeXt-101在我们的实验中取得了最佳性能。(详见论文。)
resnet-18-kinetics.pth: --model resnet --model_depth 18 --resnet_shortcut Aresnet-34-kinetics.pth: --model resnet --model_depth 34 --resnet_shortcut Aresnet-34-kinetics-cpu.pth: CPU ver. of resnet-34-kinetics.pthresnet-50-kinetics.pth: --model resnet --model_depth 50 --resnet_shortcut Bresnet-101-kinetics.pth: --model resnet --model_depth 101 --resnet_shortcut Bresnet-152-kinetics.pth: --model resnet --model_depth 152 --resnet_shortcut Bresnet-200-kinetics.pth: --model resnet --model_depth 200 --resnet_shortcut Bpreresnet-200-kinetics.pth: --model preresnet --model_depth 200 --resnet_shortcut Bwideresnet-50-kinetics.pth: --model wideresnet --model_depth 50 --resnet_shortcut B --wide_resnet_k 2resnext-101-kinetics.pth: --model resnext --model_depth 101 --resnet_shortcut B --resnext_cardinality 32densenet-121-kinetics.pth: --model densenet --model_depth 121densenet-201-kinetics.pth: --model densenet --model_depth 201
UCF-101和HMDB-51(拆分1)上的一些微调模型也可用。
resnext-101-kinetics-ucf101_split1.pth: --model resnext --model_depth 101 --resnet_shortcut B --resnext_cardinality 32resnext-101-64f-kinetics-ucf101_split1.pth: --model resnext --model_depth 101 --resnet_shortcut B --resnext_cardinality 32 --sample_duration 64resnext-101-kinetics-hmdb51_split1.pth: --model resnext --model_depth 101 --resnet_shortcut B --resnext_cardinality 32resnext-101-64f-kinetics-hmdb51_split1.pth: --model resnext --model_depth 101 --resnet_shortcut B --resnext_cardinality 32 --sample_duration 64
该表显示了动力学上的前1和前5的平均精度。
| 方法| 准确度| |:--- |:---:| | ResNet-18 | 66.1 | | ResNet-34 | 71.0 | | ResNet-50 | 72.2 | | ResNet-101 | 73.3 | | ResNet-152 | 73.7 | | ResNet-200 | 73.7 | | ResNet-200(预先行动)| 73.4 | | 广泛的ResNet-50 | 74.7 | | ResNeXt-101 | 75.4 | | DenseNet-121 | 70.8 | | DenseNet-201 | 72.3 |
conda install pytorch torchvision cuda80 -c soumith
FFmpeg,FFprobe
wget http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xztar xvf ffmpeg-release-64bit-static.tar.xzcd ./ffmpeg-3.3.3-64bit-static/; sudo cp ffmpeg ffprobe /usr/local/bin;
Python 3
使用官方抓取工具下载视频。
使用从avi转换为jpg文件 utils/video_jpg.py
python utils/video_jpg.py avi_video_directory jpg_video_directory
使用生成fps文件 utils/fps.py
python utils/fps.py avi_video_directory jpg_video_directory
使用官方抓取工具下载视频。
找到测试集video_directory/test
。
使用从avi转换为jpg文件 utils/video_jpg_kinetics.py
python utils/video_jpg_kinetics.py avi_video_directory jpg_video_directory
使用生成n_frames文件 utils/n_frames_kinetics.py
python utils/n_frames_kinetics.py jpg_video_directory
使用类似于ActivityNet的json格式生成注释文件 utils/kinetics_json.py
CSV文件(kinetics_ {train,val,test} .csv)包含在爬网程序中。
python utils/kinetics_json.py train_csv_path val_csv_path test_csv_path dst_json_path
在此处下载视频和训练/测试分组。
使用从avi转换为jpg文件 utils/video_jpg_ucf101_hmdb51.py
python utils/video_jpg_ucf101_hmdb51.py avi_video_directory jpg_video_directory
使用生成n_frames文件 utils/n_frames_ucf101_hmdb51.py
python utils/n_frames_ucf101_hmdb51.py jpg_video_directory
使用类似于ActivityNet的json格式生成注释文件 utils/ucf101_json.py
annotation_dir_path
包括classInd.txt,trainlist0 {1,2,3} .txt,testlist0 {1,2,3} .txt
python utils/ucf101_json.py annotation_dir_path
在此处下载视频和训练/测试分组。
使用从avi转换为jpg文件 utils/video_jpg_ucf101_hmdb51.py
python utils/video_jpg_ucf101_hmdb51.py avi_video_directory jpg_video_directory
使用生成n_frames文件 utils/n_frames_ucf101_hmdb51.py
python utils/n_frames_ucf101_hmdb51.py jpg_video_directory
使用类似于ActivityNet的json格式生成注释文件 utils/hmdb51_json.py
annotation_dir_path
包括brush_hair_test_split1.txt,...
python utils/hmdb51_json.py annotation_dir_path
假设数据目录的结构如下:
~/ data/ kinetics_videos/ jpg/ .../ (directories of class names) .../ (directories of video names) ... (jpg files) results/ save_100.pth kinetics.json
确认所有选项。
python main.lua -h
在4个CPU线程的Kinetics数据集(400个类)上训练ResNets-34(用于数据加载)。
批量大小为128.
每5个时期保存模型。所有GPU都用于培训。如果您想要部分GPU,请使用CUDA_VISIBLE_DEVICES=...
。
python main.py --root_path ~/data --video_path kinetics_videos/jpg --annotation_path kinetics.json --result_path results --dataset kinetics --model resnet --model_depth 34 --n_classes 400 --batch_size 128 --n_threads 4 --checkpoint 5
从纪元101开始继续训练。(〜/ data / results / save_100.pth已加载。)
python main.py --root_path ~/data --video_path kinetics_videos/jpg --annotation_path kinetics.json --result_path results --dataset kinetics --resume_path results/save_100.pth --model_depth 34 --n_classes 400 --batch_size 128 --n_threads 4 --checkpoint 5
在UCF-101上微调预训练模型的conv5_x和fc层(〜/ data / models / resnet-34-kinetics.pth)。
python main.py --root_path ~/data --video_path ucf101_videos/jpg --annotation_path ucf101_01.json --result_path results --dataset ucf101 --n_classes 400 --n_finetune_classes 101 --pretrain_path models/resnet-34-kinetics.pth --ft_begin_index 4 --model resnet --model_depth 34 --resnet_shortcut A --batch_size 128 --n_threads 4 --checkpoint 5
还没有评论,说两句吧!
热门资源
stanford_corenlp_...
UPDATE MARCH 2018: this code is obsolete, beyon...
tensorflow-sketch...
Discrlaimer: This is not an official Google pro...
Keras-ResNeXt
Keras ResNeXt Implementation of ResNeXt models...
seetafaceJNI
项目介绍 基于中科院seetaface2进行封装的JAVA...
qp_testing
qp_testing mkdir build cd build cmake .. make
智能在线
400-630-6780
聆听.建议反馈
E-mail: support@tusaishared.com