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:
- The UCF Sports Dataset, a stripped down version (with no image dumps) can be found here
- Dense Trajectory Features,
this code has been included in
dense_trajectory_release_v1.2
folder
Run setup.sh
to install all dependencies. It also builds a DenseTrack
executable
which gives out the features of all videos
- 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 inattempts
- 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
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
.
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%.
The repository has been made available at https://github.com/ChinmayJindal/sports-recognition