From b8d623596e1c01a1049a0ba2eb5be2f6bf8ba1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Bredin?= Date: Fri, 2 Oct 2020 12:23:40 +0200 Subject: [PATCH] fix: add support for when "annotation" key exists but is None --- pyannote/audio/applications/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyannote/audio/applications/base.py b/pyannote/audio/applications/base.py index bc47ddb0..0def6439 100644 --- a/pyannote/audio/applications/base.py +++ b/pyannote/audio/applications/base.py @@ -628,14 +628,14 @@ def apply_pretrained( pipeline.write_rttm(fp, hypothesis) # compute evaluation metric (when possible) - if "annotation" not in current_file: + reference = current_file.get("annotation", None) + if reference is None: metric = None # compute evaluation metric (when available) if metric is None: continue - reference = current_file["annotation"] uem = get_annotated(current_file) _ = metric(reference, hypothesis, uem=uem)