Update app.py
Browse files
app.py
CHANGED
@@ -112,12 +112,12 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
112 |
# # Hip angle
|
113 |
|
114 |
|
115 |
-
#Visualize of left leg hip joint
|
116 |
-
cv2.putText(image, str(angleHipL),tuple(np.multiply(angleHipL, [w, h]).astype(int)),cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 0), 2, cv2.LINE_AA)
|
117 |
-
|
118 |
# # Knee angle
|
119 |
#Visualize of left leg knee joint
|
120 |
-
cv2.putText(image, str(angleKneeL),
|
|
|
|
|
|
|
121 |
|
122 |
|
123 |
if angleKneeL > 110 and stage == 'down':
|
@@ -147,6 +147,9 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
147 |
cv2.putText(image, stage,
|
148 |
(170, 70), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
149 |
|
|
|
|
|
|
|
150 |
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))
|
151 |
|
152 |
result_queue.put(detections)
|
|
|
112 |
# # Hip angle
|
113 |
|
114 |
|
|
|
|
|
|
|
115 |
# # Knee angle
|
116 |
#Visualize of left leg knee joint
|
117 |
+
cv2.putText(image, str(int(angleKneeL)), (170, 200), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
118 |
+
|
119 |
+
# # Hip angle
|
120 |
+
cv2.putText(image, str(int(angleHipL)), (0, 200), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
121 |
|
122 |
|
123 |
if angleKneeL > 110 and stage == 'down':
|
|
|
147 |
cv2.putText(image, stage,
|
148 |
(170, 70), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
149 |
|
150 |
+
cv2.putText(image, 'HipL', (10, 150), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
151 |
+
cv2.putText(image, 'Knee', (180, 150),cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
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)
|