Update app.py
Browse files
app.py
CHANGED
|
@@ -185,13 +185,13 @@ def calculate_angles_landmarks(landmarks):
|
|
| 185 |
|
| 186 |
# from PIL import Image
|
| 187 |
# Function to calculate the angles for both left and right sides and overlay on image
|
| 188 |
-
def calculate_and_display_angles(
|
| 189 |
|
| 190 |
|
| 191 |
mp_pose = mp.solutions.pose
|
| 192 |
pose = mp_pose.Pose(min_detection_confidence=0.5, min_tracking_confidence=0.5)
|
| 193 |
|
| 194 |
-
image =
|
| 195 |
image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
| 196 |
|
| 197 |
# pil_image = Image.open(image).convert('RGB') # PIL image
|
|
|
|
| 185 |
|
| 186 |
# from PIL import Image
|
| 187 |
# Function to calculate the angles for both left and right sides and overlay on image
|
| 188 |
+
def calculate_and_display_angles(image_path, return_angles=False):
|
| 189 |
|
| 190 |
|
| 191 |
mp_pose = mp.solutions.pose
|
| 192 |
pose = mp_pose.Pose(min_detection_confidence=0.5, min_tracking_confidence=0.5)
|
| 193 |
|
| 194 |
+
image = cv2.imread(image_path)
|
| 195 |
image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
| 196 |
|
| 197 |
# pil_image = Image.open(image).convert('RGB') # PIL image
|