Add coco object detection dataset#677
Merged
simonschoelly merged 18 commits intomainfrom Apr 7, 2026
Merged
Conversation
cbdec4f to
670207e
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Contributor
Author
|
/review |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds COCO-format dataset support for object detection and refactors YOLO object detection to reuse a new shared ObjectDetectionDataset implementation, with accompanying test updates and a changelog entry.
Changes:
- Add
COCOObjectDetectionDataArgs/COCOObjectDetectionDatasetArgsand support selecting COCO vs YOLO via a discriminated union in the train task config. - Introduce a generic
ObjectDetectionDatasetand switch YOLO object detection dataset args to use it. - Add/adjust tests for COCO datasets, label helper mapping, and object detection training (YOLO + COCO); skip a flaky file-locking test on Python 3.8.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/helpers.py | Adds a helper to generate minimal COCO-format object detection datasets for tests. |
| tests/_data/test_yolo_object_detection_dataset.py | Updates YOLO tests to validate list_image_info() output format. |
| tests/_data/test_object_detection_dataset.py | Adds coverage for the new shared ObjectDetectionDataset behavior. |
| tests/_data/test_label_helpers.py | Adds tests for get_class_id_to_internal_class_id_mapping. |
| tests/_data/test_coco_object_detection_dataset.py | Adds tests for COCO dataset args list_image_info() normalization and class remapping. |
| tests/_commands/test_train_task.py | Splits YOLO OD training test and adds an end-to-end COCO OD training test. |
| tests/_commands/test_common_helpers.py | Skips a flaky multiprocessing file-locking test on Python 3.8. |
| src/lightly_train/_data/yolo_object_detection_dataset.py | Removes the dedicated YOLO dataset class and routes YOLO args to the shared dataset. |
| src/lightly_train/_data/object_detection_dataset.py | Introduces shared dataset implementation for object detection samples and transforms. |
| src/lightly_train/_data/coco_object_detection_dataset.py | Adds COCO dataset args + parsing logic for COCO JSON annotations. |
| src/lightly_train/_commands/train_task.py | Enables discriminated-union parsing for object detection data config (YOLO vs COCO). |
| CHANGELOG.md | Documents COCO object detection dataset format support. |
liopeer
reviewed
Apr 1, 2026
61a6cd8 to
64acb96
Compare
guarin
reviewed
Apr 2, 2026
64acb96 to
c8648cb
Compare
guarin
approved these changes
Apr 2, 2026
552f4ac to
d74e36b
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What has changed and why?
get_class_id_to_internal_class_id_mappingbecause that method was not covered anymore after this PR.test_file_locking_concurrent_incrementstest on Python 3.8 because it kept failing even after restarting the tests.How has it been tested?
Did you update CHANGELOG.md?
Did you update the documentation?
Coming in a follow up PR