Skip to content

Commit abc026b

Browse files
committed
Better sorting algorithm, better compute_floor_line, and other fixes
1 parent b40880b commit abc026b

File tree

4 files changed

+314
-249
lines changed

4 files changed

+314
-249
lines changed

Sports2D/Demo/Config_demo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ tracking_mode = 'sports2d' # 'sports2d' or 'deepsort'. 'deepsort' is slower, har
9797
keypoint_likelihood_threshold = 0.3 # Keypoints whose likelihood is lower will not be taken into account
9898
average_likelihood_threshold = 0.5 # Person will be ignored if average likelihood of good keypoints is lower than this value
9999
keypoint_number_threshold = 0.3 # Person will be ignored if the number of good keypoints (above keypoint_likelihood_threshold) is less than this fraction
100-
100+
max_distance = 100 # in px or None # If a person is detected further than max_distance from its position on the previous frame, it will be considered as a new one
101101

102102
[px_to_meters_conversion]
103103
# Pixel to meters conversion
@@ -131,11 +131,12 @@ correct_segment_angles_with_floor_angle = true # If the camera is tilted, correc
131131

132132
[post-processing]
133133
interpolate = true
134-
interp_gap_smaller_than = 10 # do not interpolate bigger gaps
134+
interp_gap_smaller_than = 10 # Do not interpolate larger gaps
135135
fill_large_gaps_with = 'last_value' # 'last_value', 'nan', or 'zeros'
136136
sections_to_keep = 'all' # 'all', 'largest', 'first', 'last'
137-
# keep 'all' valid sections even when they are interspersed with undetected chunks, or the 'largest' valid section, or the 'first' one, or the 'last' one
138-
reject_outliers = true # Hampel filter for outlier rejection before other filtering methods. Rejects outliers that are outside of a 95% confidence interal from the median in a sliding window of size 7.
137+
# Keep 'all' valid sections even when they are interspersed with undetected chunks, or the 'largest' valid section, or the 'first' one, or the 'last' one
138+
min_chunk_size = 10 # Minimum number of valid frames in a row to keep a chunk of data for a person
139+
reject_outliers = true # Hampel filter for outlier rejection before other filtering methods. Rejects outliers that are outside of a 95% confidence interal from the median in a sliding window of size 7.
139140

140141
filter = true
141142
show_graphs = true # Show plots of raw and processed results

Sports2D/Sports2D.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
'keypoint_likelihood_threshold': 0.3,
153153
'average_likelihood_threshold': 0.5,
154154
'keypoint_number_threshold': 0.3,
155+
'max_distance': 100,
155156
'CUSTOM': { 'name': 'Hip',
156157
'id': 19,
157158
'children': [{'name': 'RHip',
@@ -233,6 +234,7 @@
233234
'interp_gap_smaller_than': 10,
234235
'fill_large_gaps_with': 'last_value',
235236
'sections_to_keep':'all',
237+
'min_chunk_size': 10,
236238
'reject_outliers': True,
237239
'filter': True,
238240
'show_graphs': True,
@@ -315,6 +317,7 @@
315317
'keypoint_likelihood_threshold': ["", "detected keypoints are not retained if likelihood is below this threshold. 0.3 if not specified"],
316318
'average_likelihood_threshold': ["", "detected persons are not retained if average keypoint likelihood is below this threshold. 0.5 if not specified"],
317319
'keypoint_number_threshold': ["", "detected persons are not retained if number of detected keypoints is below this threshold. 0.3 if not specified, i.e., i.e., 30 percent"],
320+
'max_distance': ["", "If a person is detected further than max_distance from its position on the previous frame, it will be considered as a new one. in px or None, 100 by default."],
318321
'fastest_frames_to_remove_percent': ["", "Frames with high speed are considered as outliers. Defaults to 0.1"],
319322
'close_to_zero_speed_px': ["", "Sum for all keypoints: about 50 px/frame or 0.2 m/frame. Defaults to 50"],
320323
'large_hip_knee_angles': ["", "Hip and knee angles below this value are considered as imprecise. Defaults to 45"],
@@ -326,6 +329,7 @@
326329
'interp_gap_smaller_than': ["", "interpolate sequences of missing data if they are less than N frames long. 10 if not specified"],
327330
'fill_large_gaps_with': ["", "last_value, nan, or zeros. last_value if not specified"],
328331
'sections_to_keep': ["", "all, largest, first, or last. Keep 'all' valid sections even when they are interspersed with undetected chunks, or the 'largest' valid section, or the 'first' one, or the 'last' one"],
332+
'min_chunk_size': ["", "Minimum number of valid frames in a row to keep a chunk of data for a person. 10 if not specified"],
329333
'reject_outliers': ["", "reject outliers with Hampel filter before other filtering methods. true if not specified"],
330334
'filter': ["", "filter results. true if not specified"],
331335
'filter_type': ["", "butterworth, kalman, gcv_spline, gaussian, median, or loess. butterworth if not specified"],

0 commit comments

Comments
 (0)