From 7e24187aadc5dcc47bdcb886c5db86d9908202bb Mon Sep 17 00:00:00 2001 From: PowerHouseMan Date: Mon, 5 Aug 2024 15:23:50 +0900 Subject: [PATCH] Update nodes.py --- nodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index 6598588..2d20284 100644 --- a/nodes.py +++ b/nodes.py @@ -313,7 +313,9 @@ class LP_Engine: h, w = img.shape[:2] input_shape = [256,256] if h != input_shape[0] or w != input_shape[1]: - x = cv2.resize(img, (input_shape[0], input_shape[1]), interpolation = cv2.INTER_LINEAR) + if 256 < h: interpolation = cv2.INTER_AREA + else: interpolation = cv2.INTER_LINEAR + x = cv2.resize(img, (input_shape[0], input_shape[1]), interpolation = interpolation) else: x = img.copy()