Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Segmentation metrics fail with empty annotations #36

Open
hbredin opened this issue Nov 25, 2019 · 0 comments
Open

Segmentation metrics fail with empty annotations #36

hbredin opened this issue Nov 25, 2019 · 0 comments

Comments

@hbredin
Copy link
Member

hbredin commented Nov 25, 2019

Description

Segmentation metrics fail with empty annotations.

Steps/Code to Reproduce

from pyannote.core import Annotation, Segment
reference = Annotation()
hypothesis = Annotation()

from pyannote.metrics.diarization import SegmentationPurity
purity = SegmentationPurity()
purity(reference, hypothesis)
ZeroDivisionError: float division by zero
from pyannote.metrics.diarization import SegmentationCoverage
coverage = SegmentationCoverage()
coverage(reference, hypothesis)
ValueError: zero-size array to reduction operation maximum which has no identity
from pyannote.metrics.diarization import SegmentationPurityCoverageFMeasure
both = SegmentationPurityCoverageFMeasure()
both(reference, hypothesis)
ValueError: zero-size array to reduction operation maximum which has no identity

Expected Results

It does not really make sense to compute segmentation purity and coverage on empty files but I guess a more explicite message should be raised.

Versions

pyannote.core==3.0
pyannote.database==2.3.1
pyannote.metrics==2.1
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant