Skip to content
Logan1904Public

About

No description, website, or topics provided.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚽ JuggleNet

AI-powered football juggling detector

JuggleNet is a Computer Vision project that tracks a football and your lower body landmarks to detect and count juggles.


🚀 Features

  • ✅ Ball Detection with Fine-Tuned YOLOv8
  • 🦿 Body Pose Estimation with MediaPipe (hips, knees, feet)
  • 🧮 Smoothed Estimation via Kalman Filter
  • 📈 Live Graphing of ball Y-position
  • 🧠 Juggle Detection Logic using physics-inspired heuristic
  • 🔁 Works on webcam or video input
  • 🎨 Visual overlay showing keypoints, bounding boxes, and live counts

🗂️ Project Structure

.
├── utils/
│   ├── draw_POI.py         # Draw POI landmarks
│   ├── plot_graph.py       # Plot ball Y-position
│   ├── update_predict.py   # Update measurements, perform predictions
│   ├── juggle_counter.py   # Count juggles
│   ├── Kalman1D.py         # 1D Kalman Filter
│   └── vision_estimate.pt  # Extract POIs via vision pipeline
├── models/
│   └── best.pt             # Fine-tunes YOLOv8 model
├── source_data/
│   └── Vid1.mp4            # Example input video
├── save/
│   └── Vid1_Analysed.mp4   # Analysed example video
├── main.py                 # Main driver script
└── README.md               # Project documentation

🧰 Getting Started

1. Clone the repo

git clone https://github.com/yourusername/jugglenet.git
cd jugglenet

2. Create the "JuggleNet" virtual environment

conda env create -f environment.yml

3. Run Script

python main.py  # Run live on webcam input

Optional Arguments

--video <your_video>          # To run on pre-recorded video
--save <your_save_directory>  # To save analysed video
-- plot                       # To plot ball Y-position

🏋️ Fine-Tuning YOLO for Football Detection

To accurately detect the football in various lighting and motion conditions, we fine-tuned a lightweight YOLO model on a custom dataset.

⚙️ Model Details

  • Base model: YOLOv8n (Ultralytics)
  • Task: Object detection (1 class: football)
  • Training size: 2541 labeled images
  • Hardware: GTX 1650, 4GB VRAM

🗂️ Dataset

🧹 Pre-Processing

  • Original classes: 3 (Football, Person, Foot)
  • Preprocessing: Filtered to retain only the football class, cleaned up annotations for football

🧪 Training Configuration

yolo task=detect \
     mode=train \
     model=yolov8n.pt \
     data=<finetune_data_directory> \
     epochs=50 \
     imgsz=640 \
     batch=8 \

⚖️ Comparison

Untuned YOLO (left) vs Finetuned YOLO (right): note how due to the inconsistency in football detection for the untuned model, the juggle detection struggles

🛠️ TODO

  • Comparison between untuned YOLO and finetuned YOLO

About

No description, website, or topics provided.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages