sports2d 0.8.25__py3-none-any.whl → 0.8.27__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -89,7 +89,7 @@ det_frequency = 4 # Run person detection only every N frames, and inbetwee
89
89
  device = 'auto' # 'auto', 'CPU', 'CUDA', 'MPS', 'ROCM'
90
90
  backend = 'auto' # 'auto', 'openvino', 'onnxruntime', 'opencv'
91
91
  tracking_mode = 'sports2d' # 'sports2d' or 'deepsort'. 'deepsort' is slower, harder to parametrize but can be more robust if correctly tuned
92
- # deepsort_params = """{'max_age':30, 'n_init':3, 'max_cosine_distance':0.3, 'max_iou_distance':0.8, 'embedder_gpu': True, embedder':'torchreid'}""" # """{dictionary between 3 double quotes}"""
92
+ # deepsort_params = """{'max_age':30, 'n_init':3, 'max_cosine_distance':0.3, 'max_iou_distance':0.8, 'embedder_gpu': True, 'embedder':'torchreid'}""" # """{dictionary between 3 double quotes}"""
93
93
  # More robust in crowded scenes but tricky to parametrize. More information there: https://github.com/levan92/deep_sort_realtime/blob/master/deep_sort_realtime/deepsort_tracker.py#L51
94
94
  # Requires `pip install torch torchvision torchreid gdown tensorboard`
95
95
 
@@ -106,13 +106,16 @@ to_meters = true
106
106
  make_c3d = true
107
107
  save_calib = true
108
108
 
109
+ # Compensate for camera horizon
110
+ floor_angle = 'auto' # float, 'from_kinematics', 'from_calib', or 'auto' # 'auto' is equivalent to 'from_kinematics', ie angle calculated from foot contacts. 'from_calib' calculates it from a toml calibration file. Use float to manually specify it in degrees
111
+ xy_origin = ['auto'] # [px_x,px_y], or ['from kinematics'], ['from_calib'], or ['auto']. # BETWEEN BRACKETS! # ['auto'] is equivalent to ['from_kinematics'], ie origin estimated at first foot contact, direction is direction of motion. ['from_calib'] calculates it from a calibration file. Use [px_x,px_y] to manually specify it in pixels (px_y points downwards)
112
+
109
113
  # Compensate for perspective effects, which make the further limb look smaller. 1-2% coordinate error at 10 m, less if the camera is further away
110
114
  perspective_value = 10 # Either camera-to-person distance (m), or focal length (px), or field-of-view (degrees or radians), or '' if perspective_unit=='from_calib'
111
115
  perspective_unit = 'distance_m' # 'distance_m', 'f_px', 'fov_deg', 'fov_rad', or 'from_calib'
112
116
 
113
- # Compensate for camera horizon
114
- floor_angle = 'auto' # float, 'from_kinematics', 'from_calib', or 'auto' # 'auto' is equivalent to 'from_kinematics', ie angle calculated from foot contacts. 'from_calib' calculates it from a toml calibration file. Use float to manually specify it in degrees
115
- xy_origin = ['auto'] # [px_x,px_y], or ['from kinematics'], ['from_calib'], or ['auto']. # BETWEEN BRACKETS! # ['auto'] is equivalent to ['from_kinematics'], ie origin estimated at first foot contact, direction is direction of motion. ['from_calib'] calculates it from a calibration file. Use [px_x,px_y] to manually specify it in pixels (px_y points downwards)
117
+ # Optional distortion coefficients
118
+ distortions = [0.0, 0.0, 0.0, 0.0, 0.0] # [k1, k2, p1, p2, k3] or 'from_calib' (not implemented yet)
116
119
 
117
120
  # Optional calibration file
118
121
  calib_file = '' # Calibration file in the Pose2Sim toml format, or '' if not available
@@ -130,7 +133,7 @@ joint_angles = ['Right ankle', 'Left ankle', 'Right knee', 'Left knee', 'Right h
130
133
  segment_angles = ['Right foot', 'Left foot', 'Right shank', 'Left shank', 'Right thigh', 'Left thigh', 'Pelvis', 'Trunk', 'Shoulders', 'Head', 'Right arm', 'Left arm', 'Right forearm', 'Left forearm']
131
134
 
132
135
  # Processing parameters
133
- flip_left_right = true # Same angles whether the participant faces left/right. Set it to false if you want timeseries to be continuous even when the participant switches their stance.
136
+ flip_left_right = false # Same angles whether the participant faces left/right. Set it to false if you want timeseries to be continuous even when the participant switches their stance.
134
137
  correct_segment_angles_with_floor_angle = true # If the camera is tilted, corrects segment angles as regards to the floor angle. Set to false if it is the floor which is actually tilted
135
138
 
136
139
 
@@ -212,7 +215,7 @@ use_custom_logging = false # if integrated in an API that already has logging
212
215
  #
213
216
  # Check your model hierarchy with: for pre, _, node in RenderTree(model):
214
217
  # print(f'{pre}{node.name} id={node.id}')
215
- [pose.CUSTOM]
218
+ [[pose.CUSTOM]]
216
219
  name = "Hip"
217
220
  id = 19
218
221
  [[pose.CUSTOM.children]]
Sports2D/Sports2D.py CHANGED
@@ -197,6 +197,7 @@ DEFAULT_CONFIG = {'base': {'video_input': ['demo.mp4'],
197
197
  'save_calib': True,
198
198
  'perspective_value': 10.0,
199
199
  'perspective_unit': 'distance_m',
200
+ 'distortions': [0.0, 0.0, 0.0, 0.0, 0.0],
200
201
  'floor_angle': 'auto',
201
202
  'xy_origin': ['auto'],
202
203
  'calib_file': '',
@@ -311,6 +312,7 @@ CONFIG_HELP = {'config': ["C", "path to a toml configuration file"],
311
312
  'calib_file': ["", "path to calibration file. '' if not specified, eg no calibration file"],
312
313
  'save_calib': ["", "save calibration file. true if not specified"],
313
314
  'feet_on_floor': ["", "offset marker augmentation results so that feet are at floor level. true if not specified"],
315
+ 'distortions': ["", "camera distortion coefficients [k1, k2, p1, p2, k3] or 'from_calib'. [0.0, 0.0, 0.0, 0.0, 0.0] if not specified"],
314
316
  'use_simple_model': ["", "IK 10+ times faster, but no muscles or flexible spine, no patella. false if not specified"],
315
317
  'close_to_zero_speed_m': ["","Sum for all keypoints: about 50 px/frame or 0.2 m/frame"],
316
318
  'tracking_mode': ["", "'sports2d' or 'deepsort'. 'deepsort' is slower, harder to parametrize but can be more robust if correctly tuned"],