Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,17 +92,17 @@ def classifyPose(landmarks, output_image, display=False):
|
|
| 92 |
landmarks[mp_pose.PoseLandmark.RIGHT_KNEE.value],
|
| 93 |
landmarks[mp_pose.PoseLandmark.RIGHT_ANKLE.value])
|
| 94 |
# Get coordinates
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
|
| 107 |
|
| 108 |
# Check for Five-Pointed Star Pose
|
|
|
|
| 92 |
landmarks[mp_pose.PoseLandmark.RIGHT_KNEE.value],
|
| 93 |
landmarks[mp_pose.PoseLandmark.RIGHT_ANKLE.value])
|
| 94 |
# Get coordinates
|
| 95 |
+
left_hip = [landmarks[mp_pose.PoseLandmark.LEFT_HIP.value].x, landmarks[mp_pose.PoseLandmark.LEFT_HIP.value].y]
|
| 96 |
+
left_knee = [landmarks[mp_pose.PoseLandmark.LEFT_KNEE.value].x, landmarks[mp_pose.PoseLandmark.LEFT_KNEE.value].y]
|
| 97 |
+
left_ankle = [landmarks[mp_pose.PoseLandmark.LEFT_ANKLE.value].x, landmarks[mp_pose.PoseLandmark.LEFT_ANKLE.value].y]
|
| 98 |
|
| 99 |
+
right_hip = [landmarks[mp_pose.PoseLandmark.RIGHT_HIP.value].x, landmarks[mp_pose.PoseLandmark.RIGHT_HIP.value].y]
|
| 100 |
+
right_knee = [landmarks[mp_pose.PoseLandmark.RIGHT_KNEE.value].x, landmarks[mp_pose.PoseLandmark.RIGHT_KNEE.value].y]
|
| 101 |
+
right_ankle = [landmarks[mp_pose.PoseLandmark.RIGHT_ANKLE.value].x, landmarks[mp_pose.PoseLandmark.RIGHT_ANKLE.value].y]
|
| 102 |
|
| 103 |
+
# Calculate angles
|
| 104 |
+
left_leg_angle = calculate_angle(left_hip, left_knee, left_ankle)
|
| 105 |
+
right_leg_angle = calculate_angle(right_hip, right_knee, right_ankle)
|
| 106 |
|
| 107 |
|
| 108 |
# Check for Five-Pointed Star Pose
|