glenn-jocher
commited on
Commit
•
d4456e4
1
Parent(s):
ad05e37
Update segment2box() comment (#2600)
Browse files- utils/general.py +1 -1
utils/general.py
CHANGED
@@ -289,7 +289,7 @@ def segment2box(segment, width=640, height=640):
|
|
289 |
x, y = segment.T # segment xy
|
290 |
inside = (x >= 0) & (y >= 0) & (x <= width) & (y <= height)
|
291 |
x, y, = x[inside], y[inside]
|
292 |
-
return np.array([x.min(), y.min(), x.max(), y.max()]) if any(x) else np.zeros((1, 4)) #
|
293 |
|
294 |
|
295 |
def segments2boxes(segments):
|
|
|
289 |
x, y = segment.T # segment xy
|
290 |
inside = (x >= 0) & (y >= 0) & (x <= width) & (y <= height)
|
291 |
x, y, = x[inside], y[inside]
|
292 |
+
return np.array([x.min(), y.min(), x.max(), y.max()]) if any(x) else np.zeros((1, 4)) # xyxy
|
293 |
|
294 |
|
295 |
def segments2boxes(segments):
|