ultralytics 8.3.50 Enhanced segment resample (#18171)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
f87b447b2d
commit
a3d807be13
4 changed files with 22 additions and 5 deletions
|
|
@ -624,6 +624,8 @@ def resample_segments(segments, n=1000):
|
|||
segments (list): the resampled segments.
|
||||
"""
|
||||
for i, s in enumerate(segments):
|
||||
if len(s) == n:
|
||||
continue
|
||||
s = np.concatenate((s, s[0:1, :]), axis=0)
|
||||
x = np.linspace(0, len(s) - 1, n - len(s) if len(s) < n else n)
|
||||
xp = np.arange(len(s))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue