[DAR-5605][External] Include transitions from attributes to no attributes in video annotation imports #993
+96
−9
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.
Problem
When importing video annotations with attributes, we only consider frames where a transition of attribute values took place. For example, if:
The transition from 1 & 2 to just 1 is represented correctly in the imported data, but frame 11 onward will still have attribute 1. Why? When parsing video annotation keyframes for import, the
_handle_subs
function will not populatedata["attributes"]
unless at least 1 attribute value is present in the annotationSolution
Add an optional
include_empty_attributes
argument to the_handle_subs
function and set it toTrue
when parsing annotation keyframes for import. This means if no attributes are present on a parsed keyframe,data["attributes"]
is set to an empty list. This means the imported data will properly reflect this transition from values to no valuesAlso a handful of unrelated formatting changes from
black
Changelog
Fixed edge case when importing video annotations with attributes that transition from attributes to no attributes from frame to frame