Skip to content

Commit

Permalink
Fix for empty instances
Browse files Browse the repository at this point in the history
  • Loading branch information
gitttt-1234 committed Dec 19, 2024
1 parent 11af641 commit 889fc5a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sleap/nn/data/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,16 @@ def py_fetch_lf(ind):

for inst in insts:

if len(inst) > 0:
# Filter OOB
pts = inst.numpy()
pts[pts < 0] = np.NaN

# Filter OOB
pts = inst.numpy()
pts[pts < 0] = np.NaN
pts[:, 0][pts[:, 0] > width - 1] = np.NaN
pts[:, 1][pts[:, 1] > height - 1] = np.NaN

pts[:, 0][pts[:, 0] > width - 1] = np.NaN
pts[:, 1][pts[:, 1] > height - 1] = np.NaN
instance = Instance.from_numpy(pts, inst.skeleton, inst.track)

instance = Instance.from_numpy(pts, inst.skeleton, inst.track)
if len(instance) > 0:

if self.with_track_only:
if instance.track is not None:
Expand Down

0 comments on commit 889fc5a

Please sign in to comment.