Pratyush101 commited on
Commit
3960910
·
verified ·
1 Parent(s): 4d85c5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -293,12 +293,12 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
293
  elif angleKneeL > 110:
294
  cv2.putText(image, "Lower Your Hips!", (300, 300), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 0, 255), 3)
295
 
296
- # # 1. Bend Forward Warning
297
- # if 10 < angleHipL < 18:
298
- # print(f"AngleHipL when Bend forward warning:{angleHipL}")
299
- # cv2.rectangle(image, (310, 180), (450, 220), (0, 0, 0), -1)
300
- # cv2.putText(image,f"Bend Forward",
301
- # (320,200),cv2.FONT_HERSHEY_SIMPLEX,1,(150,120,255),1,cv2.LINE_AA)
302
 
303
  # # 2. Lean Backward Warning
304
  # if angleHipL > 45:
@@ -352,25 +352,25 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
352
  # cv2.putText(image,f"Incorrect:{incorrect}",
353
  # (400,150),cv2.FONT_HERSHEY_SIMPLEX,1,(0,0,0),1,cv2.LINE_AA)
354
 
355
- # #Render Counter to our camera screen
356
- # #Setup Status box
357
- # cv2.rectangle(image,(0,0),(500,80),(245,117,16),-1)
358
 
359
- # #REP data
360
 
361
- # cv2.putText(image,'Left',(10,12),
362
- # cv2.FONT_HERSHEY_SIMPLEX,0.5,(0,0,0),1,cv2.LINE_AA)
363
 
364
- # cv2.putText(image,str(correct),
365
- # (10,60),cv2.FONT_HERSHEY_SIMPLEX,2,(255,255,255),2,cv2.LINE_AA)
366
 
367
- # #Stage data for left leg
368
 
369
- # cv2.putText(image,'STAGE',(230,12),
370
- # cv2.FONT_HERSHEY_SIMPLEX,0.5,(0,0,0),1,cv2.LINE_AA)
371
 
372
- # cv2.putText(image,stage,
373
- # (230,60),cv2.FONT_HERSHEY_SIMPLEX,1,(255,255,255),1,cv2.LINE_AA)
374
 
375
 
376
  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))
 
293
  elif angleKneeL > 110:
294
  cv2.putText(image, "Lower Your Hips!", (300, 300), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 0, 255), 3)
295
 
296
+ # # 1. Bend Forward Warning
297
+ # if 10 < angleHipL < 18:
298
+ # print(f"AngleHipL when Bend forward warning:{angleHipL}")
299
+ # cv2.rectangle(image, (310, 180), (450, 220), (0, 0, 0), -1)
300
+ # cv2.putText(image,f"Bend Forward",
301
+ # (320,200),cv2.FONT_HERSHEY_SIMPLEX,1,(150,120,255),1,cv2.LINE_AA)
302
 
303
  # # 2. Lean Backward Warning
304
  # if angleHipL > 45:
 
352
  # cv2.putText(image,f"Incorrect:{incorrect}",
353
  # (400,150),cv2.FONT_HERSHEY_SIMPLEX,1,(0,0,0),1,cv2.LINE_AA)
354
 
355
+ #Render Counter to our camera screen
356
+ #Setup Status box
357
+ cv2.rectangle(image,(0,0),(500,80),(245,117,16),-1)
358
 
359
+ #REP data
360
 
361
+ cv2.putText(image,'Left',(10,12),
362
+ cv2.FONT_HERSHEY_SIMPLEX,0.5,(0,0,0),1,cv2.LINE_AA)
363
 
364
+ cv2.putText(image,str(correct),
365
+ (10,60),cv2.FONT_HERSHEY_SIMPLEX,2,(255,255,255),2,cv2.LINE_AA)
366
 
367
+ #Stage data for left leg
368
 
369
+ cv2.putText(image,'STAGE',(230,12),
370
+ cv2.FONT_HERSHEY_SIMPLEX,0.5,(0,0,0),1,cv2.LINE_AA)
371
 
372
+ cv2.putText(image,stage,
373
+ (230,60),cv2.FONT_HERSHEY_SIMPLEX,1,(255,255,255),1,cv2.LINE_AA)
374
 
375
 
376
  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))