Inspiration
As three high schoolers passionate about fitness, the inspiration for this app certainly came from our own lives. We encountered difficulties maintaining proper form during exercises and often injured ourselves when attempting new routines. YouTube tutorials weren't detailed or precise enough, and we were hesitant to hire a personal trainer. As students well-versed in various programming languages, we decided to tackle this problem faced by us and many others around the world who are striving to improve their fitness.
What it does
Our fitness web application distinguishes itself from other similar applications due to its unique feature of ascertaining whether users are exercising with proper form or posture. Users can activate their camera while performing their exercises and orient it parallel to their body. The artificial intelligence (AI) integrated into our application provides real-time feedback on whether the user's form is correct or incorrect, allowing them to adjust their posture until it is optimal.
In addition, our application incorporates the common features of a fitness application, such as a progress tracker and planner. Users can upload images of themselves and input their weight. After a few weeks of consistent use, they can view their progress in the form of an informative graph.
We have made our web application open source, enabling users to access and modify the source code according to their requirements. This allows users to customize their own fitness plans and trackers using our foundational framework.
How we built it
The building of our web app was mainly split into two sections: First, was using computer vision and Opencv in order to create the AI that can track the movements of the user and mention whether they are doing the exercise correctly.
To be more specific, we used the media pipe library to serve the purpose of giving us landmarks(coordinates) of nodes on certain points of the human body. Then, by using simple trigonometry, we were able to calculate the angle subtended by each node in the body which helped us in detecting poses. We used the pose model in media pipe which uses convolution neural networks and k nearest neighbors to classify joint/node types and assign them landmark numbers.From there onwards, opencv helped us reach the desired output by helping us use live webcam feed which could be directly embedded on a local host created on flask (hyperlink on the website to led the user to the model). The final models allow the user to directly input their live webcam feed into the browser where the recommendation system we developed, gives feedback such as "improve form" and encouragement such as "good form". There is one model each for pushup, Plank and sit ups.
Second, was building the web app which includes all the features and web pages. The networking for this was done through Firebase. Majority of the UI elements were created through Bootstrap.
Finally, the AI model was integrated onto the web app through the use of Flask.
Challenges we ran into
Integrating the machine learning (ML) code we developed in Python into the web application we created using Bootstrap proved to be a significant challenge. Since we could not directly run a Python file on a web application, we encountered numerous difficulties in achieving this goal. Initially, we attempted to use Gradio, a library that enables the embedding of an ML program into a web application. However, Gradio only supported images, and our output was a real-time video. Subsequently, we tried to use WebSocket libraries, but this, too, failed.
Ultimately, after extensive discussion and careful consideration, we opted to use Flask, which allowed us to create a Python-based web application without requiring a separate server. Since our web application's code was already written in JavaScript and Bootstrap, we linked the page in our web application to a Flask webpage containing our primary feature: the AI that detects users' form and determines whether it is correct or not. Furthermore, we faced uncertainty about the optimal threshold angle for push-ups. However, through a rigorous trial and discussion process, we finally arrived at the perfect threshold, which strikes a balance between being neither too strict nor too lenient.
Accomplishments that we're proud of
We take immense pride in successfully completing the project within the specified time, without having to compromise on any of the essential elements. As previously mentioned, one of our primary challenges was embedding the Python file into the web application. However, we persevered through a long and rigorous process to overcome this hurdle, and this accomplishment is a significant milestone for us.
Moreover, creating a fully functional and operational AI model within a short span of time is no small feat. We devoted ourselves to the task with passion and dedication, utilizing our collective expertise and knowledge to devise a novel solution to the problem at hand. Our AI model not only works seamlessly but also performs exceptionally well, which is a testament to the quality of our work.
In addition, we are also proud of our team's collaboration and communication skills, which were integral to the success of the project. Our team members were adept at working together, leveraging each other's strengths, and ensuring that we were all on the same page throughout the development process.
Overall, completing the project and achieving these milestones have been a remarkable journey for our team, and we are proud to have succeeded in our endeavors.
What we learned
Through this enriching hackathon experience, we acquired a multitude of new skills - both technical and non-technical. Firstly, we learned how to seamlessly integrate an AI program created in Python into a web app designed using Bootstrap and JavaScript. Secondly, we familiarized ourselves with a plethora of new libraries, including (insert library names here).
In addition to technical skills, we also refined our non-technical abilities. We recognized that with limited time, we had to decide between adding more features to our project or refining and improving our current features. Through open communication and effective planning, we prioritized our needs and made the most of our time, improving our skill sets in time management and communication.
What's next for Fitguru
In the future, we have plans to incorporate more innovative concepts into this project. Our primary goal is to enhance the AI's functionality by not only detecting incorrect form but also suggesting corrections to improve the user's posture. We also intend to expand the AI model to cover a more extensive range of commonly practiced exercises.
Furthermore, we aspire to introduce more advanced features of a fitness app, such as a calorie tracker that extracts data about the nutritional value of each meal. Additionally, we aim to establish a networking system that allows users to connect with like-minded peers, create discussion forums, and exchange fitness-related information.

Log in or sign up for Devpost to join the conversation.