From 62fa3c4a79542556edaf6ec83bd889ab24c11cb7 Mon Sep 17 00:00:00 2001 From: that-ar-guy Date: Sun, 19 Jan 2025 14:09:18 +0530 Subject: [PATCH 1/4] basic structure flow done --- .../computer-vision/counting-bicep-reps.md | 202 ++++++++++++++++++ docs/projects/computer-vision/index.md | 9 + 2 files changed, 211 insertions(+) create mode 100644 docs/projects/computer-vision/counting-bicep-reps.md diff --git a/docs/projects/computer-vision/counting-bicep-reps.md b/docs/projects/computer-vision/counting-bicep-reps.md new file mode 100644 index 00000000..a0e9c9dc --- /dev/null +++ b/docs/projects/computer-vision/counting-bicep-reps.md @@ -0,0 +1,202 @@ + + + + + +# Project Title + + +### AIM + + + +### DATASET LINK + +[link](link) + + +### NOTEBOOK LINK + +[link](link) + + +### LIBRARIES NEEDED + + + +??? quote "LIBRARIES USED" + + - pandas + - numpy + - scikit-learn + - matplotlib + - seaborn + - tensorflow + - keras + +--- + +### DESCRIPTION + + + + + +!!! info "What is the requirement of the project?" + + - Write the answer here in simple bullet points. + +??? info "Why is it necessary?" + + - Write the answer here in simple bullet points. + +??? info "How is it beneficial and used?" + + - Write the answer here in simple bullet points. + +??? info "How did you start approaching this project? (Initial thoughts and planning)" + + - Write the answer here in simple bullet points. + +??? info "Mention any additional resources used (blogs, books, chapters, articles, research papers, etc.)." + + - Write the answer here in simple bullet points. + + +--- + +### EXPLANATION + +#### DETAILS OF THE DIFFERENT FEATURES + + + + +--- + +#### PROJECT WORKFLOW + + +=== "Step 1" + + Initial data exploration and understanding: + + - Start Writing from here in bullet points. + +=== "Step 2" + + Data cleaning and preprocessing: + + - Start Writing from here in bullet points. + +=== "Step 3" + + Feature engineering and selection: + + - Start Writing from here in bullet points. + +=== "Step 4" + + Model training and evaluation: + + - Start Writing from here in bullet points. + +=== "Step 5" + + Model optimization and fine-tuning: + + - Start Writing from here in bullet points. + +=== "Step 6" + + Validation and testing: + + - Start Writing from here in bullet points. + +--- + +#### PROJECT TRADE-OFFS AND SOLUTIONS + + +=== "Trade Off 1" + - Describe the trade-off encountered (e.g., accuracy vs. computational efficiency). + - Explain how you addressed this trade-off (e.g., by optimizing hyperparameters, using a more efficient algorithm, etc.). + +=== "Trade Off 2" + - Describe another trade-off (e.g., model complexity vs. interpretability). + - Explain the solution (e.g., by selecting a model that balances both aspects effectively). + +--- + +### SCREENSHOTS + + +!!! success "Project workflow" + + ``` mermaid + graph LR + A[Start] --> B{Error?}; + B -->|Yes| C[Hmm...]; + C --> D[Debug]; + D --> B; + B ---->|No| E[Yay!]; + ``` + +??? tip "Visualizations and EDA of different features" + + === "Image Topic" + ![img](images/.png "a title") + +??? example "Model performance graphs" + + === "Image Topic" + ![img](images/.png "a title") + +--- + +### MODELS USED AND THEIR EVALUATION METRICS + + +| Model | Accuracy | MSE | R2 Score | +|------------|----------|-------|----------| +| Model Name | 95% | 0.022 | 0.90 | +| Model Name | 93% | 0.033 | 0.88 | + +--- + +### CONCLUSION + +#### KEY LEARNINGS + + +!!! tip "Insights gained from the data" + - Write from here in bullet points + +??? tip "Improvements in understanding machine learning concepts" + - Write from here in bullet points + +??? tip "Challenges faced and how they were overcome" + - Write from here in bullet points + +--- + +#### USE CASES + + +=== "Application 1" + + **Headline** + + - Explain your application + +=== "Application 2" + + **Headline** + + - Explain your application diff --git a/docs/projects/computer-vision/index.md b/docs/projects/computer-vision/index.md index 2780e68a..eba46bad 100644 --- a/docs/projects/computer-vision/index.md +++ b/docs/projects/computer-vision/index.md @@ -12,4 +12,13 @@ + + + OpenCV Logo +
+

Counting Bicep Reps

+

