An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        


Form Checker Logo



GitHub CICD Action Status




Status


Issues


License







GitHub code size in bytes






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-)

## ๐Ÿง About

A tool that creates a skeletal overlay for slow motion pose form critiques via cloud based python infrastructure.

## ๐Ÿ–ฅ๏ธ Screenshots

Example

https://user-images.githubusercontent.com/1587270/149015534-822a8618-9037-4f9f-91ea-ffff29665856.mp4

## ๐Ÿ’จ Quickstart

## ๐Ÿ’พ Installation
### From GitHub Repo Clone
#### Prerequsites

1. [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.

## โ›๏ธ Tech Stack

- [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

## โœ๏ธ Authors



## ๐ŸŽ‰ Acknowledgements

- [@FFMPEG](https://www.ffmpeg.org/) for providing amazing open source video solutions.