All Projects → harvitronix → Five Video Classification Methods

harvitronix / Five Video Classification Methods

Licence: mit
Code that accompanies my blog post outlining five video classification methods in Keras and TensorFlow

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Five Video Classification Methods

Rnn Theano
使用Theano实现的一些RNN代码,包括最基本的RNN,LSTM,以及部分Attention模型,如论文MLSTM等
Stars: ✭ 31 (-97.02%)
Mutual labels:  classification
Yannl
Yet another neural network library
Stars: ✭ 37 (-96.45%)
Mutual labels:  classification
Machine Learning From Scratch
Succinct Machine Learning algorithm implementations from scratch in Python, solving real-world problems (Notebooks and Book). Examples of Logistic Regression, Linear Regression, Decision Trees, K-means clustering, Sentiment Analysis, Recommender Systems, Neural Networks and Reinforcement Learning.
Stars: ✭ 42 (-95.97%)
Mutual labels:  classification
The Deep Learning With Keras Workshop
An Interactive Approach to Understanding Deep Learning with Keras
Stars: ✭ 34 (-96.73%)
Mutual labels:  classification
Mlj.jl
A Julia machine learning framework
Stars: ✭ 982 (-5.67%)
Mutual labels:  classification
Timbl
TiMBL implements several memory-based learning algorithms.
Stars: ✭ 38 (-96.35%)
Mutual labels:  classification
Instapy Gender Classification
🔎 Classification helper for sex classification feature of InstaPy
Stars: ✭ 30 (-97.12%)
Mutual labels:  classification
Street View House Numbers Svhn Detection And Classification Using Cnn
A 2-CNN pipeline to do both detection (using bounding box regression) and classification of numbers on SVHN dataset.
Stars: ✭ 46 (-95.58%)
Mutual labels:  classification
Face Mask Detection
Face masks are crucial in minimizing the propagation of Covid-19, and are highly recommended or even obligatory in many situations. In this project, we develop a pipeline to detect unmasked faces in images. This can, for example, be used to alert people that do not wear a mask when entering a building.
Stars: ✭ 37 (-96.45%)
Mutual labels:  classification
Small norb
Python wrapper to small NORB dataset
Stars: ✭ 40 (-96.16%)
Mutual labels:  classification
Satellite imagery analysis
Implementation of different techniques to find insights from the satellite data using Python.
Stars: ✭ 31 (-97.02%)
Mutual labels:  classification
Ml Classification Algorithms Poverty
A comparative assessment of machine learning classification algorithms applied to poverty prediction
Stars: ✭ 36 (-96.54%)
Mutual labels:  classification
Urban Sound Classification
Urban sound source tagging from an aggregation of four second noisy audio clips via 1D and 2D CNN (Xception)
Stars: ✭ 39 (-96.25%)
Mutual labels:  classification
Prediciting Binary Options
Predicting forex binary options using time series data and machine learning
Stars: ✭ 33 (-96.83%)
Mutual labels:  classification
Predicting Myers Briggs Type Indicator With Recurrent Neural Networks
Stars: ✭ 43 (-95.87%)
Mutual labels:  classification
Namescoremldemo
🏷 iOS11 demo application for predicting gender from first names.
Stars: ✭ 31 (-97.02%)
Mutual labels:  classification
Ml Classify Text Js
Machine learning based text classification in JavaScript using n-grams and cosine similarity
Stars: ✭ 38 (-96.35%)
Mutual labels:  classification
Detext
DeText: A Deep Neural Text Understanding Framework for Ranking and Classification Tasks
Stars: ✭ 1,039 (-0.19%)
Mutual labels:  classification
Yolo tensorflow
🚖 Object Detection (YOLOv1) implentation in tensorflow, with training, testing and video features.
Stars: ✭ 45 (-95.68%)
Mutual labels:  classification
Chemometricstools.jl
A collection of tools for chemometrics and machine learning written in Julia.
Stars: ✭ 39 (-96.25%)
Mutual labels:  classification

Five video classification methods

The five video classification methods:

  1. Classify one frame at a time with a ConvNet
  2. Extract features from each frame with a ConvNet, passing the sequence to an RNN, in a separate network
  3. Use a time-dstirbuted ConvNet, passing the features to an RNN, much like #2 but all in one network (this is the lrcn network in the code).
  4. Extract features from each frame with a ConvNet and pass the sequence to an MLP
  5. Use a 3D convolutional network (has two versions of 3d conv to choose from)

See the accompanying blog post for full details: https://medium.com/@harvitronix/five-video-classification-methods-implemented-in-keras-and-tensorflow-99cad29cc0b5

Requirements

This code requires you have Keras 2 and TensorFlow 1 or greater installed. Please see the requirements.txt file. To ensure you're up to date, run:

pip install -r requirements.txt

You must also have ffmpeg installed in order to extract the video files. If ffmpeg isn't in your system path (ie. which ffmpeg doesn't return its path, or you're on an OS other than *nix), you'll need to update the path to ffmpeg in data/2_extract_files.py.

Getting the data

First, download the dataset from UCF into the data folder:

cd data && wget http://crcv.ucf.edu/data/UCF101/UCF101.rar

Then extract it with unrar e UCF101.rar.

Next, create folders (still in the data folder) with mkdir train && mkdir test && mkdir sequences && mkdir checkpoints.

Now you can run the scripts in the data folder to move the videos to the appropriate place, extract their frames and make the CSV file the rest of the code references. You need to run these in order. Example:

python 1_move_files.py

python 2_extract_files.py

Extracting features

Before you can run the lstm and mlp, you need to extract features from the images with the CNN. This is done by running extract_features.py. On my Dell with a GeFore 960m GPU, this takes about 8 hours. If you want to limit to just the first N classes, you can set that option in the file.

Training models

The CNN-only method (method #1 in the blog post) is run from train_cnn.py.

The rest of the models are run from train.py. There are configuration options you can set in that file to choose which model you want to run.

The models are all defined in models.py. Reference that file to see which models you are able to run in train.py.

Training logs are saved to CSV and also to TensorBoard files. To see progress while training, run tensorboard --logdir=data/logs from the project root folder.

Demo/Using models

I have not yet implemented a demo where you can pass a video file to a model and get a prediction. Pull requests are welcome if you'd like to help out!

TODO

  • [ ] Add data augmentation to fight overfitting
  • [x] Support multiple workers in the data generator for faster training
  • [ ] Add a demo script
  • [ ] Support other datasets
  • [ ] Implement optical flow
  • [ ] Implement more complex network architectures, like optical flow/CNN fusion

UCF101 Citation

Khurram Soomro, Amir Roshan Zamir and Mubarak Shah, UCF101: A Dataset of 101 Human Action Classes From Videos in The Wild., CRCV-TR-12-01, November, 2012.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].