-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Dataset manager] Fix import for MOTS format #3612
Conversation
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.
Is it the only format affected?
I think yes, because this is the only format for which we use |
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.
Looks working, but I think, it deserves a test.
Yes is it, but current CVAT tests check if CVAT can upload annotations dumped by CVAT. |
from datumaro.components.dataset import Dataset, DatasetItem | ||
from datumaro.components.extractor import Mask | ||
from numpy import array |
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 is the point of such import?
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.
These classes are only needed in this test, so I decided to import them inside the function.
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.
It's not a significant reason for having them here.
Also, numpy is typically imported as import numpy as np
@@ -908,7 +908,7 @@ def _make_image(i, **kwargs): | |||
attributes["labels"].append({"label_id": idx, "name": label["name"], "color": label["color"]}) | |||
attributes["track_id"] = -1 | |||
|
|||
dm_item = datumaro.DatasetItem(id=osp.split(frame_data.name)[-1].split('.')[0], | |||
dm_item = datumaro.DatasetItem(id=osp.splitext(osp.split(frame_data.name)[-1])[0], |
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.
Probably, this should not be in this PR.
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.
Okay, I'll made these changes in new PR
Motivation and context
Fixed #3360.
Some masks in the MOTS PNG format may contain several polygons with the same track_id, for such annotations to be loaded into CVAT, they must be grouped during export. This is what I did in this PR.
How has this been tested?
Checklist
develop
branch[ ] I have increased versions of npm packages if it is necessary (cvat-canvas,cvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.