Skip to content

Commit

Permalink
Allow 3-point segments (#6938)
Browse files Browse the repository at this point in the history
May resolve #6931
  • Loading branch information
glenn-jocher committed Mar 10, 2022
1 parent 055e72a commit caf7ad0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ def verify_image_label(args):
nf = 1 # label found
with open(lb_file) as f:
lb = [x.split() for x in f.read().strip().splitlines() if len(x)]
if any([len(x) > 8 for x in lb]): # is segment
if any(len(x) > 6 for x in lb): # is segment
classes = np.array([x[0] for x in lb], dtype=np.float32)
segments = [np.array(x[1:], dtype=np.float32).reshape(-1, 2) for x in lb] # (cls, xy1...)
lb = np.concatenate((classes.reshape(-1, 1), segments2boxes(segments)), 1) # (cls, xywh)
Expand Down

0 comments on commit caf7ad0

Please sign in to comment.