Skip to content

Commit

Permalink
Update segment2box() comment (ultralytics#2600)
Browse files Browse the repository at this point in the history
(cherry picked from commit d4456e4)
  • Loading branch information
glenn-jocher authored and Lechtr committed Mar 28, 2021
1 parent 5eb4500 commit 8371f64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 8371f64

Please sign in to comment.