Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available:
5.12.0
metadata
title: golf_tracking
app_file: gradio_app.py
sdk: gradio
sdk_version: 5.10.0
Golf Ball Trajectory Tracker
This application uses Meta's Segment Anything Model (SAM) 2.1 and physics-based trajectory fitting to track and analyze golf ball trajectories from videos.
Setup
Download the SAM model checkpoint:
- Visit: https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth
- Save the file in the project directory
Install dependencies:
pip install -r requirements.txt
Usage
- Run the application:
python app.py
- Using the interface:
- Upload a golf swing video
- Click "Process Video" to load the video
- Click on the golf ball position in key frames (at least 3 points recommended)
- The application will fit and display the trajectory
- Use "Clear Points" to start over
Features
- Interactive point selection for trajectory tracking
- Physics-based trajectory fitting
- Real-time visualization of predicted path
- CPU-optimized for Intel UHD 630 graphics
Notes
- The application uses the SAM base model optimized for CPU usage
- For best results, provide clear video footage with visible golf ball
- Select points at different stages of the ball's flight for better trajectory fitting