๐ค Backend / AI Developer Quickstart
:::note Audit scope (2026-07-23)
This guide targets the excluded GPU backend. It was inventoried but not
reverified, so its last_verified date is intentionally unchanged.
:::
You're improving the AI video analysis pipeline (RunPod GPU backend).
:::tip TL;DR
- Repo:
acesense-gpu-backend(Python 3.11 โ strict) - Stack: YOLO v8 โข TrackNet โข MediaPipe โข CatBoost โข OpenCV โข PyTorch
- Runs on: RunPod RTX 4090 serverless (prod) โข local CPU/MPS/CUDA (dev) :::
๐ Get Running in 5 Minutesโ
# 1. Clone
git clone git@github.com:Acesense/acesense-gpu-backend.git
cd acesense-gpu-backend
# 2. Create Python 3.11 venv (REQUIRED โ not 3.12+)
python3.11 -m venv venv
source venv/bin/activate
# 3. Install deps
pip install -r requirements/requirements.txt
# 4. Run a local clip
python main.py --path_input_video input_videos/sample.mp4 --dev
:::warning Python 3.11.x only CatBoost + MediaPipe do not ship wheels for Python 3.12+. Using a newer version will silently fail or install broken builds. :::
๐๏ธ Dev Cache (96% Faster Iteration)โ
The --dev flag caches intermediate ML inference so you can iterate on downstream logic without re-running expensive models:
# First run โ ~90s for a 30s video (builds cache)
python main.py --path_input_video input_videos/sample.mp4 --dev
# Subsequent runs โ ~3s (cached)
python main.py --path_input_video input_videos/sample.mp4 --dev
# Clear cache when models change
rm -rf .dev/cache/
Cache lives in .dev/cache/<video_hash>/ with one pickle per stage (ball tracking, court, players, bounces, shots).
๐ Pipeline Structureโ
src/
โโโ core/ # GameProcessor โ the orchestrator
โโโ tracking/ # Ball tracking (TrackNet)
โโโ surface/ # Court detection (CourtDetectorNet)
โโโ players/ # Player detection (FasterRCNN + MediaPipe)
โโโ events/ # Bounce detection (CatBoost)
โโโ classification/ # Shot classification
โโโ analysis/ # Game stats + recommendations
โโโ export/ # PDF/JSON/video reports
โโโ io/ # Video I/O, Firebase upload
โโโ render/ # Overlay visualization
โโโ utils/ # Dev cache, helpers
๐งญ Common Workflowsโ
Run against Firebase (cloud mode)โ
python main.py \
--path_input_video video.mp4 \
--cloud \
--firebase_bucket acesense-prod.firebasestorage.app \
--firebase_credentials firebasecred/firebase-admin.json
Test on a real RunPod-style invocationโ
python runpod_handler.py # simulates the serverless handler locally
Ship a new model versionโ
- Drop the new weights into
games/tennis/models/ - Bump the version in
Dockerfile - Build + push:
docker build -t akshaysarode/acesense:vNN . && docker push akshaysarode/acesense:vNN - Update the RunPod endpoint image tag in the RunPod Console
See the Deployment Guide for the full flow.
๐งช Testsโ
pytest tests/ -v
๐ฏ Next Stepsโ
- ๐ GPU Backend Overview โ all models + pipeline detail
- ๐ง GPU Backend Setup Guide โ full install walkthrough
- ๐๏ธ Architecture โ how this fits with Functions + Firestore
- ๐ Troubleshooting โ CUDA OOM, MPS, FFmpeg, etc.
Was this page helpful?