refactor: dataset registry for multi-dataset training#18
Merged
ziv-lazarov-nagish merged 3 commits intomainfrom Apr 14, 2026
Merged
refactor: dataset registry for multi-dataset training#18ziv-lazarov-nagish merged 3 commits intomainfrom
ziv-lazarov-nagish merged 3 commits intomainfrom
Conversation
Replace hardcoded dataset construction with a registry so new datasets can be added by implementing from_args + calling register_dataset(), without touching train.py or evaluate.py. - DATASET_REGISTRY + register_dataset() + build_datasets() in common.py - Abstract from_args classmethod on BaseSegmentationDataset - --datasets arg (comma-separated) replaces single-dataset dispatch - Shared build path between train.py and evaluate.py - Remove DatasetType enum (registry replaces it)
AmitMY
approved these changes
Apr 14, 2026
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.
Summary
DATASET_REGISTRY+register_dataset()+build_datasets()tocommon.pyso new datasets can be added without modifyingtrain.pyorevaluate.pyfrom_args(split, args, **augment_kwargs)classmethod and registers itself on import--datasetsCLI arg accepts comma-separated names (e.g.dgs,platform), replacing theDatasetTypeenum and--datasetchoicestrain.pyandevaluate.py(removes duplication flagged in feat: annotation platform dataset and multi-dataset training #17)Adding a new dataset
BaseSegmentationDataset, implementfrom_args+get_split_manifestregister_dataset("name", YourClass)in__init__.py_ensure_datasets_registered()incommon.pyTest plan
ruff check .passespytestpasses (38 tests)--datasets dgs(validation_hm_iou: 0.617)Addresses review feedback from #17.