Skip to content

Ignore blank lines in YOLO instance segmentation labels - #95

Merged
michal-lightly merged 1 commit into
mainfrom
michal-stu-165-yolo-seg-blank-lines
Nov 23, 2026
Merged

michal-lightly merged 1 commit into
mainfrom
michal-stu-165-yolo-seg-blank-lines

Conversation

@michal-lightly

Copy link
Copy Markdown
Contributor

What has changed and why?

YOLOv8InstanceSegmentationInput crashed with IndexError on a blank line in a label file, for example a trailing empty line. It now skips blank and whitespace-only lines, like YOLOv8ObjectDetectionInput already does.

LightlyStudio needs this to load YOLO instance segmentation datasets as polygons.

How has it been tested?

  • New test: a label file with blank and whitespace-only lines loads one object. It failed with IndexError before the fix.
  • make static-checks and the full test suite: 180 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michal-lightly
michal-lightly marked this pull request as ready for review November 23, 2026 10:23
@michal-lightly

Copy link
Copy Markdown
Contributor Author

/review

@mrpositron mrpositron left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@michal-lightly
michal-lightly merged commit 0601ca3 into main Nov 23, 2026
2 checks passed
@michal-lightly
michal-lightly deleted the michal-stu-165-yolo-seg-blank-lines branch November 23, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants