Skip to content

HimaVarsha94/sports-recognition

 
 

Repository files navigation

Sports Recognition in Videos

This repository builds a classifier to predict the sport being played using Dense Trajectory Features. It works on the UCF Sports dataset and builds a multi-class classifier based on SVM using chi-squared kernel. The paper behind the project is:

Heng Wang, Alexander Kläser, Cordelia Schmid, Liu Cheng-Lin. Action Recognition by Dense Trajectories. CVPR 2011 - IEEE Conference on Computer Vision & Pattern Recognition, Jun 2011

Prerequisites

Project Setup

Run setup.sh to install all dependencies. It also builds a DenseTrack executable which gives out the features of all videos

Code Flow

  • The DenseTrack executable computes a large feature vector comprising of HOG + HOF + MBH descriptors concatenated with each other
  • The data is split into train and test with a ratio test_size
  • A codebook of size k using k-means clustering is generated in attempts
  • A bag-of-visual-words representation is created for each video using the histogram built using the above clustering
  • All the bag-of-visual-words are fed into the SVM using chi-squared kernel and classified using a One-Vs-Rest Classifier

Execution

To run the code, run Driver.py which generates the One-Vs-Rest Classifier and dumps in a model.p file and along with the codebook centers for bag-of-visual-words in centers.p.

Evaluation

The code has been evaluated on accuracy of predictions after the test and train split ratio of 0.3. Following classes have been used from the UCF Sports Dataset:

  • Diving-Side (7 videos)
  • Kicking-Front (10 videos)
  • Riding-Horse (12 videos)
  • Run-Side (13 videos)
  • SkateBoarding-Front (12 videos)
  • Swing-Bench (20 videos)
  • Swing-SideAngle (13 videos)
  • Walk-Front (22 videos)

After preliminary evaluation, we achieved a result of around 29%.

Contact

The repository has been made available at https://github.com/ChinmayJindal/sports-recognition

About

Sports Recognition via Dense Trajectory Features

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 71.7%
  • Python 19.2%
  • Makefile 8.0%
  • Other 1.1%