Skip to content

hzhang57/AI-basketball-analysis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏀 Analyze basketball shots with machine learning!

This is an artificial intelligence application built on the concept of object detection. Analyze basketball shots by digging into the data collected from object detection. We can get the result by simply uploading files to the web App, or submitting a POST request to the API. Please check the features below.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Get a copy

Get a copy of this project by simply running the git clone command.

git clone https://github.com/chonyy/AI-basketball-analysis.git

Prerequisites

Before running the project, we have to install all the dependencies from requirements.txt

pip install -r requirements.txt

Hosting

Last, get the project hosted on your local machine with a single command.

python app.py

Alternatives

This project is also hosted on Heroku. However, the heavy computation of TensorFlow may cause Timeout error and crash the app (especially for video analysis). Therefore, hosting the project on your local machine is more preferable.

Features

This project has three main features, shot analysis, shot detection, detection API.

Shot analysis

Counting shooting attempts and missing, scoring shots from the input video. Detection keypoints in different colors have different meanings listed below:

  • Blue: Detected basketball in normal status
  • Purple: Undetermined shot
  • Green: Shot went in
  • Red: Miss

Shot detection

Detection will be shown on the image. The confidence and the coordinate of the detection will be listed below.

Detection API

Get the JSON response by submitting a POST request to (./detection_json) with "image" as KEY and input image as VALUE.

Detection model

The object detection model is trained with the Faster R-CNN model architecture, which includes pretrained weight on COCO dataset. Taking the configuration from the model architecture and train it on my own dataset.

Future plans

  1. Host it on azure web app service.
  2. Improve the efficiency, making it executable on web app services.

About

🏀🤖🏀 AI web app and API to analyze basketball shots.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 48.5%
  • HTML 34.2%
  • CSS 17.3%