A real-time basketball shot analysis tool that uses computer vision to track shooting form and ball trajectory.
- Real-time pose estimation using MediaPipe
- Basketball tracking using YOLOv8
- Shot form analysis
- Ball trajectory prediction
- Real-time feedback on shooting mechanics
- Python 3.8+
- CUDA-capable GPU (recommended for better performance)
- Webcam or video file
- Clone the repository:
git clone https://github.com/yourusername/basketball-shot-analyzer.git
cd basketball-shot-analyzer- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txtpython src/main.pypython src/main.py --source path/to/video.mp4- Press 'q' to quit the application
- Tracks body keypoints using MediaPipe
- Analyzes shooting form angles
- Detects shot phases (set point, loading, release, follow-through)
- Real-time basketball detection using YOLOv8
- Ball trajectory tracking
- Trajectory prediction
- Elbow angle
- Knee angle
- Shot phase
- Form score
- FPS counter
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.