Update app.py
Browse files
app.py
CHANGED
|
@@ -191,7 +191,7 @@ def calculate_and_display_angles(image_path, return_angles=False):
|
|
| 191 |
mp_pose = mp.solutions.pose
|
| 192 |
pose = mp_pose.Pose(min_detection_confidence=0.5, min_tracking_confidence=0.5)
|
| 193 |
|
| 194 |
-
#
|
| 195 |
file_bytes = np.asarray(bytearray(image_path.read()), dtype=np.uint8)
|
| 196 |
image = cv2.imdecode(file_bytes, cv2.IMREAD_COLOR)
|
| 197 |
image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
|
|
|
| 191 |
mp_pose = mp.solutions.pose
|
| 192 |
pose = mp_pose.Pose(min_detection_confidence=0.5, min_tracking_confidence=0.5)
|
| 193 |
|
| 194 |
+
image_path.seek(0) # rewind to the beginning
|
| 195 |
file_bytes = np.asarray(bytearray(image_path.read()), dtype=np.uint8)
|
| 196 |
image = cv2.imdecode(file_bytes, cv2.IMREAD_COLOR)
|
| 197 |
image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|