- Introduction Purpose of the package.
- Installation If you wish to use the package.
- Development If you wish to change the source code and enhance the package.
The package provides various scripts to process a golf swing video and export the information to another package GolfTrainer for analysis. The output feedback can then be used to improve the swing.
The package uses [Google Media Pipe Pose Landmark Detection] (https://mediapipe-studio.webapps.google.com/demo/pose_landmarker) for detecting the golfer. It then detects the club head in the video and the golf poses to detect the start and finish of the golf swing. This information in written out to a json file that can be analyzed by a separate packge "GolfTrainer" for analysis.
Some sample vides for down the line, right hand golfer is available on GoogleDrive
Each video example has 3 files.
-
Video file
-
Pickle database that is the result of running the scripts below.
-
Json file for exporting to GolfTrainer Package
The general sequence of steps for a video say "0001.mov"
This step runs google media pipe and stores all the landmarks. It will also try to detect the golf poses and club head position. Current version usually fails on this and requires hand labellling.
create_swing_db 00001.mov
Run the script below to label the golf poses. The golf pose consist of
- Start Pose:
- Top Pose: Indicates that the backswing is now complete.
- Finish Pose: Indicates that the swing is complete.
label_golf_poses 00001.pkl
Label the club head in some of the frames. The script will then use a linear approx to fill the position in the remaining frames.
label_club_head 00001.pkl
Export the information to a json file for analysis by the GolfTrainer package.
dump_swing_db 00001.pkl
WIP: Detailed src documentation of this package is on ReadTheDocs
The current steps are listed here GolfSwingCapture Initial thoughts on swing analysis are here GolfSwingAnalysis