Fix wrong use of copyMakeBorder (#883)

Co-authored-by: lwjustsoso <351048599@qq.com>
This commit is contained in:
LW-SCU 2022-01-28 11:34:59 +08:00 committed by GitHub
parent f2ac76df5a
commit c2a07ff7ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]