Spaces:
Runtime error
Runtime error
Update calculations.py
Browse files- calculations.py +20 -19
calculations.py
CHANGED
|
@@ -46,31 +46,31 @@ def measure_body_sizes(side_colored_mask, front_colored_mask, sideposes, frontpo
|
|
| 46 |
pixel_height, real_height_cm
|
| 47 |
)
|
| 48 |
|
| 49 |
-
# arm_length_cm = convert_to_real_measurements(
|
| 50 |
-
# euclidean_distance((right_shoulder.x, right_shoulder.y), (right_elbow.x, right_elbow.y)),
|
| 51 |
-
# pixel_height, real_height_cm
|
| 52 |
-
# ) + convert_to_real_measurements(
|
| 53 |
-
# euclidean_distance((right_elbow.x, right_elbow.y), (right_wrist.x, right_wrist.y)),
|
| 54 |
-
# pixel_height, real_height_cm
|
| 55 |
-
# )
|
| 56 |
-
|
| 57 |
-
# leg_length_cm = convert_to_real_measurements(
|
| 58 |
-
# euclidean_distance((left_hip.x, left_hip.y), (left_knee.x, left_knee.y)),
|
| 59 |
-
# pixel_height, real_height_cm
|
| 60 |
-
# ) + convert_to_real_measurements(
|
| 61 |
-
# euclidean_distance((left_knee.x, left_knee.y), (left_ankle.x, left_ankle.y)),
|
| 62 |
-
# pixel_height, real_height_cm
|
| 63 |
-
# )
|
| 64 |
-
|
| 65 |
arm_length_cm = convert_to_real_measurements(
|
| 66 |
-
euclidean_distance((
|
| 67 |
pixel_height, real_height_cm
|
| 68 |
-
)
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
leg_length_cm = convert_to_real_measurements(
|
| 71 |
-
euclidean_distance((left_hip.x, left_hip.y), (
|
|
|
|
|
|
|
|
|
|
| 72 |
pixel_height, real_height_cm
|
| 73 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
shoulder_to_waist_cm = convert_to_real_measurements(
|
| 76 |
euclidean_distance((left_shoulder.x, left_shoulder.y), (left_hip.x, left_hip.y)),
|
|
@@ -97,6 +97,7 @@ def measure_body_sizes(side_colored_mask, front_colored_mask, sideposes, frontpo
|
|
| 97 |
"shoulder_width_cm": shoulder_width_cm,
|
| 98 |
"shoulder_to_waist_cm": shoulder_to_waist_cm,
|
| 99 |
"leg_length_cm": leg_length_cm,
|
|
|
|
| 100 |
})
|
| 101 |
|
| 102 |
return measurements
|
|
|
|
| 46 |
pixel_height, real_height_cm
|
| 47 |
)
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
arm_length_cm = convert_to_real_measurements(
|
| 50 |
+
euclidean_distance((right_shoulder.x, right_shoulder.y), (right_elbow.x, right_elbow.y)),
|
| 51 |
pixel_height, real_height_cm
|
| 52 |
+
) + convert_to_real_measurements(
|
| 53 |
+
euclidean_distance((right_elbow.x, right_elbow.y), (right_wrist.x, right_wrist.y)),
|
| 54 |
+
pixel_height, real_height_cm
|
| 55 |
+
)
|
| 56 |
|
| 57 |
leg_length_cm = convert_to_real_measurements(
|
| 58 |
+
euclidean_distance((left_hip.x, left_hip.y), (left_knee.x, left_knee.y)),
|
| 59 |
+
pixel_height, real_height_cm
|
| 60 |
+
) + convert_to_real_measurements(
|
| 61 |
+
euclidean_distance((left_knee.x, left_knee.y), (left_ankle.x, left_ankle.y)),
|
| 62 |
pixel_height, real_height_cm
|
| 63 |
)
|
| 64 |
+
|
| 65 |
+
# arm_length_cm = convert_to_real_measurements(
|
| 66 |
+
# euclidean_distance((left_shoulder.x, left_shoulder.y), (left_wrist.x, left_wrist.y)),
|
| 67 |
+
# pixel_height, real_height_cm
|
| 68 |
+
# )
|
| 69 |
+
|
| 70 |
+
# leg_length_cm = convert_to_real_measurements(
|
| 71 |
+
# euclidean_distance((left_hip.x, left_hip.y), (left_ankle.x, right_ankle.y)),
|
| 72 |
+
# pixel_height, real_height_cm
|
| 73 |
+
# )
|
| 74 |
|
| 75 |
shoulder_to_waist_cm = convert_to_real_measurements(
|
| 76 |
euclidean_distance((left_shoulder.x, left_shoulder.y), (left_hip.x, left_hip.y)),
|
|
|
|
| 97 |
"shoulder_width_cm": shoulder_width_cm,
|
| 98 |
"shoulder_to_waist_cm": shoulder_to_waist_cm,
|
| 99 |
"leg_length_cm": leg_length_cm,
|
| 100 |
+
"waist_circumference_cm":waist_circumference_cm
|
| 101 |
})
|
| 102 |
|
| 103 |
return measurements
|