GithubHelp home page GithubHelp logo

superdev0909 / soccer-video-analytics-main Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 88 KB

Demo on how to compute soccer ball possession automatically using AI.

Home Page: https://tryolabs.com/

License: MIT License

Python 100.00%
ball-possession camera-motion classification multi-object-tracking norfair object-detection soccer tracking video-analatics

soccer-video-analytics-main's Introduction

Soccer Video Analytics

This repository contains the companion code of the blog post Automatically measuring soccer ball possession with AI and video analytics by Tryolabs.

For further information on the implementation, please check out the post.

How to install

To install the necessary dependencies we use Poetry. After you have it installed, follow these instructions:

  1. Clone this repository:

    git clone [email protected]:tryolabs/soccer-video-analytics.git
  2. Install the dependencies:

    poetry install
  3. Optionally, download the ball.pt file from the GitHub release. Please note that this is just a toy model that overfits to a few videos, not a robust ball detection model.

How to run

First, make sure to initialize your environment using poetry shell.

To run one of the applications (possession computation and passes counter) you need to use flags in the console.

These flags are defined in the following table:

Argument Description Default value
application Set it to possession to run the possession counter or passes if you like to run the passes counter None, but mandatory
path-to-the-model Path to the soccer ball model weights (pt format) /models/ball.pt
path-to-the-video Path to the input video /videos/soccer_possession.mp4

The following command shows you how to run this project.

python run.py --<application> --model <path-to-the-model> --video <path-to-the-video>

Warning: You have to run this command on the root of the project folder.

Here is an example on how to run the command:

python run.py --possession --model models/ball.pt --video videos/soccer_possession.mp4

An mp4 video will be generated after the execution. The name is the same as the input video with the suffix _out added.

soccer-video-analytics-main's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.