Pratyush101 commited on
Commit
150480d
·
verified ·
1 Parent(s): 870200a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -20
app.py CHANGED
@@ -124,37 +124,32 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
124
  # cv2.rectangle(image, (0, 3), (w-5, 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', (w-370, 22),
146
- cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
147
-
148
- cv2.putText(image, str(int(angleHipL)),
149
- (w-380, 70), cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
150
 
151
  # Knee angle
 
 
152
 
153
- cv2.putText(image, 'Knee', (w-175, 22),
154
- cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
155
-
156
- cv2.putText(image, str(int(angleKneeL)),
157
- (w-185, 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)
 
124
  # cv2.rectangle(image, (0, 3), (w-5, 77), (12, 85, 61), -1)
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, str(correct), (int(w * 0.02), int(h * 0.15)),
131
+ cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
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, stage, (int(w * 0.24), int(h * 0.15)),
138
+ cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
 
 
 
139
 
140
  # Hip angle
141
+ cv2.putText(image, 'HipL', (int(w * 0.52), int(h * 0.05)),
142
+ cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
143
 
144
+ cv2.putText(image, str(int(angleHipL)), (int(w * 0.51), int(h * 0.15)),
145
+ cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
 
 
 
 
146
 
147
  # Knee angle
148
+ cv2.putText(image, 'Knee', (int(w * 0.76), int(h * 0.05)),
149
+ cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 255), 2, cv2.LINE_AA)
150
 
151
+ cv2.putText(image, str(int(angleKneeL)), (int(w * 0.75), int(h * 0.15)),
152
+ cv2.FONT_HERSHEY_SIMPLEX, 1.7, (255, 255, 255), 2, cv2.LINE_AA)
 
 
 
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)