Giter Club home page Giter Club logo

basketball-detection's Introduction

Basketball detection

Authors: Michał Szachniewicz (szacho), Anna Klimiuk (Stardust87)

This project automates the process of extracting a basketball trajectory from a video. It saves results and creates a pretty visualization:

visualization of detected trajectory visualization of detected trajectory 2

The algorithm used for object detection is YOLO, forked from https://github.com/ultralytics/yolov5. It has been trained on a custom dataset of privately recorded videos. The whole process is automated and it can handle a directory of videos one by one.

Evaluation of the model

The test set was created from two sceneries. Scenery 0 was present in a training set, but different recordings were used. Scenery 1 was completely new to the model. Every video was split into 4 categories:

  • in_hands - the ball is in or near the hands of a player
  • in_air - the ball was thrown and is in the air until it hits something
  • near_basket - the ball is close to the basket or even going through one (it can be occluded by a rim etc.)
  • bouncing - the ball is bouncing on the ground

Furthermore, an additional category custom was added and it consisted of different images from the internet to assure that the model can generalize well. We evaluated the performance of the model on every scenery and category by intersection over union and distance error between (x_true, y_true) and (x_pred, y_pred) in pixel space.

Full results are available in the yolo_analysis notebook. In short: predictions are very accurate -- the average error in the distance for unseen scenery was equal to only 1.3px! That is comparable to human error.

Below are grouped per scenery and per category boxplots of IoU and distance error on the test set.

boxplot grouped by scenery boxplot grouped by category

basketball-detection's People

Contributors

stardust87 avatar szacho 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.