-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Datumaro] Support relative paths #1715
Conversation
Here is an overview of what got changed by this pull request: Issues
======
- Added 1
Complexity increasing per file
==============================
- datumaro/tests/test_yolo_format.py 2
Complexity decreasing per file
==============================
+ datumaro/datumaro/plugins/voc_format/converter.py -2
+ datumaro/datumaro/plugins/tf_detection_api_format/extractor.py -1
+ datumaro/datumaro/plugins/yolo_format/converter.py -1
See the complete overview on Codacy |
# NOTE: when path is like [data/]<subset_obj>/<image_name> | ||
# drop everything but <image name> | ||
# <image name> can be <a/b/c/filename.ext>, so no just basename() | ||
path = osp.join(*parts[1:]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: No value for argument 'a' in function call
Pull Request Test Coverage Report for Build 5768
💛 - Coveralls |
save_image(osp.join(save_dir, item.id + '.jpg'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the original images were PNG or any other format? Don't you have all these issues just because item.id doesn't the the original extension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these issues
Which ones?
- Relative paths? They have no relation to extensions and are not used in any dataset format.
- Appending an extension in converters? Maybe, but the extension, as well as fill image path, is available in
item.image.path
. And an option to copy original images files instead of recoding them is a matter of further PRs, as well as keeping the original extension, where applicable.
Meanwhile, we have to add an extension if we have a video frame, or if we have only frame data and no image info.
@@ -311,7 +311,9 @@ def __call__(self, extractor, save_dir): | |||
|
|||
if self._save_images: | |||
if item.has_image and item.image.has_data: | |||
self._save_image(item, index=frame_id) | |||
save_image(osp.join(self._images_dir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again. We have a limitation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe at the moment Datumaro has a design whole with extensions for images. But let's address the issue in another PR.
* Support relative image paths in Datumaro * Update bindings * Fix merge * linter
Motivation and context
Preparation for #1463
DatasetItem.id
's now represent a relative path (without an extension)DatasetItem.image.path
now contains a real or supposed local image pathHow has this been tested?
Unit tests.
Checklist
develop
branchcvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.