The project has a FastAPI backend and a Vite React frontend. Use the root runner to start both in dev mode.
- Clone the repository and navigate into it:
git clone https://github.com/kr1shnasomani/Sportiq.git
cd Sportiq- Start both servers:
./run_all.shWhat this does:
- Creates/uses a local Python virtual environment under
backend/.venvand installs Python deps frombackend/requirements.txt. - Starts the FastAPI backend (auto-picks a free port like 8000/8001 and prints it, health at
/health). - Starts the Vite dev server for the frontend (auto-picks port like 8080/8081 and prints it, proxies
/apito the backend).
Open the printed frontend URL in your browser, upload a tennis video, and download the processed result.
Note:
- The TrackNet weight file lives at
backend/model/TrackNet.pth(already included here). - Temporary files are handled automatically; you do not need to modify paths in code.
Backend only:
cd backend
chmod +x run_backend.sh
PORT=8000 ./run_backend.shFrontend only:
cd frontend
chmod +x run_frontend.sh
VITE_BACKEND_URL="http://localhost:8000" VITE_DEV_PORT=8080 ./run_frontend.shThe backend exposes a single main endpoint to process a video upload.
- Health check:
GET /health - Process video:
POST /api/process(multipart/form-data, file field:video)
Example curl:
curl -X POST \
-F "video=@/absolute/path/to/input.mp4" \
http://localhost:8000/api/process \
-o output.mp4
