GithubHelp home page GithubHelp logo

thejasonfisher / basketball-analytics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ed-zh/basketball-analytics

0.0 2.0 0.0 51.42 MB

Investigated quantitatively the optimal body mechanics for shooting basketball by employing pose estimation and sports theory.

License: MIT License

Python 9.54% Jupyter Notebook 90.46%

basketball-analytics's Introduction

Basketball-Analytics

Investigated quantitatively the optimal body mechanics for shooting basketball by employing pose estimation and sports theory.

Background

If there is one thing that I wish I had learned earlier in my ten years of experience in basketball, it is shot mechanics.

Too often, when training for better performance, beginners put too much emphasis on the drills: "I should complete 80 behind-the-back dribbles, 100 free throws, 50 three-pointers, etc." Focusing on the drills usually means very little attention paid to their body mechanics during the moves. How much should I bend my knees? Should I contract my glute first or quad first?

As a wise man once observed, "form before strength," which means one should priortize body mechanics over brute force in most skill-intensive sports. The attention to details and mind-muscle connection is often what sets professional players apart from street hoopers. But how can we learn from those superstars? What's the secret magic that helps them optimize their forms to achieve longer shooting range and higher explosiveness?

Though there are rule-of-thumbs about shooting forms, little quantitative work has been done regarding the underlying body mechanics. By employing pose estimation and sports theory, this project aims to unscramble to myth behind optimal shot mechanics in basketball.

Research Question

Different key muscle groups are activated at different time intervals when a player shoots.

What's the optimal timing and order for activating these muscle groups?

Model Methodology

  1. Use the mediapipe API to obtain the locations of each joint (e.g. ankle, knee, hip)
  2. Connect neighbouring joints to model limbs (e.g. connecting hip and knee gives the line representing thigh)
  3. Compute the angular acceleration at each joint using the limbs stemming from it (e.g. the rotational movement thigh and lower leg determines the angular acceleration at knee)
  4. Estimate the activation of a specific muscle group using angular acceleration at the corresponding joint (e.g. glute corresponds to hip). This follows from the angular part of Newton's Second Law (angular acceleration proportional to torque)

Addtional Functionality

  1. Produce a graph describing the player's shot mechanics as muslce activation vs. time
  2. Evaluate the efficiency of the shot as a score
  3. Give suggestions on how to improve the shot mechanics

Note: the speed and acceleration are in relative terms, scaled for comparision across players

Codes

The AnalyzerModule.py file wraps an Analyzer class, the instance of which can be used to analyze a video of a player shooting.

The pipeline.py file applies Analyzer to produce i) a slow-motion video tracking (at real time) the activation of each muscle groups and ii) a graph illustrating the graph.

The Scoring.py file implements a scoring system to evaluate the efficiency of the player's shot mechanics.

Demo

See the Demo folder for demo videos and graphs.

basketball-analytics's People

Contributors

ed-zh 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.