From 58fea8db69a1b0e9ac4b78b924b176ea912e3cc9 Mon Sep 17 00:00:00 2001 From: Xintao Date: Mon, 9 Aug 2021 01:14:54 +0800 Subject: [PATCH] use warnings --- inference_realesrgan.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inference_realesrgan.py b/inference_realesrgan.py index af89b14..207eb83 100644 --- a/inference_realesrgan.py +++ b/inference_realesrgan.py @@ -54,9 +54,11 @@ def main(): img = cv2.imread(path, cv2.IMREAD_UNCHANGED) h, w = img.shape[0:2] if max(h, w) > 1000 and args.netscale == 4: - print('WARNING: The input image is large, try X2 model for better performace.') + import warnings + warnings.warn('The input image is large, try X2 model for better performace.') if max(h, w) < 500 and args.netscale == 2: - print('WARNING: The input image is small, try X4 model for better performace.') + import warnings + warnings.warn('The input image is small, try X4 model for better performace.') try: output, img_mode = upsampler.enhance(img, outscale=args.outscale)