Conversation
klemen1999
approved these changes
Feb 23, 2026
Collaborator
klemen1999
left a comment
There was a problem hiding this comment.
Tested on a few examples and LGTM, ty
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.
Purpose
Make it possible to parse a zip file with a top-level directory instead of immediate sub-directories.
Specification
.(.DS_STORE, .cache) in case these are created with the top-level dir when the zip file is created.ClassificationDirectoryParsercould falsely win on wrapped archives because it accepts generic class-folder layouts. To avoid that, we unwrap a single top-level folder only when it has explicit dataset-root markers (eg train/valid/test, images/labels, annotations.json, labels.json, data.yaml) or when that inner folder is recognized by any non-CLSDIR parser.test_zip_layout_equivalence.py: for different zip datasets, parse the original (flat) zip, parse the zip with an added top-level directory, and parse the extracted zip folder and assert that all 3 return the same LDFs.test_zip_layout_equivalence.py, I used the helper methods from test_parse_export_equivalence.py to assert that the resulting annotations are the same, so since they are used in two tests I moved them toutils.pyDependencies & Potential Impact
Deployment Plan
Testing & Validation
imagenet-sample zip file with top-level dir, parser detects the correct format:

coco-2017 zip file with top-level dir, parser detects the correct format:
