Skip to content
Snippets Groups Projects
Commit b4d25c13 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[libs.segmentation.engine.evaluator] Fix precision-recall estimates when precision and recall == 0

parent 6cd6ac63
No related branches found
No related tags found
1 merge request!46Create common library
......@@ -646,6 +646,11 @@ def run(
recall_curve = tpr_curve = numpy.array([recall(*k) for k in counts])
precision_curve = numpy.array([precision(*k) for k in counts])
# correction when precision is very small
precision_curve[
numpy.logical_and(precision_curve < 1e-8, recall_curve < 1e-8)
] = 1.0
# populates data to be recorded in JSON format
eval_json_data.setdefault(split_name, {})["counts"] = {
k: v for k, v in zip(threshold_list, counts)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment