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.
- ✅ 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
.
├── 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
git clone https://github.com/yourusername/jugglenet.git
cd jugglenetconda env create -f environment.ymlpython main.py # Run live on webcam input--video <your_video> # To run on pre-recorded video
--save <your_save_directory> # To save analysed video
-- plot # To plot ball Y-positionTo 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
- Original Source: Juggling Computer Vision Project
- Final Fine-Tuning Source: Football Detection
🧹 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
- Comparison between untuned YOLO and finetuned YOLO



