In January of 2023 I worked with the Queen’s Engineering Society Software Development Team to learn more about computer vision. We set a goal to learn more about Mediapipe, an open-source framework from Google which can be used to estimate the key points of someone’s body. As someone who enjoys living an active lifestyle, I chose to apply Mediapipe to bicep curls, making an application which can count reps and track the joint angle of the user’s elbow.
The application works through the user’s webcam, where they stand in front of the camera at a distance sufficient for Mediapipe to estimate the location of their joints. Mediapipe creates a 3D reconstruction of where the user’s joints are at each frame of the video feed. Through this construction, it’s easy to use basic trigonometry to determine the angle between the hand and shoulder at each frame. If the angle is below 30 degrees, the curl repetition is considered to be in the “down” stage. If the angle is greater than 160 degrees, it’s considered to be in the “up” stage. For a single repetition to be complete, it must begin in the “down” stage and eventually reach the “up” stage. The number of completed repetitions, as well as the stage of the current rep, is displayed in the top left corner of the video feed.
This project was my first time experimenting with computer vision. To learn how to use Mediapipe, I had to consult the documentation from Google, which is something I had rarely done in my previous programming endeavors. It was also my first time using a Jupyter Notebook, which is a useful tool to execute Python code section by section. I made use of the Jupyter Notebook markup cells to comment my code thoroughly, also explaining sections of the documentation with images. I will definitely be using Jupyter Notebooks in future machine learning projects, and understanding the documentation of a new library is an extremely valuable skill. This project served as an introduction to both of these concepts, and I have felt more comfortable learning new skills ever since.