Track golf balls in swing videos with AI-powered object detection and motion analysis. Features real-time processing, adjustable sensitivity, and visual trail effects.
git clone https://github.com/jjmlovesgit/Golf_tracker.git
cd Golf_tracker
python setup.py
This will:
- Create a Python virtual environment
- Install all dependencies
- Configure your VisionAgent API key https://va.landing.ai/settings/api-key
- Generate easy-launch scripts
- 🎥 Video Processing: Analyze golf swing videos frame-by-frame
- 🏓 Motion Tracking: Follow only moving balls (ignores stationary objects)
- 🖍 Visual Trail: Fading tail effect shows ball trajectory
- ⚙ Adjustable Sensitivity: Fine-tune detection parameters
- 📊 Progress Tracking: Visual indicators for each processing stage
- 💾 Local Saving: Export processed videos with annotations
Double-click golf_tracker.bat
(Create shortcut on desktop for easy access)
./launch_app.sh
Your VisionAgent API key is stored in .env
:
VISION_AGENT_API_KEY=your_api_key_here
Get your API key: https://va.landing.ai/settings/api-key
- Python 3.8+
- VisionAgent API key
- FFmpeg (for video processing)
Golf_tracker/
├── Golf_tracker.py # Main application
├── setup.py # Installation script
├── golf_tracker.bat # Windows launcher
├── launch_app.sh # macOS/Linux launcher
├── Tiger.mp4 # Sample input video
├── requirements.txt # Dependencies
├── LICENSE # MIT License
├── licensee.md # License explanation (if separate)
└── README.md
- Upload a golf swing video (MP4 format recommended)
- Adjust parameters:
- Output FPS: 15 (balance quality/speed)
- Motion Sensitivity: 0.01 (lower = more sensitive)
- Click Process Video
- View/download the annotated result
- For best results, use videos with:
- Clear contrast between ball and background
- Stable camera position
- 720p resolution or higher
- Start with higher confidence thresholds (0.9+) and adjust down if needed
- Reduce FPS for faster processing on longer videos
- Verify your key at VisionAgent Dashboard
- Ensure
.env
contains the correct key
- Install FFmpeg:
conda install ffmpeg
orbrew install ffmpeg
- Convert videos to MP4 format before uploading
MIT License - Not affiliated with VisionAgent/Landing AI