Skip to content

Commit

Permalink
Fix package export (#1619)
Browse files Browse the repository at this point in the history
Add check for empty videos
  • Loading branch information
talmo authored Dec 1, 2023
1 parent cb82d36 commit 2d24296
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sleap/io/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,9 @@ def encode(img):
for i in range(len(frame_numbers)):
frames.append(encode(frame_data[i]))

max_frame_size = max([len(x) for x in frames])
max_frame_size = (
max([len(x) if len(x) else 0 for x in frames]) if len(frames) else 0
)

dset = f.create_dataset(
dataset + "/video",
Expand Down

0 comments on commit 2d24296

Please sign in to comment.