golf_tracking / README.md
rehctiw25's picture
Upload folder using huggingface_hub
013216e verified

A newer version of the Gradio SDK is available: 5.12.0

Upgrade
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

  1. Download the SAM model checkpoint:

  2. Install dependencies:

pip install -r requirements.txt

Usage

  1. Run the application:
python app.py
  1. 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