Pose Estimation for Real-World Applications
Pose estimation is a computer vision task that includes detecting, associating, and tracking semantic key points. It utilizes convolutional neural networks (CNNs) for regression prediction. Business use cases for pose estimation include ergonomics, sports analysis, robotics, entertainment, and more. This tutorial will demonstrate a couple of alwaysAI’s applications that utilize pose estimation to assist with posture correction.
alwaysAI CLI Instructions
- If you do not have the alwaysAI CLI installed on your computer, go to: https://alwaysai.co/docs/get_started/development_computer_setup.html
- Follow the setup instructions that correspond to your OS.
- To verify installation, run aai - v
- This should print a version string like 0.5.30
Posture Corrector App Instructions
The Posture Corrector app will give you text alerts when you are slouching in your seat at your computer. To install the app:
git clone https://github.com/alwaysai/posture-corrector.git aai configure aai app install aai app start
Angle your webcam similar to the picture below:
LiftPose - alerts to bend knees while lifting The Lift post will give you text alerts when you are not bending your knees enough, while lifting objects. To install the app:
git clone firstname.lastname@example.org:alwaysai/LiftPose.git aai configure aai app install
Create an empty directory called “vids”:
*Note that in line 34 of app.py, the webcam stream will be saved to vids/lifting.mp4. Change the filename to write multiple mp4’s.
aai app start
Face the webcam to the right side of your body while lifting. The app will display text when “bad posture”.
LiftPose – writing stream to .mp4 The app has been configured to write the webcam stream to mp4. This has been accomplished by adding the following to a general webcam streaming app:
pose_estimator.load( engine=edgeiq.Engine.DNN, accelerator=edgeiq.Accelerator.CPU)
write_context = edgeiq.VideoWriter(output_path="vids/lifting.mp4")
Then, include at end of line. Try:
with edgeiq.WebcamVideoStream(cam=0) as video_stream, edgeiq.Streamer() as streamer, write_context as video_writer:
Need to ensure permissions to write folder:
sudo chown -R $USER: /path/to/saved.mp4
If mp4 too fast, make half speed with ffmpeg:
ffmpeg -i /path/to/saved.mp4 -filter:v "setpts=2*PTS" /path/to/slower.mp4
There are many other real-world applications for pose estimation. To learn more, email us at: email@example.com
Sign up today and start your project
We can't wait to see what you'll build!