Update app.py
Browse files
app.py
CHANGED
@@ -118,8 +118,8 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
118 |
# cv2.putText(image, str(int(angleKneeL)),(170, 200), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
119 |
|
120 |
# Relative points in terms of w and h
|
121 |
-
rel_point1 = (int(w * 0), int(h - h * 0.
|
122 |
-
rel_point2 = (int(w * 0.265625), int(h - h * 0.
|
123 |
|
124 |
cv2.putText(image, str(int(angleHipL)),(rel_point1), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
125 |
|
@@ -136,8 +136,8 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
136 |
|
137 |
# REP data
|
138 |
# Setup Status box
|
139 |
-
cv2.rectangle(image, (0,0), (275,
|
140 |
-
cv2.rectangle(image, (0, 3), (273,
|
141 |
|
142 |
cv2.putText(image, 'Left', (10, 22),
|
143 |
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
@@ -153,6 +153,10 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
153 |
cv2.putText(image, stage,
|
154 |
(170, 70), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
155 |
|
|
|
|
|
|
|
|
|
156 |
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))
|
157 |
|
158 |
result_queue.put(detections)
|
|
|
118 |
# cv2.putText(image, str(int(angleKneeL)),(170, 200), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
119 |
|
120 |
# Relative points in terms of w and h
|
121 |
+
rel_point1 = (int(w * 0), int(h - h * 0.55)) # (0, h - 0.2*h)
|
122 |
+
rel_point2 = (int(w * 0.265625), int(h - h * 0.55)) # 170 / 640 = 0.265625
|
123 |
|
124 |
cv2.putText(image, str(int(angleHipL)),(rel_point1), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
125 |
|
|
|
136 |
|
137 |
# REP data
|
138 |
# Setup Status box
|
139 |
+
cv2.rectangle(image, (0,0), (275, 225), (127, 248, 236), -1)
|
140 |
+
cv2.rectangle(image, (0, 3), (273, 222), (12, 85, 61), -1)
|
141 |
|
142 |
cv2.putText(image, 'Left', (10, 22),
|
143 |
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
|
|
153 |
cv2.putText(image, stage,
|
154 |
(170, 70), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
155 |
|
156 |
+
cv2.putText(image, 'HipL', (10, 140), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2, cv2.LINE_AA)
|
157 |
+
|
158 |
+
cv2.putText(image, 'KneeL', (180, 140),cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2, cv2.LINE_AA)
|
159 |
+
|
160 |
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))
|
161 |
|
162 |
result_queue.put(detections)
|