Piarasingh85 commited on
Commit
cbd62d1
·
verified ·
1 Parent(s): 5a26cf2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -91,16 +91,15 @@ def classify_pose(landmarks, output_image, display=False):
91
  label = "Upward Salute Pose"
92
 
93
  # Check for Hands Under Feet Pose
94
- if landmarks[mp_pose.Pose.Landmark.LEFT_WRIST.value].y > landmarks[mp_pose.PoseLandmark.LEFT_KNEE.value].y and
95
- landmarks[mp_pose.PoseLandmark.RIGHT_WRIST.value].y > landmarks[mp_pose.PoseLandmark.RIGHT_KNEE.value].y and abs(landmarks[mp_pose.PoseLandmark.LEFT_WRIST.value].x - landmarks[mp_pose.PoseLandmark.LEFT_ANKLE.value].x) < 0.05 and abs(landmarks[mp_pose.PoseLandmark.RIGHT_WRIST.value].x - landmarks[mp_pose.PoseLandmark.RIGHT_ANKLE.value].x) < 0.05:
96
  label = "Hands Under Feet Pose"
97
 
98
  # Check for Plank Pose
99
- if left_shoulder_angle > 160 and left_shoulder_angle < 200 and \
100
- right_shoulder_angle > 160 and right_shoulder_angle < 200 and \
101
- left_knee_angle > 160 and left_knee_angle < 200 and \
102
- right_knee_angle > 160 and right_knee_angle < 200:
103
- label = "Plank Pose"
104
 
105
  # Write the label on the output image
106
  cv2.putText(output_image, label, (10, 30), cv2.FONT_HERSHEY_PLAIN, 2, (0, 255, 0), 2)
 
91
  label = "Upward Salute Pose"
92
 
93
  # Check for Hands Under Feet Pose
94
+ if landmarks[mp_pose.Pose.Landmark.LEFT_WRIST.value].y > landmarks[mp_pose.PoseLandmark.LEFT_KNEE.value].y and landmarks[mp_pose.PoseLandmark.RIGHT_WRIST.value].y > landmarks[mp_pose.PoseLandmark.RIGHT_KNEE.value].y and abs(landmarks[mp_pose.PoseLandmark.LEFT_WRIST.value].x - landmarks[mp_pose.PoseLandmark.LEFT_ANKLE.value].x) < 0.05 and abs(landmarks[mp_pose.PoseLandmark.RIGHT_WRIST.value].x - landmarks[mp_pose.PoseLandmark.RIGHT_ANKLE.value].x) < 0.05:
 
95
  label = "Hands Under Feet Pose"
96
 
97
  # Check for Plank Pose
98
+ if left_shoulder_angle > 160 and left_shoulder_angle < 200 and \
99
+ right_shoulder_angle > 160 and right_shoulder_angle < 200 and \
100
+ left_knee_angle > 160 and left_knee_angle < 200 and \
101
+ right_knee_angle > 160 and right_knee_angle < 200:
102
+ label = "Plank Pose"
103
 
104
  # Write the label on the output image
105
  cv2.putText(output_image, label, (10, 30), cv2.FONT_HERSHEY_PLAIN, 2, (0, 255, 0), 2)