@@ -289,7 +289,7 @@ 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((1, 4)) # cls, xyxy | |||
return np.array([x.min(), y.min(), x.max(), y.max()]) if any(x) else np.zeros((1, 4)) # xyxy | |||
def segments2boxes(segments): |