golftracker


Namegolftracker JSON
Version 2.0 PyPI version JSON
download
home_pagehttps://github.com/sanjeevs/golftracker
SummaryUse open cv to detect critical elements in a golf swing.
upload_time2023-11-25 15:47:56
maintainer
docs_urlNone
authorSanjeev Singh
requires_python
license
keywords
VCS
bugtrack_url
requirements absl-py alabaster argon2-cffi argon2-cffi-bindings asttokens atomicwrites attrs Babel backcall beautifulsoup4 bleach certifi cffi charset-normalizer colorama commonmark cycler debugpy decorator defusedxml docutils executing fastjsonschema fonttools idna imagesize importlib-metadata iniconfig ipykernel ipython ipython-genutils ipywidgets jedi Jinja2 jsonschema jupyter jupyter-client jupyter-console jupyter-core jupyterlab-pygments jupyterlab-widgets keyring kiwisolver MarkupSafe matplotlib matplotlib-inline mediapipe mistune nbclient nbconvert nbformat nest-asyncio notebook numpy opencv-contrib-python packaging pandas pandocfilters parso pickleshare Pillow pkginfo pluggy prometheus-client prompt-toolkit protobuf psutil pure-eval py pycparser Pygments pyparsing pyrsistent pytest python-dateutil pytz pyzmq qtconsole QtPy readme-renderer requests requests-toolbelt rfc3986 rich scikit-learn scipy Send2Trash six snowballstemmer soupsieve Sphinx sphinx-argparse sphinxcontrib-applehelp sphinxcontrib-devhelp sphinxcontrib-htmlhelp sphinxcontrib-jsmath sphinxcontrib-qthelp sphinxcontrib-serializinghtml stack-data terminado threadpoolctl tinycss2 tomli tornado traitlets twine urllib3 wcwidth webencodings widgetsnbextension zipp
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Table of Contents
1. [Introduction](#INTRODUCTION) Purpose of the package.
2. [Installation](docs/source/installation.md) If you wish to use the package.
3. [Development](docs/source/development.md) If you wish to change the source code and enhance the package.

## Introduction
-------------------
The package provides various scripts to process a golf swing video and export the information to another package "GolfCoach" for analysis. The output feedback can then be used to improve the swing.

The package uses Google media pipe 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 "GolfCoach" for analysis. 

This is shown below ![Flowchart](docs/source/images/golftracker.png)


Some sample vides for down the line, right hand golfer is available on [GoogleDrive](https://drive.google.com/drive/folders/1TDUnGjP1wh1gZeN1EZdJOO4AeYuMLnkO?usp=sharing)

Each video example has 3 files.

* Video file

* Pickle database that is the result of running the scripts below.

* Json file for exporting to GolfCoach packge

The general sequence of steps for a video say "0001.mov"

### Create Swing Database
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
```

### Hand Label GolfPoses
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
```

### Hand Label Club Head Position
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 To Json
Export the information to a json file for analysis by the GolfCoach package.

```
dump_swing_db 00001.pkl
```

## Status
WIP: Detailed src documentation of this package is on [ReadTheDocs](https://golftracker.readthedocs.io/en/latest/)


## Status
The current steps are listed here [GolfSwingCapture](docs/source/golfswing_capture.md)
Initial thoughts on swing analysis are here [GolfSwingAnalysis](docs/source/golfswing_analysis.md)




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sanjeevs/golftracker",
    "name": "golftracker",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Sanjeev Singh",
    "author_email": "snjvsingh123@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "# Table of Contents\r\n1. [Introduction](#INTRODUCTION) Purpose of the package.\r\n2. [Installation](docs/source/installation.md) If you wish to use the package.\r\n3. [Development](docs/source/development.md) If you wish to change the source code and enhance the package.\r\n\r\n## Introduction\r\n-------------------\r\nThe package provides various scripts to process a golf swing video and export the information to another package \"GolfCoach\" for analysis. The output feedback can then be used to improve the swing.\r\n\r\nThe package uses Google media pipe 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 \"GolfCoach\" for analysis. \r\n\r\nThis is shown below ![Flowchart](docs/source/images/golftracker.png)\r\n\r\n\r\nSome sample vides for down the line, right hand golfer is available on [GoogleDrive](https://drive.google.com/drive/folders/1TDUnGjP1wh1gZeN1EZdJOO4AeYuMLnkO?usp=sharing)\r\n\r\nEach video example has 3 files.\r\n\r\n* Video file\r\n\r\n* Pickle database that is the result of running the scripts below.\r\n\r\n* Json file for exporting to GolfCoach packge\r\n\r\nThe general sequence of steps for a video say \"0001.mov\"\r\n\r\n### Create Swing Database\r\nThis 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.\r\n```\r\ncreate_swing_db 00001.mov\r\n```\r\n\r\n### Hand Label GolfPoses\r\nRun the script below to label the golf poses. The golf pose consist of \r\n* Start Pose: \r\n* Top Pose: Indicates that the backswing is now complete.\r\n* Finish Pose: Indicates that the swing is complete.\r\n\r\n```\r\nlabel_golf_poses 00001.pkl\r\n```\r\n\r\n### Hand Label Club Head Position\r\nLabel the club head in some of the frames. The script will then use a linear approx to fill the position in the remaining frames.\r\n\r\n```\r\nlabel_club_head 00001.pkl\r\n```\r\n\r\n### Export To Json\r\nExport the information to a json file for analysis by the GolfCoach package.\r\n\r\n```\r\ndump_swing_db 00001.pkl\r\n```\r\n\r\n## Status\r\nWIP: Detailed src documentation of this package is on [ReadTheDocs](https://golftracker.readthedocs.io/en/latest/)\r\n\r\n\r\n## Status\r\nThe current steps are listed here [GolfSwingCapture](docs/source/golfswing_capture.md)\r\nInitial thoughts on swing analysis are here [GolfSwingAnalysis](docs/source/golfswing_analysis.md)\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Use open cv to detect critical elements in a golf swing.",
    "version": "2.0",
    "project_urls": {
        "Homepage": "https://github.com/sanjeevs/golftracker"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67a5993788772739ed3b78c058b70920f2bd2696f7d16e915062e110df9eb88a",
                "md5": "057c5b1df8a92de41ed2debf3e590b53",
                "sha256": "7067db7fb6862eb09d62e9487fd862011ec740aa84c69ae3e2b2ed9fb15ad20a"
            },
            "downloads": -1,
            "filename": "golftracker-2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "057c5b1df8a92de41ed2debf3e590b53",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 25434,
            "upload_time": "2023-11-25T15:47:56",
            "upload_time_iso_8601": "2023-11-25T15:47:56.437330Z",
            "url": "https://files.pythonhosted.org/packages/67/a5/993788772739ed3b78c058b70920f2bd2696f7d16e915062e110df9eb88a/golftracker-2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-25 15:47:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sanjeevs",
    "github_project": "golftracker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "absl-py",
            "specs": [
                [
                    "==",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "alabaster",
            "specs": [
                [
                    "==",
                    "0.7.12"
                ]
            ]
        },
        {
            "name": "argon2-cffi",
            "specs": [
                [
                    "==",
                    "21.3.0"
                ]
            ]
        },
        {
            "name": "argon2-cffi-bindings",
            "specs": [
                [
                    "==",
                    "21.2.0"
                ]
            ]
        },
        {
            "name": "asttokens",
            "specs": [
                [
                    "==",
                    "2.0.5"
                ]
            ]
        },
        {
            "name": "atomicwrites",
            "specs": [
                [
                    "==",
                    "1.4.0"
                ]
            ]
        },
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "21.4.0"
                ]
            ]
        },
        {
            "name": "Babel",
            "specs": [
                [
                    "==",
                    "2.10.1"
                ]
            ]
        },
        {
            "name": "backcall",
            "specs": [
                [
                    "==",
                    "0.2.0"
                ]
            ]
        },
        {
            "name": "beautifulsoup4",
            "specs": [
                [
                    "==",
                    "4.11.1"
                ]
            ]
        },
        {
            "name": "bleach",
            "specs": [
                [
                    "==",
                    "5.0.0"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2022.5.18.1"
                ]
            ]
        },
        {
            "name": "cffi",
            "specs": [
                [
                    "==",
                    "1.15.1"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "2.0.12"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.4"
                ]
            ]
        },
        {
            "name": "commonmark",
            "specs": [
                [
                    "==",
                    "0.9.1"
                ]
            ]
        },
        {
            "name": "cycler",
            "specs": [
                [
                    "==",
                    "0.11.0"
                ]
            ]
        },
        {
            "name": "debugpy",
            "specs": [
                [
                    "==",
                    "1.6.2"
                ]
            ]
        },
        {
            "name": "decorator",
            "specs": [
                [
                    "==",
                    "5.1.1"
                ]
            ]
        },
        {
            "name": "defusedxml",
            "specs": [
                [
                    "==",
                    "0.7.1"
                ]
            ]
        },
        {
            "name": "docutils",
            "specs": [
                [
                    "==",
                    "0.17.1"
                ]
            ]
        },
        {
            "name": "executing",
            "specs": [
                [
                    "==",
                    "0.9.1"
                ]
            ]
        },
        {
            "name": "fastjsonschema",
            "specs": [
                [
                    "==",
                    "2.16.1"
                ]
            ]
        },
        {
            "name": "fonttools",
            "specs": [
                [
                    "==",
                    "4.33.3"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.3"
                ]
            ]
        },
        {
            "name": "imagesize",
            "specs": [
                [
                    "==",
                    "1.3.0"
                ]
            ]
        },
        {
            "name": "importlib-metadata",
            "specs": [
                [
                    "==",
                    "4.11.4"
                ]
            ]
        },
        {
            "name": "iniconfig",
            "specs": [
                [
                    "==",
                    "1.1.1"
                ]
            ]
        },
        {
            "name": "ipykernel",
            "specs": [
                [
                    "==",
                    "6.15.1"
                ]
            ]
        },
        {
            "name": "ipython",
            "specs": [
                [
                    "==",
                    "8.4.0"
                ]
            ]
        },
        {
            "name": "ipython-genutils",
            "specs": [
                [
                    "==",
                    "0.2.0"
                ]
            ]
        },
        {
            "name": "ipywidgets",
            "specs": [
                [
                    "==",
                    "7.7.1"
                ]
            ]
        },
        {
            "name": "jedi",
            "specs": [
                [
                    "==",
                    "0.18.1"
                ]
            ]
        },
        {
            "name": "Jinja2",
            "specs": [
                [
                    "==",
                    "3.1.2"
                ]
            ]
        },
        {
            "name": "jsonschema",
            "specs": [
                [
                    "==",
                    "4.8.0"
                ]
            ]
        },
        {
            "name": "jupyter",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "jupyter-client",
            "specs": [
                [
                    "==",
                    "7.3.4"
                ]
            ]
        },
        {
            "name": "jupyter-console",
            "specs": [
                [
                    "==",
                    "6.4.4"
                ]
            ]
        },
        {
            "name": "jupyter-core",
            "specs": [
                [
                    "==",
                    "4.11.1"
                ]
            ]
        },
        {
            "name": "jupyterlab-pygments",
            "specs": [
                [
                    "==",
                    "0.2.2"
                ]
            ]
        },
        {
            "name": "jupyterlab-widgets",
            "specs": [
                [
                    "==",
                    "1.1.1"
                ]
            ]
        },
        {
            "name": "keyring",
            "specs": [
                [
                    "==",
                    "23.5.1"
                ]
            ]
        },
        {
            "name": "kiwisolver",
            "specs": [
                [
                    "==",
                    "1.4.3"
                ]
            ]
        },
        {
            "name": "MarkupSafe",
            "specs": [
                [
                    "==",
                    "2.1.1"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": [
                [
                    "==",
                    "3.5.2"
                ]
            ]
        },
        {
            "name": "matplotlib-inline",
            "specs": [
                [
                    "==",
                    "0.1.3"
                ]
            ]
        },
        {
            "name": "mediapipe",
            "specs": [
                [
                    "==",
                    "0.8.10"
                ]
            ]
        },
        {
            "name": "mistune",
            "specs": [
                [
                    "==",
                    "0.8.4"
                ]
            ]
        },
        {
            "name": "nbclient",
            "specs": [
                [
                    "==",
                    "0.6.6"
                ]
            ]
        },
        {
            "name": "nbconvert",
            "specs": [
                [
                    "==",
                    "6.5.0"
                ]
            ]
        },
        {
            "name": "nbformat",
            "specs": [
                [
                    "==",
                    "5.4.0"
                ]
            ]
        },
        {
            "name": "nest-asyncio",
            "specs": [
                [
                    "==",
                    "1.5.5"
                ]
            ]
        },
        {
            "name": "notebook",
            "specs": [
                [
                    "==",
                    "6.4.12"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.22.4"
                ]
            ]
        },
        {
            "name": "opencv-contrib-python",
            "specs": [
                [
                    "==",
                    "4.6.0.66"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "21.3"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "1.5.2"
                ]
            ]
        },
        {
            "name": "pandocfilters",
            "specs": [
                [
                    "==",
                    "1.5.0"
                ]
            ]
        },
        {
            "name": "parso",
            "specs": [
                [
                    "==",
                    "0.8.3"
                ]
            ]
        },
        {
            "name": "pickleshare",
            "specs": [
                [
                    "==",
                    "0.7.5"
                ]
            ]
        },
        {
            "name": "Pillow",
            "specs": [
                [
                    "==",
                    "9.1.1"
                ]
            ]
        },
        {
            "name": "pkginfo",
            "specs": [
                [
                    "==",
                    "1.8.2"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "prometheus-client",
            "specs": [
                [
                    "==",
                    "0.14.1"
                ]
            ]
        },
        {
            "name": "prompt-toolkit",
            "specs": [
                [
                    "==",
                    "3.0.30"
                ]
            ]
        },
        {
            "name": "protobuf",
            "specs": [
                [
                    "==",
                    "3.20.0"
                ]
            ]
        },
        {
            "name": "psutil",
            "specs": [
                [
                    "==",
                    "5.9.1"
                ]
            ]
        },
        {
            "name": "pure-eval",
            "specs": [
                [
                    "==",
                    "0.2.2"
                ]
            ]
        },
        {
            "name": "py",
            "specs": [
                [
                    "==",
                    "1.11.0"
                ]
            ]
        },
        {
            "name": "pycparser",
            "specs": [
                [
                    "==",
                    "2.21"
                ]
            ]
        },
        {
            "name": "Pygments",
            "specs": [
                [
                    "==",
                    "2.12.0"
                ]
            ]
        },
        {
            "name": "pyparsing",
            "specs": [
                [
                    "==",
                    "3.0.9"
                ]
            ]
        },
        {
            "name": "pyrsistent",
            "specs": [
                [
                    "==",
                    "0.18.1"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "7.1.2"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.8.2"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2022.1"
                ]
            ]
        },
        {
            "name": "pyzmq",
            "specs": [
                [
                    "==",
                    "23.2.0"
                ]
            ]
        },
        {
            "name": "qtconsole",
            "specs": [
                [
                    "==",
                    "5.3.1"
                ]
            ]
        },
        {
            "name": "QtPy",
            "specs": [
                [
                    "==",
                    "2.1.0"
                ]
            ]
        },
        {
            "name": "readme-renderer",
            "specs": [
                [
                    "==",
                    "35.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.27.1"
                ]
            ]
        },
        {
            "name": "requests-toolbelt",
            "specs": [
                [
                    "==",
                    "0.9.1"
                ]
            ]
        },
        {
            "name": "rfc3986",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    "==",
                    "12.4.4"
                ]
            ]
        },
        {
            "name": "scikit-learn",
            "specs": [
                [
                    "==",
                    "1.1.3"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    "==",
                    "1.9.3"
                ]
            ]
        },
        {
            "name": "Send2Trash",
            "specs": [
                [
                    "==",
                    "1.8.0"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "snowballstemmer",
            "specs": [
                [
                    "==",
                    "2.2.0"
                ]
            ]
        },
        {
            "name": "soupsieve",
            "specs": [
                [
                    "==",
                    "2.3.2.post1"
                ]
            ]
        },
        {
            "name": "Sphinx",
            "specs": [
                [
                    "==",
                    "4.5.0"
                ]
            ]
        },
        {
            "name": "sphinx-argparse",
            "specs": [
                [
                    "==",
                    "0.3.1"
                ]
            ]
        },
        {
            "name": "sphinxcontrib-applehelp",
            "specs": [
                [
                    "==",
                    "1.0.2"
                ]
            ]
        },
        {
            "name": "sphinxcontrib-devhelp",
            "specs": [
                [
                    "==",
                    "1.0.2"
                ]
            ]
        },
        {
            "name": "sphinxcontrib-htmlhelp",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "sphinxcontrib-jsmath",
            "specs": [
                [
                    "==",
                    "1.0.1"
                ]
            ]
        },
        {
            "name": "sphinxcontrib-qthelp",
            "specs": [
                [
                    "==",
                    "1.0.3"
                ]
            ]
        },
        {
            "name": "sphinxcontrib-serializinghtml",
            "specs": [
                [
                    "==",
                    "1.1.5"
                ]
            ]
        },
        {
            "name": "stack-data",
            "specs": [
                [
                    "==",
                    "0.3.0"
                ]
            ]
        },
        {
            "name": "terminado",
            "specs": [
                [
                    "==",
                    "0.15.0"
                ]
            ]
        },
        {
            "name": "threadpoolctl",
            "specs": [
                [
                    "==",
                    "3.1.0"
                ]
            ]
        },
        {
            "name": "tinycss2",
            "specs": [
                [
                    "==",
                    "1.1.1"
                ]
            ]
        },
        {
            "name": "tomli",
            "specs": [
                [
                    "==",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "tornado",
            "specs": [
                [
                    "==",
                    "6.2"
                ]
            ]
        },
        {
            "name": "traitlets",
            "specs": [
                [
                    "==",
                    "5.3.0"
                ]
            ]
        },
        {
            "name": "twine",
            "specs": [
                [
                    "==",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "1.26.9"
                ]
            ]
        },
        {
            "name": "wcwidth",
            "specs": [
                [
                    "==",
                    "0.2.5"
                ]
            ]
        },
        {
            "name": "webencodings",
            "specs": [
                [
                    "==",
                    "0.5.1"
                ]
            ]
        },
        {
            "name": "widgetsnbextension",
            "specs": [
                [
                    "==",
                    "3.6.1"
                ]
            ]
        },
        {
            "name": "zipp",
            "specs": [
                [
                    "==",
                    "3.8.0"
                ]
            ]
        }
    ],
    "lcname": "golftracker"
}
        
Elapsed time: 0.17930s