Skip to content

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

License

Notifications You must be signed in to change notification settings

AndresMWeber/form-checker

Repository files navigation

Form Checker Logo


Automatically generate a skeletal overlay for slow motion pose form critiques over videos.

· Installation ·

📝 Table of Contents

🧐 About

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

🖥️ Screenshots

Example

form.mp4

💨 Quickstart

💾 Installation

From GitHub Repo Clone

Prerequsites

  1. Python and Python Poetry
  2. Docker To containerize the form checking function.
  3. Serverless For infrastructure deployment
  4. ffmpeg For local invocation
  5. AWS For infrastructure hosting

Install

  1. poetry install (To install in the top level directory always: poetry config virtualenvs.in-project true)
  2. 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 - Add the following repo secrets (to allow cloud deployment):
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
CODECOV_TOKEN
  1. create .env - Optional configuration as needed. Example .env file

  2. add github secrets - If deploying using the GitHub Action workflow CI/CD you must specify these secrets (ignore codecov token if you did not set up code coverage.):

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
foo@bar:~$ poetry shell
  1. Run the script on the local file:
foo@bar:~$ form_check /path/to/your/file.mp4
  1. You can also run the following to open a file browser using Tkinter:
foo@bar:~$ form_check_ui
  1. 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
foo@bar:~$ sls invoke local --function notify --data '{"Records":[{"s3":{"bucket": {"name":"form-checker-videos"}, "object":{"key": "processed/video.mp4"}}}]}'
  1. Deploys the serverless cloud infrastructure from your local .env settings.
foo@bar:~$ sls deploy -v
Via GitHub
  1. Create the domain for the AWS Api Gateway
foo@bar:~$ sls create_domain
  1. Add the necessary GitHub repo secrets:
CODECOV_TOKEN=<Optional: Your (CodeCov)[https://codecov.io/] generated API Key>
SENDGRID_API_KEY=<Optional: Your SendGrid (email notification feature) generated API key>
FC_EMAIL_DESTINATION=<Optional: the email address you want to be notified to>
AWS_ACCESS_KEY_ID=<Your AWS generated key id>
AWS_SECRET_ACCESS_KEY=<Your AWS generated access key>
AWS_DEFAULT_REGION=<Your AWS region>
  1. Push to GitHub
Invocation
  1. Now you will be able to upload a file using ${DOMAIN}/presigned
foo@bar:~$ curl -L -X POST 'subdomain.domain.com/presigned' \
-H 'Content-Type: application/json' \
--data-raw '{
    "filename": "test"
}'
  1. 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

✍️ Authors

🎉 Acknowledgements

  • @FFMPEG for providing amazing open source video solutions.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published