Repository navigation
Fix importing CVAT image XML files with annotation_type="cvat" - #728
Merged
Merged
Conversation
The "cvat" import path sent every non-directory path to load_cvat_from_zip, so a plain annotations.xml failed with BadZipFile. "cvat_video" already routed .zip and .xml files correctly, so both types now share that branch.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Essentials
- Run ID:
df6ca061-0b08-4869-bbff-5ea10a018754
📒 Files selected for processing (2)
dagshub/data_engine/annotation/importer.pytests/data_engine/annotation_import/test_cvat.py
Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.
📜 Review details
⏰ Context from checks skipped due to timeout. (7)
- GitHub Check: build (3.10)
- GitHub Check: Build documentation
- GitHub Check: build (3.13)
- GitHub Check: build (3.12)
- GitHub Check: build (3.9)
- GitHub Check: build (3.11)
- GitHub Check: Run linters
is_video_format only looked at the annotation type, so a "cvat" import of a CVAT video export went to the image task conversion. The importer now remembers when the CVAT loader returns video data.
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
ds.import_annotations_from_files(annotation_type="cvat", path="annotations.xml", ...)failed withzipfile.BadZipFile. The"cvat"branch ofAnnotationImporterpassed every path that isn't a directory toload_cvat_from_zip. The"cvat_video"branch already sends.zipfiles toload_cvat_from_zipand other files toload_cvat_from_xml_file, and it already handles both image and video results. Both types now share that branch.Related
CVAT brush masks (
<mask>) still import as empty until the converter adds mask support (DagsHub/dagshub-annotation-converter#29). After that is released, users get mask support by upgradingdagshub-annotation-converter.Testing
tests/data_engine/annotation_import/test_cvat.pyimports a CVAT image export as a.xmlfile and as a.zip. The.xmlcase fails without this fix.tests/data_engine/annotation_import: 76 passed.