Projects

Swish AI

I trained an AI to watch every shot and keep score.

A Computer Vision app that watches basketball footage, tracks players, ball and hoop with a custom-trained YOLOv11 model, and overlays live shooting stats on the video.

DateOctober 2025
StatusOpen source
Tech stack
  • Python
  • YOLOv11
  • PyTorch
  • OpenCV
  • FastAPI
  • React
Live output: SwishAI tracking the hoop and counting makes in real time.

Where it started

I played basketball for years, and every shooting session ends the same way: you lose count. Was that 60 makes out of 90, or 70 out of 110? The question sounds trivial until you realise that tracking it properly, every session, honestly, is exactly the kind of tedious work a machine should do for you.

SwishAI is what happened when that itch met my curiosity about object detection. I wanted to point a camera at a court, do nothing else, and get back my field goal percentage. No wearables, no manual tagging, no app to tap between shots. Just the video and the truth.

What it does

Upload a basketball video and SwishAI detects five things at once: the ball, the ball inside the basket, the player, the hoop, and the act of shooting. From those detections it derives what actually matters, shots attempted, shots made, live field goal percentage, and renders it back onto the video with a pulse animation every time a basket drops.

It behaves like a product, not a script. Three processing modes (full tracking, stats and effects, stats only), per-class confidence sliders to adapt to bad lighting, and a Test Mode that processes only the first 15 seconds so you can validate the setup before committing to a full render.

Training on a 2016 GPU

The model is a YOLOv11s fine-tuned on roughly 10,000 annotated basketball images. The hardware was the humbling part: a GTX 1060 with 6 GB of VRAM, which meant 48 hours of continuous training, batch size 8, mixed precision, and a training script tuned around every one of those limits.

The augmentation is basketball-specific, extra HSV saturation so an orange ball survives bad gym lighting, shear to handle odd camera angles, mixup to keep players separable in crowded frames. And detection alone isn't scoring: a physics layer adds cooldowns (1.5 s per shot, 2 s per basket) so one jump shot never counts twice.

0.909mAP50 on 5 classes
10kannotated images
48hof training on a GTX 1060
200epochs
Per-class accuracy: the diagonal is how often each class is read correctly. Strong on hoop and player; the two rarest events, ball-in-basket and the shooting motion, are the hardest, and I show that honestly.

The post that travelled

I shared a clip of SwishAI counting my makes on LinkedIn, expecting the usual polite silence. Instead it took off: thousands of reactions, hundreds of comments, messages from coaches, developers and complete strangers asking how it worked. It remains my favourite proof that the best side projects are the ones that solve a problem you genuinely have.

That reaction changed how I looked at the project. A weekend experiment had clearly struck a nerve, so I stopped treating SwishAI as a demo and started designing it as a real product, one anyone could point at a court and simply use. That version is being built right now.

Something is coming. Soon online.

More projects