All Projects → neeilan → Deepplaybyplay

neeilan / Deepplaybyplay

Labelling NBA action using deep learning 🏀

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Deepplaybyplay

NBA-Machine-Learning-Sports-Betting
NBA sports betting using machine learning
Stars: ✭ 150 (+4.9%)
Mutual labels:  nba
Nba Go
🏀 💻 The finest NBA CLI.
Stars: ✭ 3,634 (+2441.26%)
Mutual labels:  nba
Xbmc.plugin.video.nba
Kodi plugin to watch NBA games with nba league pass
Stars: ✭ 42 (-70.63%)
Mutual labels:  nba
nba-analysis
Using machine learning libraries to analyze NBA data
Stars: ✭ 14 (-90.21%)
Mutual labels:  nba
Basketball reference web scraper
NBA Stats API via Basketball Reference
Stars: ✭ 279 (+95.1%)
Mutual labels:  nba
Sprintnba
🏀 NBA客户端
Stars: ✭ 629 (+339.86%)
Mutual labels:  nba
nbasixdegrees
An implementation of six degrees of separation for mutual NBA teammates.
Stars: ✭ 15 (-89.51%)
Mutual labels:  nba
Nbareact
🏀 iOS and Android NBA app created with React Native
Stars: ✭ 101 (-29.37%)
Mutual labels:  nba
Nba.js
A Node.js library for current and historical NBA stats, scores, and data.
Stars: ✭ 339 (+137.06%)
Mutual labels:  nba
Nba api
An API Client package to access the APIs for NBA.com
Stars: ✭ 881 (+516.08%)
Mutual labels:  nba
nba-smart-contracts
Smart contracts and transactions for Topshot, the official NBA digital collectibles game on the Flow Blockchain
Stars: ✭ 316 (+120.98%)
Mutual labels:  nba
mysportsfeeds-node
NodeJS wrapper for the MySportsFeeds Sports Data API
Stars: ✭ 62 (-56.64%)
Mutual labels:  nba
Nba
Node.js client for nba.com API endpoints
Stars: ✭ 637 (+345.45%)
Mutual labels:  nba
nba-stats-client
🏀 JavaScript Client for stats from NBA.com
Stars: ✭ 29 (-79.72%)
Mutual labels:  nba
All Nba
Android app for NBA fans. Features live scores, highlights and Reddit integration for discussions.
Stars: ✭ 65 (-54.55%)
Mutual labels:  nba
mysportsfeeds-r
R wrapper functions for the MySportsFeeds Sports Data API
Stars: ✭ 27 (-81.12%)
Mutual labels:  nba
Nba Player Movements
🏀 Visualization of NBA games from raw SportVU data logs
Stars: ✭ 481 (+236.36%)
Mutual labels:  nba
Nba Prediction
Predict scores of NBA games using regularized matrix completion
Stars: ✭ 128 (-10.49%)
Mutual labels:  nba
Basketball analytics
Repository which contains various scripts and work with various basketball statistics
Stars: ✭ 88 (-38.46%)
Mutual labels:  nba
Nbaplus
A concise APP about NBA News and Event with RxJava and EventBus
Stars: ✭ 701 (+390.21%)
Mutual labels:  nba

Deep Play-by-Play

This repo contains model and data collection / preprocessing code to label NBA broadcast footage with play-by-play descriptions, using 3D ConvNet-based video classification.

To learn how to scrape labelled videos off NBA.com for similar projects, see data_utils/README.

Classification performance

After training on about 3000 training examples (~6000 with augmentation), on a test set with 253 test examples (both sets somewhat evenly divided among 6 classes), the following accuracies were achieved:

# classes Classes Accuracy
6 (Inside/Midrange/Three) (Make/Miss) 66%
4 (Two/Three) (Make/Miss) 74%
2 (Make/Miss) 91%

Running the code

You should be able to clone this repo, set up paths appropriately in config.py, and run training or inference. All dependencies for this project ship with either the Python 3 standard library or the everyday machine/deep learning toolkit (TensorFlow, keras, scikit-learn). To read videos from disk, I use scikit-video io module, which you may need to install. Training data isn't hosted in this repo because it is quite large even after downsampling, and I don't have the express written consent of the NBA. However, the pre-trained weights file is available in the weights directory.

Examples:

The ultimate goal is continuous video classification, on running broadcast footage. However, I didn't have access to labelled data for non-field goal events (like rebounds, free throws, players running down the court, Javale doing dumb shit, etc). As a result, these examples use 90-frame (at 8 fps, so about 11 seconds long) videos of field-goal make/miss events - the only kind the model can currently identify.

Since all data used for training and testing was from the 2017-18 season, I picked out several plays from this video of the last 5 minutes of Spurs/Rockets Game 5 in the 2017 playoffs to see how accurately plays from a completely different season are classified:

Incorrect classification examples:

...because, like most things in life, this isn't perfect:

This Danny Green and-one is best classified as an INSIDE_MAKE, but MIDRANGE_MAKE is not a terribly bad guess:

The following play is an offensive foul followed by a MIDRANGE_MISS, but is classified as more likely to be an INSIDE_MAKE (51%) than a MIDRANGE_MISS (27%):

Sometimes, the classifier flat-out fails confidently 😞 :

Note that some of these plays are quite difficult to judge properly at this resolution and frame rate, without sound. Now imagine that these videos are also black and white, and that is the kind of data that this model has been trained on. Therefore, it's unsurprising that it isn't very good, but working with higher quality videos requires significantly more computational resources 💰.

FAQ

I'll fill this out if and when people ask questions.

Reddit discussion

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].