From 97b03ecd53684a4f927056d588c4795e315c1a12 Mon Sep 17 00:00:00 2001 From: zhuolyang <34100047+zhuolyang@users.noreply.github.com> Date: Mon, 8 Jul 2019 10:28:11 +0800 Subject: [PATCH] Remove the COLOR_BGR2RGB of the input image The input image is reused COLOR_BGR2RGB, causing the network to not recognize the target --- image_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image_demo.py b/image_demo.py index c85356c01..82635cc9d 100644 --- a/image_demo.py +++ b/image_demo.py @@ -25,7 +25,6 @@ graph = tf.Graph() original_image = cv2.imread(image_path) -original_image = cv2.cvtColor(original_image, cv2.COLOR_BGR2RGB) original_image_size = original_image.shape[:2] image_data = utils.image_preporcess(np.copy(original_image), [input_size, input_size]) image_data = image_data[np.newaxis, ...] @@ -44,6 +43,7 @@ bboxes = utils.postprocess_boxes(pred_bbox, original_image_size, input_size, 0.3) bboxes = utils.nms(bboxes, 0.45, method='nms') +original_image = cv2.cvtColor(original_image, cv2.COLOR_BGR2RGB) image = utils.draw_bbox(original_image, bboxes) image = Image.fromarray(image) image.show()