Skip to content

Commit 8752694

Browse files
committed
judge image size for using diff interpolation
1 parent 25f961b commit 8752694

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/train_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ def trim_and_resize_if_required(
23622362

23632363
if image_width != resized_size[0] or image_height != resized_size[1]:
23642364
# リサイズする
2365-
image = cv2.resize(image, resized_size, interpolation=cv2.INTER_AREA) # INTER_AREAでやりたいのでcv2でリサイズ
2365+
image = cv2.resize(image, resized_size, interpolation=cv2.INTER_AREA if image_width > resized_size[0] and image_height > resized_size[1] else cv2.INTER_LANCZOS4)
23662366

23672367
image_height, image_width = image.shape[0:2]
23682368

0 commit comments

Comments
 (0)