Skip to content

Commit e381892

Browse files
committed
refactor: use sleap-io built-in video matching methods
1 parent 641ab15 commit e381892

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

sleap_nn/evaluation.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,9 @@ def find_frame_pairs(
6161
# Find matching video instance in predictions.
6262
video_pr = None
6363
for video in labels_pr.videos:
64-
if (
65-
isinstance(video.backend, type(video_gt.backend))
66-
and video.filename == video_gt.filename
67-
):
68-
same_dataset = (
69-
(video.backend.dataset == video_gt.backend.dataset)
70-
if hasattr(video.backend, "dataset")
71-
else True
72-
) # `dataset` attr exists only for hdf5 backend not for mediavideo
73-
if same_dataset:
74-
video_pr = video
75-
break
64+
if video_gt.matches_content(video) and video_gt.matches_path(video):
65+
video_pr = video
66+
break
7667

7768
if video_pr is None:
7869
continue

0 commit comments

Comments
 (0)