Skip to content

Commit

Permalink
Added back previousLabeledFrameIndex().
Browse files Browse the repository at this point in the history
  • Loading branch information
ntabris committed Oct 7, 2019
1 parent 3dfabbe commit bae8aed
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sleap/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2055,6 +2055,17 @@ def _plot_if_next(self, frame_iterator: Iterator) -> bool:
self.plotFrame(next_lf.frame_idx)
return True

def previousLabeledFrameIndex(self):
cur_idx = self.player.frame_idx
frames = self.labels.frames(self.video, from_frame_idx=cur_idx, reverse=True)

try:
next_idx = next(frames).frame_idx
except:
return

return next_idx

def previousLabeledFrame(self):
"""Goes to labeled frame prior to current frame."""
frames = self.labels.frames(
Expand Down

0 comments on commit bae8aed

Please sign in to comment.