From 238ea3bd8ef59da890646c9b1581145b8d937d85 Mon Sep 17 00:00:00 2001 From: vahidrezanezhad Date: Thu, 14 Nov 2024 16:26:19 +0100 Subject: [PATCH] update resizing in inference --- train/inference.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/train/inference.py b/train/inference.py index 8d0a572..2b12ff7 100644 --- a/train/inference.py +++ b/train/inference.py @@ -442,10 +442,11 @@ class sbb_predict: self.img_org = np.copy(img) if img.shape[0] < self.img_height: - img = cv2.resize(img, (img.shape[1], self.img_width), interpolation=cv2.INTER_NEAREST) + img = self.resize_image(img, self.img_height, img.shape[1]) if img.shape[1] < self.img_width: - img = cv2.resize(img, (self.img_height, img.shape[0]), interpolation=cv2.INTER_NEAREST) + img = self.resize_image(img, img.shape[0], self.img_width) + margin = int(0.1 * self.img_width) width_mid = self.img_width - 2 * margin height_mid = self.img_height - 2 * margin