Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,6 +97,16 @@ def classify_pose(landmarks, output_image, display=False):
|
|
| 97 |
abs(landmarks[mp_pose.PoseLandmark.LEFT_WRIST.value].x - landmarks[mp_pose.PoseLandmark.LEFT_ANKLE.value].x) < 0.05 and \
|
| 98 |
abs(landmarks[mp_pose.PoseLandmark.RIGHT_WRIST.value].x - landmarks[mp_pose.PoseLandmark.RIGHT_ANKLE.value].x) < 0.05:
|
| 99 |
label = "Hands Under Feet Pose"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
return output_image, label
|
| 102 |
|
|
|
|
| 97 |
abs(landmarks[mp_pose.PoseLandmark.LEFT_WRIST.value].x - landmarks[mp_pose.PoseLandmark.LEFT_ANKLE.value].x) < 0.05 and \
|
| 98 |
abs(landmarks[mp_pose.PoseLandmark.RIGHT_WRIST.value].x - landmarks[mp_pose.PoseLandmark.RIGHT_ANKLE.value].x) < 0.05:
|
| 99 |
label = "Hands Under Feet Pose"
|
| 100 |
+
|
| 101 |
+
# Check for Plank Pose
|
| 102 |
+
#----------------------------------------------------------------------------------------------------------------
|
| 103 |
+
# The body should be in a straight line from head to heels,
|
| 104 |
+
# so the shoulder and hip angles should be close to 180 degrees
|
| 105 |
+
if left_shoulder_angle > 160 and left_shoulder_angle < 200 and \
|
| 106 |
+
right_shoulder_angle > 160 and right_shoulder_angle < 200 and \
|
| 107 |
+
left_knee_angle > 160 and left_knee_angle < 200 and \
|
| 108 |
+
right_knee_angle > 160 and right_knee_angle < 200:
|
| 109 |
+
label = "Plank Pose"
|
| 110 |
|
| 111 |
return output_image, label
|
| 112 |
|