Skip to content
项目

wmcnally/golfdb has 325 GitHub stars and 95 forks. GitHot measured 0 stars in 24 hours, +1 in 7 days, and +3 in 15 days. Last checked 2026-11-20 06:36 UTC. Last push 2023-01-24.

这些数字如何统计

实测星标增长

24小时
0
7天
+1
15天
+3
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

关于

GolfDB is a video database for Golf Swing Sequencing, which involves detecting 8 golf swing events in trimmed golf swing videos. This repo demos the baseline model, SwingNet.

机器学习

README.md

原文

GolfDB: A Video Database for Golf Swing Sequencing

The code in this repository is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Introduction

GolfDB is a high-quality video dataset created for general recognition applications in the sport of golf, and specifically for the task of golf swing sequencing.

This repo contains a simple PyTorch implemention of the SwingNet baseline model presented in the paper. The model was trained on split 1 without any data augmentation and achieved an average PCE of 71.5% (PCE of 76.1% reported in the paper is credited to data augmentation including horizontal flipping and affine transformations).

If you use this repo please cite the GolfDB paper:

@InProceedings{McNally_2019_CVPR_Workshops,
author = {McNally, William and Vats, Kanav and Pinto, Tyler and Dulhanty, Chris and McPhee, John and Wong, Alexander},
title = {GolfDB: A Video Database for Golf Swing Sequencing},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
month = {June},
year = {2019}
}

Dependencies

Getting Started

Run generate_splits.py to convert the .mat dataset file to a dataframe and generate the 4 splits.

Train

  • I have provided the preprocessed video clips for a frame size of 160x160 (download here). Place 'videos_160' in the data directory. If you wish to use a different input configuration you must download the YouTube videos (URLs provided in dataset) and preprocess the videos yourself. I have provided preprocess_videos.py to help with that.

  • Download the MobileNetV2 pretrained weights from this repository and place 'mobilenet_v2.pth.tar' in the root directory.

  • Run train.py

Evaluate

  • Train your own model by following the steps above or download the pre-trained weights here. Create a 'models' directory if not already created and place 'swingnet_1800.pth.tar' in this directory.

  • Run eval.py. If using the pre-trained weights provided, the PCE should be 0.715.

Test your own video

  • Follow steps above to download pre-trained weights. Then in the terminal: python3 test_video.py -p test_video.mp4

  • Note: This code requires the sample video to be cropped and cut to bound a single golf swing. I used online video cropping and cutting tools for my golf swing video. See test_video.mp4 for reference.

Good luck!