Skip to content
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

[DAR-5605][External] Include transitions from attributes to no attributes in video annotation imports #993

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JBWilkie
Copy link
Collaborator

@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

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
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.

2 participants