Skip to content

Parse labels in YoloObjectDetectionDatasetArgs.list_image_info#674

Merged
simonschoelly merged 1 commit intomainfrom
simon-yolo-object-detection-list-image-info-parses-labels
Mar 30, 2026
Merged

Parse labels in YoloObjectDetectionDatasetArgs.list_image_info#674
simonschoelly merged 1 commit intomainfrom
simon-yolo-object-detection-list-image-info-parses-labels

Conversation

@simonschoelly
Copy link
Copy Markdown
Contributor

What has changed and why?

This PR makes it so that YOLOObjectDetectionDatasetArgs.list_image_info parses the label files and returns the parsed results instead of returning the paths to the label files.

How has it been tested?

I relayed on the existing tests which had to be slightly changed.

Did you update CHANGELOG.md?

  • Yes
  • Not needed (internal change)

Did you update the documentation?

  • Yes
  • Not needed (internal change without effects for user)

Copilot AI review requested due to automatic review settings March 27, 2026 23:07
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR changes the YOLO object detection data pipeline so YOLOObjectDetectionDatasetArgs.list_image_info() parses label files and returns parsed bbox/class data (instead of returning label file paths), updating the dataset and tests accordingly.

Changes:

  • Update YOLOObjectDetectionDatasetArgs.list_image_info() to read YOLO label files, filter/mask classes, and emit serialized bbox/class data.
  • Update YOLOObjectDetectionDataset.__getitem__() to consume bbox/class data from image_info (via JSON) instead of reading label files on-demand.
  • Rename/adjust the YOLO object detection label helper to return Python lists and update tests to match.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/lightly_train/_data/yolo_object_detection_dataset.py Moves label parsing/mapping into list_image_info() and switches __getitem__() to consume parsed labels.
src/lightly_train/_data/file_helpers.py Changes the YOLO object detection label reader to return lists (and renames the function accordingly).
tests/_data/test_yolo_object_detection_dataset.py Updates dataset construction in tests to use list_image_info() output.
tests/_data/test_file_helpers.py Updates tests for the renamed label reader and list-based return types.

Comment thread src/lightly_train/_data/yolo_object_detection_dataset.py Outdated
Comment thread tests/_data/test_file_helpers.py Outdated
Comment thread src/lightly_train/_data/yolo_object_detection_dataset.py Outdated
Comment thread src/lightly_train/_data/yolo_object_detection_dataset.py
@simonschoelly simonschoelly force-pushed the simon-yolo-object-detection-list-image-info-parses-labels branch from c772dd8 to 8469a23 Compare March 27, 2026 23:27
@simonschoelly simonschoelly changed the title Parse labels in YoloObjectDetection.list_image_info Parse labels in YoloObjectDetectionDatasetArgs.list_image_info Mar 29, 2026
@yutong-xiang-97
Copy link
Copy Markdown
Contributor

/review

Comment thread tests/_data/test_yolo_object_detection_dataset.py
@simonschoelly simonschoelly force-pushed the simon-yolo-object-detection-list-image-info-parses-labels branch from 8469a23 to 1e865ce Compare March 30, 2026 08:10
@simonschoelly simonschoelly merged commit 764ae1f into main Mar 30, 2026
16 checks passed
@simonschoelly simonschoelly deleted the simon-yolo-object-detection-list-image-info-parses-labels branch March 30, 2026 09:44
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.

4 participants