Gym is a place which is mostly used by everyone these days. It is important to have a good trainer in order to guide you so that you can avoid injuries. Gym machines are getting upgraded at a high pace like Flexnet, which provides us with a AI based virtual assistant. Virtual assistant is used by mostly everyone in daily life like while walking to count steps, or the use of SIRI or ALEXA which are also an example of virtual assistant. These assistants are required in gym to count our repetitions while we are exercising. So this project uses MediaPipe and its inbuilt libraries with the help of Computer Vision to get the best result. With the help of this project we are marking the various coordinates of our body and then calculating the angle of our left arm to measure our arm angle and then counting the repetitions of it.
Introduction
I. INTRODUCTION
In this project we have used MediaPipe library and its function which focuses on the different coordinates which our body has to calculate the angle and count the repetitions according to it. It increases the count when you are doing it with the proper form. Performing exercises with proper form also helps in prevention of injuries.
Most gyms have advanced machines and trainers to guide people about the correct form but it is also necessary to count the repetitions performed in the particular exercise. So, this project aims to count the repetitions performed while performing bicep curls.
II. LITERATURE OVERVIEW
There are various other research based on this like by Z Cao [1], which used OpenPose to detect the posture. V Gupta [2] which used deep learning model for it. Another famous research was done by F.Zhang [3], he used MediaPipe on a device for real-time hand tracking. A research was done by A.Tagliasacchi [4] was done using Robust articulated-icp for real time hand tracking. A Deep Pose project based on human pose estimation with the help of Deep Neural Networks was done by A.Toshev [5] in 2014. A COCO Key Point Detection Task [6] was also performed in 2020. A project of Pose Trainer was done, it’s main task was to correct exercise posture which was performed by S.Chen [7] using Stanford University. A project done by V.Bazarevsky [8] was done for neural face detection on mobile detection.. Composite fields for human pose detection was done by S Kreiss [9] in 2019 via IEEE Conference on Computer Vision. A study on common based objects was done by T Y Lin [10] in 2014 via Springer. A pose estimation using stacked glass networks was done by A Newell [11] in 2016 via Springer. At last a study on 3d pose estimation in single depth images using single view CNN to view multiple CNN was done by L.Ge [12] in 2016 via IEEE Conference on computer vision and pattern recognition. The above based researches has its own positive and negative sides. The researches described above were costly and it required a group of people to perform those researches. It required many other external resources also and the cost required to maintain them was also very high. Our research uses the webcam of the device which marks the various coordinates of the body required to calculate the angle and then gives us the total count according to it. It does not require any other material which can cost the user and also does not need any maintenance. It is eco-friendly and can be used by anyone
III. DATASET USED
First we require to align our body in front of our webcam. Using our webcam and with the help of MediaPipe library the various coordinates present in our body (i.e 33 coordinates) will be marked. We can consider various test cases here like:-
If our body is fully visible then catching the left hand coordinates can be difficult,
If we are showing right side then our project should not give any output as it not able to acquire the left coordinates
If are showing the left side then it should give accurate answers.
These three are the major type of datasets which will help our project to work better.
IV. IMPLEMENTATION
In this project we have used Media Pipe as a library and also used Open Computer Vision which helps us to access webcam easily. The MediaPipe pose estimation consists of 33 coordinates which are marked using our webcam and these points can be used calculate angles according to our use.
The image detected is in BGR format which has to be converted into RGB format to extract the required landmarks and then has to be reconverted back into BGR format to make it easy for the computer to calculate things easily.
V. BLOCK DIAGRAM AND COORDINATES
These are the 33 different coordinates which are used by MediaPipe library to mark the various coordinates in our body and help us achieve the result we want.
VI. APPROACH
We are basically marking the required coordinates and then calculating the angles which are required by us. We have tried using all the different angles to see whether our coordinates are getting marked or not. Then with the help of the formula(which is mentioned below) we were able to calculate the angle into radians and then converted the angle into degrees to obtain our desired results.
The angle initially is calculated into radians and is then converted into degrees.
Converted back into degrees:-
angle = np.abs(radians*180.0/np.pi)
After converting the angle into degrees it makes our calculation easier and we are easily able to calculate the angle we want to calculate.
VIII. TABLES AND BAR CHART
These are the comparisons done with other existing technologies using 17 coordinates and setting up the webcam at a particular distance like 2-3 meters to get the best result.
Conclusion
These days due to busy life schedules people are unable to find a way to stay fit and healthy. Being fit is not only good for health but it also avoids diseases. Applying artificial intelligence is a new way to ignite the urge in people to start doing exercise and stay fit. In this process we learnt how to use MediaPipe, Computer Vision and get the best out of it.
This project till now only consists of counts of our bicep curls and this can be upgraded as it has a lot of scope in it It tells us whether our arm is up or down and number of repetitions we have done which makes our work a lot more easy.
Future may hold many more exercises in it like squats and bench press. Also the movement of camera vertically or horizontally can also be added to capture another variety of exercises with different angles.
References
[2] Deep Learning-based Human Pose Estimation using OpenCV By V Gupta.
[3] MediaPipe Hands: On-device Real-time Hand Tracking. F.Zhang, V.Bazarevsky, A.Vakunov, A.Tkachenka, G.Sung, C.L. Chang, M.Grundmann.
[4] Robust articulated-icp for real-time hand tracking was done by A.Tagliasacchi, M.Schroder, A.Tkach, S.Bouaziz, M.Botsch, and M.Pauly in Computer Graphics Forum.
[5] DeepPose: Human Pose Estimation via Deep Neural Networks (August 2014) A.Toshev, C.Szegedy.
[6] COCO 2020 Keypoint Detection Task.
[7] Pose Trainer: Correcting Exercise Form using Pose Estimation performed by S.Chen, R.R. Yang Department of CS., Stanford University.
[8] BlazeFace: Sub-millisecond Neural Face Detection on Mobile GPUs V.Bazarevsky, Y.Kartynnik, A.Vakunov, K.Raveendran, M.Grundmann.
[9] Composite fields for human pose estimation by S Kreiss, L Bertoni, and A Alah in 2019.
[10] Common objects in context by T Y Lin, M Maire, S Belongie, J Hays, P Perona, D Ramanan, P Dollar, and C Lawrence ´ Zitnick in 2014.
[11] Stacked hourglass networks for human pose estimation by A Newell, K Yang, and J Deng in European conference in 2016.
[12] Robust 3d hand pose estimation in single depth images: from single-view CNN to multi-view CNNs by L.Ge, H.Liang, J.Yuan, and D.Thalmann in 2016.