From f780ce7d2189d82528f7ad7c9a1055feac3d1f4b Mon Sep 17 00:00:00 2001 From: yolanda <564087945@qq.com> Date: Wed, 18 Dec 2019 17:24:59 +0800 Subject: [PATCH] the number in detection_details must be greater than or equal to 0 --- imageai/Detection/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imageai/Detection/__init__.py b/imageai/Detection/__init__.py index a31f7dc6..03a6843b 100644 --- a/imageai/Detection/__init__.py +++ b/imageai/Detection/__init__.py @@ -368,6 +368,7 @@ def detectObjectsFromImage(self, input_image="", output_image_path="", input_typ color = label_color(label) detection_details = detections[0, index, :4].astype(int) + detection_details = np.maximum(detection_details, 0) draw_box(detected_copy, detection_details, color=color) if (display_object_name == True and display_percentage_probability == True): @@ -743,6 +744,7 @@ def detectCustomObjectsFromImage(self, custom_objects=None, input_image="", outp color = label_color(label) detection_details = detections[0, index, :4].astype(int) + detection_details = np.maximum(detection_details, 0) draw_box(detected_copy, detection_details, color=color) if (display_object_name == True and display_percentage_probability == True):