• Stars
    star
    1,054
  • Rank 42,193 (Top 0.9 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PyTorch implemented C3D, R3D, R2Plus1D models for video activity recognition.

pytorch-video-recognition

Introduction

This repo contains several models for video action recognition, including C3D, R2Plus1D, R3D, inplemented using PyTorch (0.4.0). Currently, we train these models on UCF101 and HMDB51 datasets. More models and datasets will be available soon!

Note: An interesting online web game based on C3D model is in here.

Installation

The code was tested with Anaconda and Python 3.5. After installing the Anaconda environment:

  1. Clone the repo:

    git clone https://github.com/jfzhang95/pytorch-video-recognition.git
    cd pytorch-video-recognition
  2. Install dependencies:

    For PyTorch dependency, see pytorch.org for more details.

    For custom dependencies:

    conda install opencv
    pip install tqdm scikit-learn tensorboardX
  3. Download pretrained model from BaiduYun or GoogleDrive. Currently only support pretrained model for C3D.

  4. Configure your dataset and pretrained model path in mypath.py.

  5. You can choose different models and datasets in train.py.

    To train the model, please do:

    python train.py

Datasets:

I used two different datasets: UCF101 and HMDB.

Dataset directory tree is shown below

  • UCF101 Make sure to put the files as the following structure:
    UCF-101
    โ”œโ”€โ”€ ApplyEyeMakeup
    โ”‚ย ย  โ”œโ”€โ”€ v_ApplyEyeMakeup_g01_c01.avi
    โ”‚ย ย  โ””โ”€โ”€ ...
    โ”œโ”€โ”€ ApplyLipstick
    โ”‚ย ย  โ”œโ”€โ”€ v_ApplyLipstick_g01_c01.avi
    โ”‚ย ย  โ””โ”€โ”€ ...
    โ””โ”€โ”€ Archery
    โ”‚ย ย  โ”œโ”€โ”€ v_Archery_g01_c01.avi
    โ”‚ย ย  โ””โ”€โ”€ ...
    

After pre-processing, the output dir's structure is as follows:

ucf101
โ”œโ”€โ”€ ApplyEyeMakeup
โ”‚ย ย  โ”œโ”€โ”€ v_ApplyEyeMakeup_g01_c01
โ”‚   โ”‚   โ”œโ”€โ”€ 00001.jpg
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚ย ย  โ””โ”€โ”€ ...
โ”œโ”€โ”€ ApplyLipstick
โ”‚ย ย  โ”œโ”€โ”€ v_ApplyLipstick_g01_c01
โ”‚   โ”‚   โ”œโ”€โ”€ 00001.jpg
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚ย ย  โ””โ”€โ”€ ...
โ””โ”€โ”€ Archery
โ”‚ย ย  โ”œโ”€โ”€ v_Archery_g01_c01
โ”‚   โ”‚   โ”œโ”€โ”€ 00001.jpg
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚ย ย  โ””โ”€โ”€ ...

Note: HMDB dataset's directory tree is similar to UCF101 dataset's.

Experiments

These models were trained in machine with NVIDIA TITAN X 12gb GPU. Note that I splited train/val/test data for each dataset using sklearn. If you want to train models using official train/val/test data, you can look in dataset.py, and modify it to your needs.

Currently, I only train C3D model in UCF and HMDB datasets. The train/val/test accuracy and loss curves for each experiment are shown below:

  • UCF101

  • HMDB51

Experiments for other models will be updated soon ...

More Repositories

1

pytorch-deeplab-xception

DeepLab v3+ model in PyTorch. Support different backbones.
Python
2,747
star
2

PoseAug

[CVPR 2021] PoseAug: A Differentiable Pose Augmentation Framework for 3D Human Pose Estimation, (Oral, Best Paper Award Finalist)
Python
342
star
3

DeepGrabCut-PyTorch

Deep GrabCut in PyTorch
Python
265
star
4

AvatarGen

[Preprint] AvatarGen: A 3D Generative Model for Animatable Human Avatars
236
star
5

BMP

[CVPR 2021] Body Meshes as Points.
Python
87
star
6

news_spider

ๆ–ฐ้—ป็ˆฌ่™ซ (่…พ่ฎฏ,็ฝ‘ๆ˜“,ๆ–ฐๆตช,ไปŠๆ—ฅๅคดๆก,ๆœ็‹,ๅ‡คๅ‡ฐ็ฝ‘,่…พ่ฎฏๆปšๅŠจๆ–ฐ้—ป)
Python
53
star
7

LSTM-water-table-depth-prediction

Theano implementation of our paper 'Developing a Long Short-Term Memory (LSTM) based Model for Predicting Water Table Depth in Agricultural Areas', Journal of Hydrology.
Jupyter Notebook
38
star
8

project-demo

An Online Web Game "You Perform, I Guess!" based on C3D Model
CSS
36
star
9

Water-Table-Depth-Prediction-PyTorch

Implement paper using PyTorch
Python
14
star
10

Chinese_Poem_Writer

Chinese Poem Writer Based on TCN
Python
10
star
11

TV_Segmentation

Python implement of Total Variation Image Segmentation
Python
6
star
12

LSTM-diagnosis

Python
5
star
13

lightML

ML algorithm
Python
5
star
14

tencent_roll_news

่…พ่ฎฏๆปšๅŠจๆ–ฐ้—ป: http://news.qq.com/articleList/rolls/ ๆŠ“ๅ–
Python
4
star
15

assets

3
star
16

rnn-created-songs

Python
1
star
17

Kaggle

Jupyter Notebook
1
star
18

LightNet

LightNet: Light-weight Networks for Semantic Image Segmentation (Cityscapes and Mapillary Vistas Dataset)
Python
1
star