Giter Club home page Giter Club logo

table-tennis-shot-classification-using-openpose's Introduction

Table-Tennis-Shot-Classification-Using-OpenPose

Pose Classification using OpenPose from OpenCV library.

Objective

To classify whether the shot played in the given video is backhand or forehand.

  • Clone this github repo to perform Table-Tennis shot classification on your own.
  • Ensure that you have met all the requirements mentioned at the end of this Readme file.
  • Open your terminal in the cloned folder and run python3 Pose_Estimation.py
  • You will get your required output!!!

User must provide inputs as follows:

video_path = # relative path or absolute path to your final data
video_side = # Among two, player of which side is your concern (say left/right).
hand_type = # which hand is dominant while taking shot (say lefty/righty).

You will get output as: Video of Backhand shot or Video of Forehand shot

Methodology

  1. Take 20 frames of video and crop it to just focus on player of one side.
  2. Using OpenPose pose estimation technique in OpenCV library, I estimated the keypoints of body (as shown below) using heatMap technique for each frame and collected them for all frames which serves as the data of one sample (here it is video).
BODY_PARTS_C = { "Nose": 0, "Neck": 1, "RShoulder": 2, "RElbow": 3, "RWrist": 4, "LShoulder": 5, "LElbow": 6, "LWrist": 7, "RHip": 8, "LHip": 11}
  1. I have created four functions (models) where each trains on extracted data from videos of particular criteria. Since we have video_side = left or right (2 options) and hand_type = lefty or righty (2 options), in total there are 4 possibilities and hence 4 models, each dealing with a particular scenario.
  2. Each model consists of 6 robust machine learning classifiers (XGBoost, LogisticRegression, MLPClassifier, ExtraTreesClassifier, RandomForestClassifier, and KNeighborsClassifer) which predict some values in between 0 and 1 (a probabilistic prediction) for a given video sample. Predictions of all 6 models are stacked and again feed into a meta-learner (which is either XGBClassifier or LogisticRegression) that learns how to predict output (basically a stacking ensemble).
  3. Now the output from this meta-learner is final output that says whether the shot is backhand or forehand.

Requirements

1. Open CV
2. Scikit-Learn
3. Numpy
4. Pandas
5. Matplotlib
6. Pickle

table-tennis-shot-classification-using-openpose's People

Contributors

rodosingh avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.