From c2a07ff7ac0b02c3c294ce79d7762c1419a16149 Mon Sep 17 00:00:00 2001 From: LW-SCU <28128257+LW-SCU@users.noreply.github.com> Date: Fri, 28 Jan 2022 11:34:59 +0800 Subject: [PATCH] Fix wrong use of copyMakeBorder (#883) Co-authored-by: lwjustsoso <351048599@qq.com> --- yolov5/yolov5_trt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yolov5/yolov5_trt.py b/yolov5/yolov5_trt.py index 2f655f1..b2b03d9 100644 --- a/yolov5/yolov5_trt.py +++ b/yolov5/yolov5_trt.py @@ -233,7 +233,7 @@ class YoLov5TRT(object): image = cv2.resize(image, (tw, th)) # Pad the short side with (128,128,128) image = cv2.copyMakeBorder( - image, ty1, ty2, tx1, tx2, cv2.BORDER_CONSTANT, (128, 128, 128) + image, ty1, ty2, tx1, tx2, cv2.BORDER_CONSTANT, None, (128, 128, 128) ) image = image.astype(np.float32) # Normalize to [0,1]