Skip to content

Conversation

@JBWilkie
Copy link
Contributor

@JBWilkie JBWilkie commented Jan 29, 2025

Problem

When importing video annotations with attributes, we only consider frames where a transition of attribute values took place. For example, if:

  • Attributes 1 & 2 are present on frames 1 --> 5
  • Only attribute 1 is present on frames 6 --> 10
  • No attributes are present on frames 11 onward

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 populate data["attributes"] unless at least 1 attribute value is present in the annotation

Solution

Add an optional include_empty_attributes argument to the _handle_subs function and set it to True 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 values

Also 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

@linear
Copy link

linear bot commented Jan 29, 2025

@JBWilkie JBWilkie force-pushed the DAR-5605 branch 2 times, most recently from 9882829 to afa994d Compare January 29, 2025 23:38
@JBWilkie JBWilkie merged commit f708da1 into master Feb 3, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants