Metadata-Version: 2.1
Name: golftrainer
Version: 0.0.2
Summary: Analyze a golf swing looking at critical points.
Home-page: https://github.com/sanjeevs/golftrainer
Author: Sanjeev Singh
Author-email: snjvsingh123@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 3 - Alpha
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: pandas
Requires-Dist: numpy
Provides-Extra: dev
Requires-Dist: pytest >=3.7 ; extra == 'dev'
Requires-Dist: check-manifest ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'

# Introdction
This package provides a utility for analyzing a golf swing. The input data is represented as a json file
generated by [GolfTracker](https://pypi.org/project/golftracker/).

The scripts in this package simply analze the data and meausre the various metrics associated with the swing.

## Json File Format
An example json file is present in the *data* folder. It has the following entries.
| Class            | Attribute      | Type                 | Description                                                                                     |
|------------------|----------------|----------------------|------------------------------------|                                         |
| `GolfData`       | `video_spec`   | `VideoSpec`          | The video specifications.                                                                       |
|                  | `video_input`  | `VideoInput`         | Information about the video input.                                                              |
|                  | `num_frames`   | `int`                | The number of frames in the video analysis.                                                     |
|                  | `pose_result`  | `PoseResult`         | The result of the pose analysis.                                                                |
|                  | `club_head_result` | `ClubHeadResult` | Results of the club head analysis.                                                             |
|                  | `mp_result`    | `List[List[float]]`  | Multi-dimensional list representing additional analysis results.                                |


Each of the child dict definitons are below.

| Class            | Attribute      | Type                 | Description                                                                                  |
|------------------|----------------|----------------------|---------------------------------|
| `VideoSpec`      | `height`       | `int`                | The height of the video in pixels.                                                              |
|                  | `width`        | `int`                | The width of the video in pixels.                                                               |
|                  | `num_frames`   | `int`                | The number of frames in the video.                                                              |
|                  | `fps`          | `int`                | The frames per second rate of the video.                                                         |
|                  | `scale`        | `int`                | The scale factor used for the video.                                                            |
|                  | `rotate`       | `str`                | The rotation setting for the video, if any.                                                     |
| `VideoInput`     | `fname`        | `str`                | The file name of the video.                                                                     |
|                  | `size`         | `int`                | The size of the video file in bytes.                                                            |
| `PoseResult`     | `poses`        | `List[str]`          | A list of identified poses.                                                                     |
|                  | `handed`       | `str`                | Information on whether the subject is left or right-handed, or 'Unknown'.                       |
| `ClubHeadResult` | `norm_points`  | `List[List[float]]`  | Normalized points representing the position of the club head.                                   |
|                  | `algos`        | `List[str]`          | List of algorithms used for analyzing the club 
## Installation
Installs as a standard python package using PIP.

```
pip install golftrainer
```

