# CNN LSTM
Implementation of CNN LSTM with Resnet backend for Video Classification
![alt text](https://raw.githubusercontent.com/HHTseng/video-classification/master/fig/CRNN.png)
# Getting Started
## Prerequisites
* PyTorch (ver. 0.4+ required)
* FFmpeg, FFprobe
* Python 3
### Try on your own dataset
```
mkdir data
mkdir data/video_data
```
Put your video dataset inside data/video_data
It should be in this form --
```
+ data
+ video_data
- bowling
- walking
+ running
- running0.avi
- running.avi
- runnning1.avi
```
Generate Images from the Video dataset
```
./utils/generate_data.sh
```
## Train
Once you have created the dataset, start training ->
```
python main.py --use_cuda --gpu 0 --batch_size 8 --n_epochs 100 --num_workers 0 --annotation_path ./data/annotation/ucf101_01.json --video_path ./data/image_data/ --dataset ucf101 --sample_size 150 --lr_rate 1e-4 --n_classes <num_classes>
```
## Note
* All the weights will be saved to the snapshots folder
* To resume Training from any checkpoint, Use
```
--resume_path <path-to-model>
```
## Tensorboard Visualisation(Training for 4 labels from UCF-101 Dataset)
![alt text](https://github.com/pranoyr/cnn-lstm/blob/master/images/Screenshot%202020-08-13%20at%205.54.36%20PM.png)
## Inference
```
python inference.py --annotation_path ./data/annotation/ucf101_01.json --dataset ucf101 --model cnnlstm --n_classes <num_classes> --resume_path <path-to-model.pth>
```
## References
* https://github.com/kenshohara/video-classification-3d-cnn-pytorch
* https://github.com/HHTseng/video-classification
## License
This project is licensed under the MIT License
没有合适的资源?快使用搜索试试~ 我知道了~
cnn-lstm:在Pytorch中实现的CNN LSTM架构用于视频分类
共30个文件
py:22个
txt:2个
sh:1个
需积分: 44 84 下载量 196 浏览量
2021-05-04
18:54:31
上传
评论 23
收藏 228KB ZIP 举报
温馨提示
CNN LSTM 带有Resnet后端的CNN LSTM用于视频分类的实现 入门 先决条件 PyTorch(需要0.4以上版本) FFmpeg,FFprobe 的Python 3 尝试自己的数据集 mkdir data mkdir data/video_data 将您的视频数据集放入data / video_data中。格式应为- + data + video_data - bowling - walking + running - running0.avi - running.avi - runnning1.avi 从视频数据集中生成图像 ./utils/generate
资源详情
资源评论
资源推荐
收起资源包目录
cnn-lstm-master.zip (30个子文件)
cnn-lstm-master
inference.py 3KB
sample.py 1004B
train.py 1KB
utils
generate_data.sh 239B
ucf101_json.py 2KB
n_frames_ucf101_hmdb51.py 990B
gen_anns_list.py 2KB
video_jpg_ucf101_hmdb51.py 1KB
mean.py 635B
models
cnnlstm_attention.py 2KB
__init__.py 0B
cnnlstm.py 960B
opts.py 4KB
tf_logs
tf_logs
events.out.tfevents.1597307480.future 20KB
images
Screenshot 2020-08-13 at 5.54.36 PM.png 220KB
utils.py 1KB
main.py 4KB
model.py 240B
requirements.txt 32B
dataset.py 3KB
temporal_transforms.py 3KB
target_transforms.py 446B
datasets
__init__.py 0B
ucf101.py 6KB
LICENSE 1KB
README.md 2KB
snapshots
weightfile.txt 52B
validation.py 977B
.gitignore 43B
spatial_transforms.py 11KB
共 30 条
- 1
花花鼓
- 粉丝: 28
- 资源: 4647
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0