Giter Club home page Giter Club logo

spot-the-ball-neural-network's Introduction

Spot-the-Ball Neural Network

This Python project utilises neural networks to train a model that can predict the location of balls in sports photographs, specifically scenarios where the ball is not visible.

The goal? To effectively predict the balls position in images where it has been digitally removed.

Environment Setup

Follow these steps to create and activate a virtual environment:

  1. python -m venv venv
  2. source venv/bin/activate
  3. pip install -r requirements.txt

How To

Populate Training Images

Collect Images (collect_images.py): Use to fetch 'spot the ball' images from a specified source. Images are stored temporarily on the local disk in two directories:

  • images_raw/{id}.png
  • images_training/{id}--{x_coord}-{y_coord}.png for training images, where filenames include the correct ball coordinates.

Generate Trained Model

Generate a Trained Model (trainer.py): Execute to train your model using the collected images. The script outputs a model file that will be used for making predictions.

Predict Spot The Ball Positions

With a trained model, you can predict the ball's location in new images.

Training Predictor (training_predictor.py): This script processes images from the images_training directory, which contain known ball positions. It overlays both the actual and predicted ball locations on the images, marking them with crosses of different colors. It's particularly useful for evaluating the model's accuracy.

General Predictor (predictor.py): Use this script to predict the ball's location in images without known coordinates. Predictions are marked with a cross on the output images.

Improvements

This neural network serves as a starting point, there is ample room for further optimisation. Enhancing the models training process and predictions is key to improving the accuracy.

spot-the-ball-neural-network's People

Contributors

dant89 avatar

Watchers

 avatar Kostas Georgiou 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.