--- 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 1. Download the SAM model checkpoint: - Visit: https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth - Save the file in the project directory 2. Install dependencies: ```bash pip install -r requirements.txt ``` ## Usage 1. Run the application: ```bash python app.py ``` 2. 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