# Video Classification Using 3D ResNet
This is a pytorch code for video (action) classification using 3D ResNet trained by [this code](https://github.com/kenshohara/3D-ResNets-PyTorch).
The 3D ResNet is trained on the Kinetics dataset, which includes 400 action classes.
This code uses videos as inputs and outputs class names and predicted class scores for each 16 frames in the score mode.
In the feature mode, this code outputs features of 512 dims (after global average pooling) for each 16 frames.
**Torch (Lua) version of this code is available [here](https://github.com/kenshohara/video-classification-3d-cnn).**
## Requirements
* [PyTorch](http://pytorch.org/)
```
conda install pytorch torchvision cuda80 -c soumith
```
* FFmpeg, FFprobe
```
wget http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz
tar xvf ffmpeg-release-64bit-static.tar.xz
cd ./ffmpeg-3.3.3-64bit-static/; sudo cp ffmpeg ffprobe /usr/local/bin;
```
* Python 3
## Preparation
* Download this code.
* Download the [pretrained model](https://drive.google.com/drive/folders/1zvl89AgFAApbH0At-gMuZSeQB_LpNP-M?usp=sharing).
* ResNeXt-101 achieved the best performance in our experiments. (See [paper](https://arxiv.org/abs/1711.09577) in details.)
## Usage
Assume input video files are located in ```./videos```.
To calculate class scores for each 16 frames, use ```--mode score```.
```
python main.py --input ./input --video_root ./videos --output ./output.json --model ./resnet-34-kinetics.pth --mode score
```
To visualize the classification results, use ```generate_result_video/generate_result_video.py```.
To calculate video features for each 16 frames, use ```--mode feature```.
```
python main.py --input ./input --video_root ./videos --output ./output.json --model ./resnet-34-kinetics.pth --mode feature
```
## Citation
If you use this code, please cite the following:
```
@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},
}
```

YS_Lu
- 粉丝: 0
- 资源: 1
最新资源
- 影刀RPA中级证书-数据处理-列表计算价格
- WWDFASDFGDGDFGDG
- 清华大学 deepSeek 三部曲全集
- STM32成熟电压电流检测方案(直流) - PCB、KEIL源码、原理图、设计说明全解析,成熟STM32直流电压电流采集与检测方案详解:含PCB布局、KEIL源码及原理图设计说明,基于matlab的多
- 【css酷炫效果】纯CSS实现3D翻转卡片动画
- 基于springboot框架的高校专业实习管理系统的设计和开发(Java项目编程实战+完整源码+毕设文档+sql文件+学习练手好项目).zip
- 成熟STM32直流电压电流采集与检测方案:含PCB设计、KEIL源码及原理图、详细设计说明,成熟STM32直流电压电流采集与检测方案: PCB设计、KEIL源码、原理图及详细设计说明,PEM电解槽co
- 成熟STM32直流电压电流采集与检测方案:含PCB设计、KEIL源码及原理图、详细设计说明,成熟STM32直流电压电流采集与检测方案:含PCB设计、KEIL源码及原理图、详细设计说明,基于西门子PLC
- 成熟STM32直流电压电流采集与检测方案:含PCB设计、KEIL源码及原理图详解,成熟STM32直流电压电流采集与检测方案:含PCB设计、KEIL源码及原理图详解,迁移学习轴承诊断DAN:ResNet
- STM32直流电压电流采集与检测方案:从设计到实现,包括PCB布局与KEIL源码及原理图解析,STM32直流电压电流采集与检测方案:含PCB设计、KEIL源码及原理图详解,COMSOL非线性超声仿真:
- STM32直流电压电流采集与检测方案:含PCB设计、KEIL源码及原理图详解,成熟STM32直流电压电流采集与检测方案:包含PCB设计、KEIL源码及原理图与详细设计说明,文献复现基于非线性模型预测控
- 【css酷炫效果】纯CSS实现文字逐字显现打字效果
- STM32直流电压电流采集与检测方案:从设计到实现,包括PCB布局与KEIL源码及原理图解析,成熟STM32直流电压电流采集与检测方案: PCB设计、KEIL源码、原理图及详细设计说明,PMSM无差电
- 【css酷炫效果】纯CSS实现霓虹文字呼吸灯效果
- 影刀RPA中级证书-数据处理-列表筛选统计
- 基于springboot框架的的小型诊疗预约平台的设计与开发(Java项目编程实战+完整源码+毕设文档+sql文件+学习练手好项目).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



评论0