Giter Site home page Giter Site logo

sportsai's Introduction

SportsAI

Credit for the GCP imports and joint annotation extraction code goes to Dale Markowitz - https://towardsdatascience.com/can-ai-make-you-a-better-athlete-using-machine-learning-to-analyze-tennis-serves-and-penalty-kicks-f9dd225cea49

Given an input video of any sports motion (pitch, tennis serve, etc.), this program can analyze mutliple joints and find points of stress/jerk. In other words, we can deduce injury risk. A sample video is provided for analysis. This video is a ~6 second .mp4 file of a baseball pitch. All videos must only contain one person for the program to work. You can start with a baseball pitch like the following:

Pitch

The program is able to detect joints (pose estimation) through the GCP Cloud Vision APIs and then analyzes any sports/exercise video for related injuries.

You will need a GCP account and a custom bucket with an input video (.mp4 preferably) to run this notebook. The first results provided are that of basic joint annotations:

Initial Data

We can now graph the positions of joints in respect to time:

Joint Positions

Using the law of cosines, we can then extract the angles between certain joints:

Joint Angles

To deduce injury risk (jerk, also known as the third derivative of position), we can differentiate using a UnivariateSpline:

Joint Stress

The above graph quanitifes the jerk or joint stress over time. If pitches have high jerk (especially on multiple occasions), it can become a direct cause of injury! As you can see, at roughly 3 seconds, the shoulder had the highest jerk. If an injury or "tweak" occurs, it would most likely be at this time. To reduce injury risk during pitching, it is more important to smooth out this motion. In other words, prevent drastic minimas or maximas on this graph.

Credit for the GCP imports and initial code goes to Dale Markowitz - https://towardsdatascience.com/can-ai-make-you-a-better-athlete-using-machine-learning-to-analyze-tennis-serves-and-penalty-kicks-f9dd225cea49

sportsai's People

Contributors

siddrrsh avatar

Stargazers

Xiong avatar

Watchers

James Cloos avatar  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.