• Stars
    star
    166
  • Rank 220,163 (Top 5 %)
  • Language
    Python
  • Created about 5 years ago
  • Updated over 4 years ago

Reviews

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

Repository Details

Exploration of different solutions to action recognition in video, using neural networks implemented in PyTorch.

Action Recognition in Video

This repo will serve as a playground where I investigate different approaches to solving the problem of action recognition in video.

I will mainly use the UCF-101 dataset.

Setup

$ cd data/              
$ bash download_ucf101.sh     # Downloads the UCF-101 dataset (~7.2 GB)
$ unrar x UCF101.rar          # Unrars dataset
$ unzip ucfTrainTestlist.zip  # Unzip train / test split
$ python3 extract_frames.py   # Extracts frames from the video (~26.2 GB, go grab a coffee for this)

ConvLSTM

The only approach investigated so far. Enables action recognition in video by a bi-directional LSTM operating on frame embeddings extracted by a pre-trained ResNet-152 (ImageNet).

The model is composed of:

  • A convolutional feature extractor (ResNet-152) which provides a latent representation of video frames
  • A bi-directional LSTM classifier which based on the latent representation of the video predicts the activity depicted

I have made a trained model available here.

Train

$ python3 train.py  --dataset_path data/UCF-101-frames/ \
                    --split_path data/ucfTrainTestlist \
                    --num_epochs 200 \
                    --sequence_length 40 \
                    --img_dim 112 \
                    --latent_dim 512

Test on Video

$ python3 test_on_video.py  --video_path data/UCF-101/SoccerPenalty/v_SoccerPenalty_g01_c01.avi \
                            --checkpoint_model model_checkpoints/ConvLSTM_150.pth

Results

The model reaches a classification accuracy of 91.27% accuracy on a randomly sampled test set, composed of 20% of the total amount of video sequences from UCF-101. Will re-train this model on the offical train / test splits and post results as soon as I have time.

More Repositories

1

ML-From-Scratch

Machine Learning From Scratch. Bare bones NumPy implementations of machine learning models and algorithms with a focus on accessibility. Aims to cover everything from linear regression to deep learning.
Python
22,643
star
2

PyTorch-GAN

PyTorch implementations of Generative Adversarial Networks.
Python
15,079
star
3

Keras-GAN

Keras implementations of Generative Adversarial Networks.
Python
9,062
star
4

PyTorch-YOLOv3

Minimal PyTorch implementation of YOLOv3
Python
7,170
star
5

NapkinML

A tiny lib with pocket-sized implementations of machine learning models in NumPy, most of which will fit in a tweet.
Python
547
star
6

Fast-Neural-Style-Transfer

Fast Neural Style Transfer in Pytorch
Python
333
star
7

PyTorch-Deep-Dream

Minimal PyTorch implementation of Deep Dream
Python
142
star
8

eriklindernoren.se

Personal website
CSS
19
star
9

HomeAssistant

Alfred - Domestic butler - IoT Experiment
JavaScript
15
star
10

SemSegGUI

C++
11
star
11

GoogleTTS

Lightweight Python wrapper of the Google Text-To-Speech API
Shell
6
star
12

TBMI26-Neural-Networks

Repository for the lab series in TBMI26 Neural Networks and Learning Systems. Matlab implementations of the Perceptron, MLP, Adaboost, kNN and a Q-learning example
MATLAB
5
star
13

PFTA-Final-Assignment

Final assignment of the course 'Python for Text Analysis'
Jupyter Notebook
4
star
14

TDDC17-Artificial-Intelligence

Lab assignments, exam questions and answers. https://www.ida.liu.se/~TDDC17/info/labs.en.shtml
JavaScript
3
star
15

Sonus-JFugueUI

Application that enables composing of music using the Java library JFugue.
Java
2
star