-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add patch command #401
Add patch command #401
Conversation
d67fe67
to
20e34e5
Compare
datumaro/plugins/transforms.py
Outdated
dst_mask_cat = MaskCategories(attributes=src_mask_cat.attributes) | ||
dst_mask_cat.colormap = { | ||
id: src_mask_cat[id] | ||
for id, _ in enumerate(src_label_cat.items) |
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.
for id, _ in enumerate(src_label_cat.items) | |
for id in range(len(src_label_cat.items)) |
if id in src_point_cat and (self._map_id(id) or id == 0) | ||
} | ||
self._categories[AnnotationType.points] = dst_point_cat | ||
|
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.
IMO, there should be a check here that no categories of unknown types are present. Otherwise, if a new category type is added in the future and this class is not updated, then old label IDs could leak into the transformed dataset.
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.
there should be a check
Probably, a good point.
could leak
Input categories are not copied in these transforms, so no.
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.
Input categories are not copied in these transforms, so no.
Okay, fair point.
However, the annotations are copied. So perhaps we should make sure to only copy annotations of known types so that we can make sure that annotations aren't copied without the appropriate categories?
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.
Currently, addition of new annotation type is a rare event, and addition of a new categories is even more rare. I suppose, when it happen, it will require a number of similar changes across the code.
Summary
datum patch
command, which allows to update a dataset from another datasetProjectLabels
transform to align dataset labelsLabelCategories
by nameDataset.is_modified
DatasetMergeError
(item_id
should not be mandatory)datum diff
RemapLabels
How to test
Checklist
develop
branchLicense
Feel free to contact the maintainers if that's a concern.