34

GitHub - irhumshafkat/R2Plus1D-PyTorch: PyTorch implementation of the R2Plus1D c...

 5 years ago
source link: https://github.com/irhumshafkat/R2Plus1D-PyTorch
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

R2Plus1D-PyTorch

PyTorch implementation of the R2Plus1D convolution based ResNet architecture described in the paper "A Closer Look at Spatiotemporal Convolutions for Action Recognition"

Link to original: paper and code

Requirements

R2Plus1D-PyTorch has the following requirements

  • PyTorch 0.4 and dependencies
  • OpenCV (tested on 3.4.0.12)
  • tqdm (for progress bars)

About this repository

This repository consists of four python files:

  • module.py - Contains an implementation of the factored, R2Plus1D convolution the entire implementation is based around. It is designed to be a replacement for nn.Conv3D in the appropriate scenario
  • network.py - Uses module.py to build up the residual network described in the paper
  • dataset.py - Implements a PyTorch dataset, that can load videos with appropriate labels from a given directory.
  • trainer.py - A mildly modified version of the script from the PyTorch tutorials to train the model. Features saving and restoring capabilities.

Training on Kinetics-400/600

This repository does not include a crawler or downloader for the Kinetics-400/600 dataset, however, one can be found here. It is strongly recommended to downsample the videos prior to training (and not on the fly), using a tool such as ffmpeg. If using the crawler, this can be done by adding "-vf", "scale=172:128" to the ffmpeg command list in the download clip function.

Training in general

This repository is designed for the ResNet to be trained on any dataset of videos in general, using the VideoDataloader from dataloader.py . It expects the videos to be arranged in a directory -> [train/val] folders -> [class_label] folders (one for each class) -> videos (the files themselves).

Forks and fixes of this repo are highly welcome!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK