-
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
Don't export outside annotations #1729
Conversation
@zhiltsov-max could you fix the tests? |
last_shape = track.shapes[-1] | ||
if last_shape.frame < int(task_data.meta['task']['stop_frame']): | ||
track.shapes.append(last_shape._replace(outside=True, | ||
frame=last_shape.frame + task_data.frame_step) |
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'm not sure that here we need to add task_data.frame_step (probably +1 is correct). You can get a shape with frame > task_data.meta['task']['stop_frame']
. @azhavoro , could you please look at the line and give your opinion?
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.
With +1 I'm not sure about how filtered out frames would be handled in UI, e.g. in "go to the next keyframe" button.
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.
@zhiltsov-max , could you please check?
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've checked. We can't just save the next frame (which is +1
) without breaking the logic in many places, at least on the server, so we probably should stick to +frame_step
.
@@ -410,9 +410,10 @@ def match_frame(self, filename): | |||
"Cannot match filename or determine frame number for {} filename".format(filename)) | |||
|
|||
class CvatTaskDataExtractor(datumaro.SourceExtractor): | |||
def __init__(self, task_data, include_images=False): | |||
def __init__(self, task_data, include_images=False, include_outside=False): |
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.
Why do we need the flag at all? When is it useful?
dm_dataset = datumaro.components.project.Dataset.from_extractors(extractor) | ||
self.assertEqual(4, len(dm_dataset.get("image_1").annotations)) | ||
|
||
extractor = CvatTaskDataExtractor(task_data, include_outside=True) |
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 we always should include_outside but different formats can use or ignore such shapes.
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.
Maybe, but there is no formats with such annotation property.
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 believed it too, so we've been there already. It means that all formats must expect (read as "support") such shapes. Much better is to filter them on the caller's side.
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.
Now "caller" knows about format implementation details (a format doesn't support "outside" flag). Is it OK? What is about attributes? Tracks? Cuboids? Are you going to filter that as?
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 think, only CVAT knows about outside
, so I treat it as a CVAT implementation detail. Tracks and cuboids are not exported too.
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.
OK. I see that CvatTaskDataExtractor is used as an utility function by each format. Thus the knowledge encapsulated.
Pull Request Test Coverage Report for Build 6330
💛 - Coveralls |
Motivation and context
Fixes #1620
outside
annotations were not considered during export.How 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.