Update app.py
Browse filesAdjusted the down stage and this is the final built it can be further optimized
app.py
CHANGED
@@ -121,8 +121,8 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
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.rectangle(image, (0,110), (
|
125 |
-
cv2.rectangle(image, (0, 113), (
|
126 |
|
127 |
cv2.putText(image, str(int(angleHipL)),(rel_point1), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
128 |
|
@@ -142,8 +142,8 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
142 |
|
143 |
# REP data
|
144 |
# Setup Status box
|
145 |
-
cv2.rectangle(image, (0,0), (
|
146 |
-
cv2.rectangle(image, (0, 3), (
|
147 |
|
148 |
cv2.putText(image, 'Left', (10, 22),
|
149 |
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
@@ -157,7 +157,7 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
157 |
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
158 |
|
159 |
cv2.putText(image, stage,
|
160 |
-
(
|
161 |
|
162 |
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))
|
163 |
|
|
|
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.rectangle(image, (0,110), (280, 225), (127, 248, 236), -1)
|
125 |
+
cv2.rectangle(image, (0, 113), (277, 222), (12, 85, 61), -1)
|
126 |
|
127 |
cv2.putText(image, str(int(angleHipL)),(rel_point1), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
128 |
|
|
|
142 |
|
143 |
# REP data
|
144 |
# Setup Status box
|
145 |
+
cv2.rectangle(image, (0,0), (280, 103), (127, 248, 236), -1)
|
146 |
+
cv2.rectangle(image, (0, 3), (277, 100), (12, 85, 61), -1)
|
147 |
|
148 |
cv2.putText(image, 'Left', (10, 22),
|
149 |
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
|
|
157 |
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
|
158 |
|
159 |
cv2.putText(image, stage,
|
160 |
+
(147, 70), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
|
161 |
|
162 |
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))
|
163 |
|