You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sports2D/Utilities/tests.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -96,17 +96,18 @@ def test_workflow():
96
96
97
97
# With no pixels to meters conversion, one person to select, lightweight mode, detection frequency, slowmo factor, gaussian filter, RTMO body pose model
xy_origin_kin[1] =xy_origin_kin[1] +0.13*px_per_m# approx. height of the ankle above the floor
1450
-
logging.warning(f'The RBigToe and LBigToe are missing from your pose estimation model. Using ankles - 13 cm to compute the floor line.')
1451
-
except:
1452
-
floor_angle_kin=0
1453
-
xy_origin_kin=cam_width/2, cam_height/2
1454
-
logging.warning(f'Could not estimate the floor angle and xy_origin from person {0}. Make sure that the full body is visible. Using floor angle = 0° and xy_origin = [{cam_width/2}, {cam_height/2}] px.')
1441
+
px_per_m=height_px/height_m
1442
+
toe_speed_below_px_frame=toe_speed_below*px_per_m/fps# speed below which the foot is considered to be stationary
xy_origin_kin[1] =xy_origin_kin[1] +0.13*px_per_m# approx. height of the ankle above the floor
1449
+
logging.warning(f'The RBigToe and LBigToe are missing from your pose estimation model. Using ankles - 13 cm to compute the floor line.')
1450
+
except:
1451
+
floor_angle_kin=0
1452
+
xy_origin_kin=cam_width/2, cam_height/2
1453
+
logging.warning(f'Could not estimate the floor angle and xy_origin from person {0}. Make sure that the full body is visible. Using floor angle = 0° and xy_origin = [{cam_width/2}, {cam_height/2}] px.')
1455
1454
1456
1455
# Determine final floor angle estimation
1457
1456
iffloor_angle=='from_calib':
1458
1457
floor_angle_estim=floor_angle_calib
1459
1458
eliffloor_anglein ['auto', 'from_kinematics']:
1460
1459
floor_angle_estim=floor_angle_kin
1461
-
elifisinstance(floor_angle, (int,float)):
1462
-
floor_angle_estim=np.radians(floor_angle)
1463
1460
else:
1464
-
raiseValueError(f'Invalid floor_angle: {floor_angle}. Must be "auto", "from_calib", "from_kinematics", or a numeric value in degrees.')
1461
+
try:
1462
+
floor_angle_estim=np.radians(float(floor_angle))
1463
+
except:
1464
+
raiseValueError(f'Invalid floor_angle: {floor_angle}. Must be "auto", "from_calib", "from_kinematics", or a numeric value in degrees.')
0 commit comments