VerifierIntegerAssignment / Body-Movement-Comparison

Body-Movement-Comparison

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Body Movement Comparison with Mediapipe

This is an AI that gives real-time feedback to the user of how they're performing a body movement (like, workout, dance, etc) against a benchmark video.

You can give the benchmark video as a pre-saved file, and the user video as either a pre-saved file or with the webcam feed.

Its built using mediapipe in the backend, so we get a pretty high FPS (around 15 on MacBook Pro 16) when running on CPU only, as opposed to 2-3 FPS when the same application was built with tf-pose-estimation.

Usage

from move_comparison import compare_positions

benchmark_video = 'dance_videos/benchmark_dance.mp4'
user_video = 'dance_videos/right_dance.mp4' # replace with 0 for webcam

compare_positions(benchmark_video, user_video)

Screenshot 2021-05-20 at 3 24 54 PM

You can create your own moves with the create_moves.py file. It essentially opens the webcam, lets you do your move, and when you're done, you can press Q to save it with the supplied name: create_move('Move 1')

About

Body-Movement-Comparison


Languages

Language:Python 100.0%