Skip to content

This project will generate a real-time map of a soccer match. The task is done by detecting and classifying players.

Notifications You must be signed in to change notification settings

itsAliSali/soccerField

Repository files navigation

soccerField

In this project, I detected the players and classified them using background subtraction methods and artificial neural networks. The primary libraries that I used are openCV and PyTorch.

summary

In part1.py, the only functionality is reading the video from local storage and detect players. In part2_classify.py, the classification is added on top of part1.py. Some scripts were developed to generate the dataset and train the neural net.

input

The input videos are from Soccer video and player position dataset. I used about 4 minutes of the first half to train my neural network. And a video from the second half was used to evaluate the model. Accuracy scores were about 97%. The codes are optimized to run on GPU.

output

Here is an image of top view of the field with a rendered map of players position:

dataset

I automatically generated the patches of players and labeled them by checking the color by openCV. Here is a figure containing 40 patches (from test dataset) and label/prediction as the title:

About

This project will generate a real-time map of a soccer match. The task is done by detecting and classifying players.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages