ultralytics 8.0.74 Pose labels, fp64 labels, Ensemble fixes (#1956)
Co-authored-by: jjlira <63210717+jjlira@users.noreply.github.com> Co-authored-by: Jose Lira <jose.lira@georgebrown.ca> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com> Co-authored-by: wilsonlmh <lu6ni4z-forum@Yahoo.com.hk> Co-authored-by: HaeJin Lee <seareale@gmail.com>
This commit is contained in:
parent
5629ed0bb7
commit
24363236f2
9 changed files with 41 additions and 32 deletions
|
|
@ -81,7 +81,8 @@ def segment2box(segment, width=640, height=640):
|
|||
x, y = segment.T # segment xy
|
||||
inside = (x >= 0) & (y >= 0) & (x <= width) & (y <= height)
|
||||
x, y, = x[inside], y[inside]
|
||||
return np.array([x.min(), y.min(), x.max(), y.max()]) if any(x) else np.zeros(4) # xyxy
|
||||
return np.array([x.min(), y.min(), x.max(), y.max()], dtype=segment.dtype) if any(x) else np.zeros(
|
||||
4, dtype=segment.dtype) # xyxy
|
||||
|
||||
|
||||
def scale_boxes(img1_shape, boxes, img0_shape, ratio_pad=None):
|
||||
|
|
@ -529,7 +530,8 @@ def resample_segments(segments, n=1000):
|
|||
s = np.concatenate((s, s[0:1, :]), axis=0)
|
||||
x = np.linspace(0, len(s) - 1, n)
|
||||
xp = np.arange(len(s))
|
||||
segments[i] = np.concatenate([np.interp(x, xp, s[:, i]) for i in range(2)]).reshape(2, -1).T # segment xy
|
||||
segments[i] = np.concatenate([np.interp(x, xp, s[:, i]) for i in range(2)],
|
||||
dtype=np.float32).reshape(2, -1).T # segment xy
|
||||
return segments
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue