Skip to content

Commit

Permalink
Update segment2box() comment (ultralytics#2600)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Mar 25, 2021
1 parent ad05e37 commit d4456e4
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 d4456e4

Please sign in to comment.