Fix duplicated annotations by `yolo_bbox2segment` (#17401)

Co-authored-by: Burhan <62214284+Burhan-Q@users.noreply.github.com>
pull/17356/head^2
Laughing 7 days ago committed by GitHub
parent 005a0b605b
commit 9a7b344fd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      ultralytics/data/converter.py

@ -636,8 +636,8 @@ def yolo_bbox2segment(im_dir, save_dir=None, sam_model="sam_b.pt"):
continue
line = (int(cls[i]), *s.reshape(-1))
texts.append(("%g " * len(line)).rstrip() % line)
with open(txt_file, "a") as f:
f.writelines(text + "\n" for text in texts)
with open(txt_file, "a") as f:
f.writelines(text + "\n" for text in texts)
LOGGER.info(f"Generated segment labels saved in {save_dir}")

Loading…
Cancel
Save