Update app.py
Browse filesRemoved the knee angle and Hip angle and check if the code is correctly working or not
app.py
CHANGED
@@ -119,37 +119,42 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
119 |
stage = 'down'
|
120 |
|
121 |
# Render Counter to our camera screen
|
122 |
-
#
|
123 |
-
|
124 |
-
|
125 |
|
126 |
# REP data
|
127 |
-
cv2.putText(image, 'Left', (int(w * 0.02), int(h * 0.05)),
|
128 |
-
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
129 |
|
130 |
-
cv2.putText(image,
|
131 |
-
|
|
|
|
|
|
|
132 |
|
133 |
# Stage data for left leg
|
134 |
-
cv2.putText(image, 'STAGE', (int(w * 0.25), int(h * 0.05)),
|
135 |
-
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
136 |
|
137 |
-
cv2.putText(image,
|
138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
-
#
|
141 |
-
|
142 |
-
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
143 |
|
144 |
-
|
145 |
-
cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
146 |
|
147 |
-
# Knee
|
148 |
-
|
149 |
-
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
150 |
|
151 |
-
|
152 |
-
|
153 |
mp_drawing.draw_landmarks(image, results.pose_landmarks, mp_pose.POSE_CONNECTIONS,mp_drawing.DrawingSpec(color=(255, 175, 0), thickness=2, circle_radius=2),mp_drawing.DrawingSpec(color=(0, 255, 200), thickness=2, circle_radius=2))
|
154 |
|
155 |
result_queue.put(detections)
|
|
|
119 |
stage = 'down'
|
120 |
|
121 |
# Render Counter to our camera screen
|
122 |
+
# Setup Status box
|
123 |
+
cv2.rectangle(image, (0,0), (720, 80),(127, 248, 236), -1)
|
124 |
+
cv2.rectangle(image, (0, 3), (715, 77), (12, 85, 61), -1)
|
125 |
|
126 |
# REP data
|
|
|
|
|
127 |
|
128 |
+
cv2.putText(image, 'Left', (10, 22),
|
129 |
+
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
130 |
+
|
131 |
+
cv2.putText(image, str(correct),
|
132 |
+
(10, 70), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
133 |
|
134 |
# Stage data for left leg
|
|
|
|
|
135 |
|
136 |
+
cv2.putText(image, 'STAGE', (180, 22),
|
137 |
+
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
138 |
+
|
139 |
+
cv2.putText(image, stage,
|
140 |
+
(170, 70), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
141 |
+
|
142 |
+
# # Hip angle
|
143 |
+
|
144 |
+
|
145 |
+
# cv2.putText(image, 'HipL', (350, 22),
|
146 |
+
# cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
147 |
|
148 |
+
# cv2.putText(image, str(int(angleHipL)),
|
149 |
+
# (340, 70), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
|
|
150 |
|
151 |
+
# # Knee angle
|
|
|
152 |
|
153 |
+
# cv2.putText(image, 'Knee', (545, 22),
|
154 |
+
# cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
|
|
155 |
|
156 |
+
# cv2.putText(image, str(int(angleKneeL)),
|
157 |
+
# (535, 70), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
158 |
mp_drawing.draw_landmarks(image, results.pose_landmarks, mp_pose.POSE_CONNECTIONS,mp_drawing.DrawingSpec(color=(255, 175, 0), thickness=2, circle_radius=2),mp_drawing.DrawingSpec(color=(0, 255, 200), thickness=2, circle_radius=2))
|
159 |
|
160 |
result_queue.put(detections)
|