From 662844bb8fda856a6a9e9bc01163d90478c70a4a Mon Sep 17 00:00:00 2001 From: junl Date: Sat, 20 Jun 2020 16:36:12 +0800 Subject: [PATCH] modify minor bug when reading the image --- caffe/ultra_face_opencvdnn_inference.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/caffe/ultra_face_opencvdnn_inference.py b/caffe/ultra_face_opencvdnn_inference.py index 475c30a..ca991c1 100644 --- a/caffe/ultra_face_opencvdnn_inference.py +++ b/caffe/ultra_face_opencvdnn_inference.py @@ -161,7 +161,8 @@ def inference(): img_ori = cv2.imread(img_path) rect = cv2.resize(img_ori, (witdh, height)) rect = cv2.cvtColor(rect, cv2.COLOR_BGR2RGB) - net.setInput(dnn.blobFromImage(rect, 1 / image_std, (witdh, height), 127)) + net.setInput(dnn.blobFromImage(rect, 1 / image_std, (witdh, height), + (127, 127, 127))) time_time = time.time() boxes, scores = net.forward(["boxes", "scores"]) print("inference time: {} s".format(round(time.time() - time_time, 4)))