Skip to content

Commit

Permalink
Ensure frame is set on Instance when using Labels.add_instance
Browse files Browse the repository at this point in the history
This is more permanently fixed by the InstancesList class added in #1807
  • Loading branch information
roomrys committed Nov 1, 2024
1 parent c7185c7 commit 5098230
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sleap/io/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,10 @@ def add_instance(self, frame: LabeledFrame, instance: Instance):

# Add instance and track to labels
frame.instances.append(instance)

# TODO: Do NOT merge into develop, this next line is handled by InstancesList
instance.frame = frame # Needed to add instance to instance group

if (instance.track is not None) and (instance.track not in self.tracks):
self.add_track(video=frame.video, track=instance.track)

Expand Down

0 comments on commit 5098230

Please sign in to comment.