https://github.com/andresmweber/form-checker
A tool that creates a skeletal overlay for slow motion pose form critiques via cloud based python infrastructure.
https://github.com/andresmweber/form-checker
Last synced: about 1 month ago
JSON representation
A tool that creates a skeletal overlay for slow motion pose form critiques via cloud based python infrastructure.
- Host: GitHub
- URL: https://github.com/andresmweber/form-checker
- Owner: AndresMWeber
- License: gpl-3.0
- Created: 2022-01-11T19:33:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T01:56:13.000Z (about 2 years ago)
- Last Synced: 2025-02-10T07:16:12.089Z (3 months ago)
- Language: Python
- Size: 40.8 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
![]()
Automatically generate a skeletal overlay for slow motion pose form critiques over videos.
ยท
Installation
ยท
## ๐ Table of Contents
- [๐ Table of Contents](#-table-of-contents)
- [๐ง About ](#-about-)
- [๐ฅ๏ธ Screenshots ](#๏ธ-screenshots-)
- [๐จ Quickstart ](#-quickstart-)
- [๐พ Installation](#-installation)
- [From GitHub Repo Clone](#from-github-repo-clone)
- [Prerequsites](#prerequsites)
- [Install](#install)
- [Configure](#configure)
- [Local](#local)
- [Deploy](#deploy)
- [Via Local Invocation (must have .env file set up)](#via-local-invocation-must-have-env-file-set-up)
- [Via GitHub](#via-github)
- [Invocation](#invocation)
- [โ๏ธ Tech Stack ](#๏ธ-tech-stack-)
- [โ๏ธ Authors ](#๏ธ-authors-)
- [๐ Acknowledgements ](#-acknowledgements-)A tool that creates a skeletal overlay for slow motion pose form critiques via cloud based python infrastructure.
Example
https://user-images.githubusercontent.com/1587270/149015534-822a8618-9037-4f9f-91ea-ffff29665856.mp4
## ๐พ Installation
### From GitHub Repo Clone
#### Prerequsites1. [Python](https://www.python.org/) and [Python Poetry](https://python-poetry.org/)
2. [Docker](https://www.docker.com/) To containerize the form checking function.
3. [Serverless](https://www.serverless.com/) For infrastructure deployment
4. [ffmpeg](https://www.serverless.com/) For local invocation
5. [AWS](https://console.aws.amazon.com/) For infrastructure hosting#### Install
1. `poetry install` (To install in the top level directory always: `poetry config virtualenvs.in-project true`)
1. `npm install` - Installs Serverless framework#### Configure
1. `aws profile` - Create an AWS profile or change `serverless.yml.provider.profile` to your own profile name (or delete the line for `[default]`)
2. `sls login` - Log in to serverless
3. [`add github secrets`](https://docs.github.com/en/actions/security-guides/encrypted-secrets) - Add the following repo secrets (to allow cloud deployment):
```shell
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
CODECOV_TOKEN
```
1. `create .env` - Optional configuration as needed. [Example .env file](.env.example)2. `add github secrets` - If deploying using the GitHub Action workflow CI/CD you must [specify these secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) (ignore codecov token if you did not set up code coverage.):
```shell
AWS_ACCESS_KEY_ID
AWS_DEFAULT_REGION
AWS_SECRET_ACCESS_KEY
CODECOV_TOKEN
FC_EMAIL_DESTINATION # (in case you want your email address obscured from SCM.)
```
#### Local
1. Start a poetry virtual environment shell
```console
foo@bar:~$ poetry shell
```2. Run the script on the local file:
```console
foo@bar:~$ form_check /path/to/your/file.mp4
```3. You can also run the following to open a file browser using Tkinter:
```console
foo@bar:~$ form_check_ui
```4. Finally you can find the outputted processed/compressed version in `~./tmp/*.mp4`
#### Deploy
Please note that deployment will be automatic if you set up the configuration properly and push to your own fork via GitHub Actions.
###### Via Local Invocation (must have .env file set up)
1. Example local invocation of email notification lambda
```console
foo@bar:~$ sls invoke local --function notify --data '{"Records":[{"s3":{"bucket": {"name":"form-checker-videos"}, "object":{"key": "processed/video.mp4"}}}]}'
```2. Deploys the serverless cloud infrastructure from your local .env settings.
```console
foo@bar:~$ sls deploy -v
```###### Via GitHub
1. Create the domain for the AWS Api Gateway
```console
foo@bar:~$ sls create_domain
```2. Add the necessary GitHub repo secrets:
```shell
CODECOV_TOKEN=
SENDGRID_API_KEY=
FC_EMAIL_DESTINATION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
```3. Push to GitHub
###### Invocation
1. Now you will be able to upload a file using `${DOMAIN}/presigned`
```console
foo@bar:~$ curl -L -X POST 'subdomain.domain.com/presigned' \
-H 'Content-Type: application/json' \
--data-raw '{
"filename": "test"
}'
```
2. Now you may upload a file using the response url and the upload lambda will trigger which will create a new video file in the s3 bucket.- [Python](https://www.python.org/) - Software Development
- [Poetry](https://python-poetry.org/) - Package Management
- [OpenCV](https://opencv.org/) - Image Processing
- [MediaPipe](https://google.github.io/mediapipe/) - Machine Learning Model/Solution
- [Serverless](https://www.serverless.com/) - Web Framework
- [AWS](https://aws.amazon.com/) - Cloud Infrastructure
- [pytest](https://docs.pytest.org/en/6.2.x/) - Testing Framework
- [CodeCov](https://about.codecov.io/) - Test Coverage Metrics- [@FFMPEG](https://www.ffmpeg.org/) for providing amazing open source video solutions.