Real-time tracking and counting of bicep curls with Mediapipe's Pose module and OpenCV.

+

📅 2025-01-18 | ⏱️ 15 mins

+
+
From 14670f176fd66c9024b1f28f78486d127e76142a Mon Sep 17 00:00:00 2001 From: that-ar-guy Date: Sun, 19 Jan 2025 14:43:00 +0530 Subject: [PATCH 2/4] biceps done --- .../computer-vision/counting-bicep-reps.md | 166 ++++++------------ 1 file changed, 57 insertions(+), 109 deletions(-) diff --git a/docs/projects/computer-vision/counting-bicep-reps.md b/docs/projects/computer-vision/counting-bicep-reps.md index a0e9c9dc..be3c328b 100644 --- a/docs/projects/computer-vision/counting-bicep-reps.md +++ b/docs/projects/computer-vision/counting-bicep-reps.md @@ -1,72 +1,48 @@ - - - - +# Counting Bicep Reps Using OpenCV and Mediapipe -# Project Title - ### AIM - - +To track and count bicep curls in real time using computer vision techniques with OpenCV and Mediapipe's Pose module. ### DATASET LINK - -[link](link) +This project does not use a specific dataset as it works with real-time video from a webcam. ### NOTEBOOK LINK - -[link](link) +[https://drive.google.com/file/d/13Omm8Zy0lmtjmdHgfQbraBu3NJf3wknw/view?usp=sharing](https://drive.google.com/file/d/13Omm8Zy0lmtjmdHgfQbraBu3NJf3wknw/view?usp=sharing) ### LIBRARIES NEEDED - - ??? quote "LIBRARIES USED" - - pandas - - numpy - - scikit-learn - - matplotlib - - seaborn - - tensorflow - - keras + - OpenCV + - Mediapipe + - NumPy --- ### DESCRIPTION - - - - !!! info "What is the requirement of the project?" - - - Write the answer here in simple bullet points. + - The project aims to provide a computer vision-based solution for tracking fitness exercises like bicep curls without the need for wearable devices or sensors. ??? info "Why is it necessary?" - - - Write the answer here in simple bullet points. + - Helps fitness enthusiasts monitor their workouts in real time. + - Provides an affordable and accessible alternative to wearable fitness trackers. ??? info "How is it beneficial and used?" - - - Write the answer here in simple bullet points. + - Real-time feedback on workout form and repetition count. + - Can be extended to other fitness exercises and integrated into fitness apps ??? info "How did you start approaching this project? (Initial thoughts and planning)" - - - Write the answer here in simple bullet points. + - Explored Mediapipe's Pose module for pose landmark detection. + - Integrated OpenCV for video frame processing and real-time feedback. + - Planned the logic for detecting curls based on elbow angle thresholds. ??? info "Mention any additional resources used (blogs, books, chapters, articles, research papers, etc.)." - - - Write the answer here in simple bullet points. + - Mediapipe official documentation. + - OpenCV tutorials on video processing. --- @@ -74,129 +50,101 @@ etc. --> ### EXPLANATION #### DETAILS OF THE DIFFERENT FEATURES - - + - Pose Estimation: Utilized Mediapipe's Pose module to detect key landmarks on the human body. + - Angle Calculation: Calculated angles at the elbow joints to determine curl movement. + - Rep Tracking: Incremented rep count when alternating between full curl and relaxed positions. + - Real-Time Feedback: Displayed the remaining curl count on the video feed. --- #### PROJECT WORKFLOW - === "Step 1" + Initial setup: +- Installed OpenCV and Mediapipe. +- Set up a webcam feed for video capture. - Initial data exploration and understanding: - - - Start Writing from here in bullet points. === "Step 2" + Pose detection: +- Used Mediapipe's Pose module to identify body landmarks. - Data cleaning and preprocessing: - - - Start Writing from here in bullet points. === "Step 3" + Angle calculation: +- Implemented a function to calculate the angle between shoulder, elbow, and wrist. - Feature engineering and selection: - - - Start Writing from here in bullet points. === "Step 4" + Rep detection: +- Monitored elbow angles to track upward and downward movements. - Model training and evaluation: - - - Start Writing from here in bullet points. === "Step 5" + Real-time feedback: +- Displayed the remaining number of curls on the video feed using OpenCV. - Model optimization and fine-tuning: - - - Start Writing from here in bullet points. === "Step 6" + Completion: +- Stopped the program when the target reps were completed or on manual exit. - Validation and testing: - - - Start Writing from here in bullet points. --- #### PROJECT TRADE-OFFS AND SOLUTIONS - === "Trade Off 1" - - Describe the trade-off encountered (e.g., accuracy vs. computational efficiency). - - Explain how you addressed this trade-off (e.g., by optimizing hyperparameters, using a more efficient algorithm, etc.). + - Accuracy vs. Simplicity: + - Using elbow angles alone may not handle all body postures but ensures simplicity. + - Solution: Fine-tuned angle thresholds and added tracking for alternating arms. === "Trade Off 2" - - Describe another trade-off (e.g., model complexity vs. interpretability). - - Explain the solution (e.g., by selecting a model that balances both aspects effectively). + - Real-Time Performance vs. Model Complexity: + - Mediapipe's lightweight solution ensured smooth processing over heavier models. --- ### SCREENSHOTS - - !!! success "Project workflow" - ``` mermaid - graph LR - A[Start] --> B{Error?}; - B -->|Yes| C[Hmm...]; - C --> D[Debug]; - D --> B; - B ---->|No| E[Yay!]; - ``` - -??? tip "Visualizations and EDA of different features" - - === "Image Topic" - ![img](images/.png "a title") - -??? example "Model performance graphs" - - === "Image Topic" - ![img](images/.png "a title") - ---- - -### MODELS USED AND THEIR EVALUATION METRICS - - -| Model | Accuracy | MSE | R2 Score | -|------------|----------|-------|----------| -| Model Name | 95% | 0.022 | 0.90 | -| Model Name | 93% | 0.033 | 0.88 | + ```mermaid + graph LR + A[Webcam Feed] --> F[Enter No of Biceps Reps] + F --> B[Mediapipe Pose Detection] + B --> C[Elbow Angle Calculation] + C --> D[Rep Count Decrement] + D --> E[Real-Time Update on Frsame] + ``` --- ### CONCLUSION #### KEY LEARNINGS - !!! tip "Insights gained from the data" - - Write from here in bullet points + - Real-time video processing using OpenCV. + - Pose detection and landmark analysis with Mediapipe. ??? tip "Improvements in understanding machine learning concepts" - - Write from here in bullet points + - Understanding geometric computations in pose analysis. + - Effective use of pre-trained models like Mediapipe Pose. ??? tip "Challenges faced and how they were overcome" - - Write from here in bullet points + - Challenge: Handling incorrect postures. + - Solution: Fine-tuning angle thresholds. --- #### USE CASES - - === "Application 1" - **Headline** - - - Explain your application + **Personal Fitness Tracker** + - Helps users track their workouts without additional equipment. === "Application 2" - **Headline** - - - Explain your application + **Fitness App Integration** + - Can be integrated into fitness apps for real-time exercise tracking. From ef1b0c590481842128e7cc146eb42aa6c66e508f Mon Sep 17 00:00:00 2001 From: that-ar-guy Date: Sun, 19 Jan 2025 18:42:56 +0530 Subject: [PATCH 3/4] title corrected --- docs/projects/computer-vision/counting-bicep-reps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/projects/computer-vision/counting-bicep-reps.md b/docs/projects/computer-vision/counting-bicep-reps.md index be3c328b..357a26b7 100644 --- a/docs/projects/computer-vision/counting-bicep-reps.md +++ b/docs/projects/computer-vision/counting-bicep-reps.md @@ -1,4 +1,4 @@ -# Counting Bicep Reps Using OpenCV and Mediapipe +# Counting Bicep Reps ### AIM From d0f8daa610d688919fcc22704ab696c08fbe8df2 Mon Sep 17 00:00:00 2001 From: Mohammed Abdul Rahman <130785777+that-ar-guy@users.noreply.github.com> Date: Sun, 19 Jan 2025 18:56:56 +0530 Subject: [PATCH 4/4] added screenshots --- docs/projects/computer-vision/counting-bicep-reps.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/projects/computer-vision/counting-bicep-reps.md b/docs/projects/computer-vision/counting-bicep-reps.md index 357a26b7..7c8b2b34 100644 --- a/docs/projects/computer-vision/counting-bicep-reps.md +++ b/docs/projects/computer-vision/counting-bicep-reps.md @@ -107,6 +107,16 @@ This project does not use a specific dataset as it works with real-time video fr --- ### SCREENSHOTS + +1. Entering no of reps you want to perform + ![Screenshot 2025-01-19 184454](https://github.com/user-attachments/assets/afac56f4-c0ce-45ec-8f41-1b7effc02e5a) + + +3. Performing reps + ![Screenshot 2025-01-19 184607](https://github.com/user-attachments/assets/667b3e10-22b0-48a0-8e9b-42c3dcfc9f66) + + + !!! success "Project workflow" ```mermaid