Update app.py
Browse files
app.py
CHANGED
|
@@ -196,6 +196,8 @@ def calculate_angles_landmarks(landmarks):
|
|
| 196 |
|
| 197 |
# Function to calculate the angles for both left and right sides and overlay on image
|
| 198 |
def calculate_and_display_angles(image1, return_angles=False):
|
|
|
|
|
|
|
| 199 |
mp_pose = mp.solutions.pose
|
| 200 |
pose = mp_pose.Pose(min_detection_confidence=0.5, min_tracking_confidence=0.5)
|
| 201 |
|
|
@@ -284,14 +286,11 @@ def upload_file():
|
|
| 284 |
mime_type, _ = mimetypes.guess_type(file.filename)
|
| 285 |
|
| 286 |
f1 = calculate_and_display_angles(file)
|
|
|
|
| 287 |
return send_file(
|
| 288 |
BytesIO(file.read()), mimetype=mime_type,
|
| 289 |
as_attachment=False, download_name=file.filename
|
| 290 |
)
|
| 291 |
-
# return send_file(
|
| 292 |
-
# BytesIO(file.read()), mimetype=mime_type,
|
| 293 |
-
# as_attachment=False, download_name=file.filename
|
| 294 |
-
# )
|
| 295 |
|
| 296 |
except Exception as e:
|
| 297 |
return {"message": f"Error processing file: {str(e)}"}, 500
|
|
|
|
| 196 |
|
| 197 |
# Function to calculate the angles for both left and right sides and overlay on image
|
| 198 |
def calculate_and_display_angles(image1, return_angles=False):
|
| 199 |
+
retturn 'hi'
|
| 200 |
+
|
| 201 |
mp_pose = mp.solutions.pose
|
| 202 |
pose = mp_pose.Pose(min_detection_confidence=0.5, min_tracking_confidence=0.5)
|
| 203 |
|
|
|
|
| 286 |
mime_type, _ = mimetypes.guess_type(file.filename)
|
| 287 |
|
| 288 |
f1 = calculate_and_display_angles(file)
|
| 289 |
+
|
| 290 |
return send_file(
|
| 291 |
BytesIO(file.read()), mimetype=mime_type,
|
| 292 |
as_attachment=False, download_name=file.filename
|
| 293 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
|
| 295 |
except Exception as e:
|
| 296 |
return {"message": f"Error processing file: {str(e)}"}, 500
|