Fix numpy exception handling

This commit is contained in:
ccarrizosa 2024-11-09 22:35:11 +01:00
parent 3744709c97
commit 68351d2224

View File

@ -242,7 +242,7 @@ def format_single_result(
) )
class_name = class_names[np.argmax(class_overall)] class_name = class_names[np.argmax(class_overall)]
annotations = get_annotations_from_preds(predictions, class_names) annotations = get_annotations_from_preds(predictions, class_names)
except (np.AxisError, ValueError): except (np.exceptions.AxisError, ValueError):
# No detections # No detections
class_overall = np.zeros(len(class_names)) class_overall = np.zeros(len(class_names))
class_name = "None" class_name = "None"