From 7041206037e9867455c577e4a8c65b9f7af81a49 Mon Sep 17 00:00:00 2001 From: Miki Lombardi Date: Fri, 26 Apr 2024 08:00:15 +0000 Subject: [PATCH] fix: remove print --- ImageGoNord/GoNord.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ImageGoNord/GoNord.py b/ImageGoNord/GoNord.py index 3c47d90..d9ee8fa 100755 --- a/ImageGoNord/GoNord.py +++ b/ImageGoNord/GoNord.py @@ -19,7 +19,8 @@ import skimage.color as convertor import torchvision.transforms as transforms except ImportError: - print("Please install the dependencies required for the AI feature") + # AI feature disabled + pass try: @@ -38,7 +39,8 @@ try: from ImageGoNord.utility.model import FeatureEncoder,RecoloringDecoder except ImportError: - print("Please install the dependencies required for the AI feature") + # AI feature disabled + pass class NordPaletteFile: @@ -543,8 +545,11 @@ def convert_image(self, image, save_path='', use_model=False, use_model_cpu=Fals pixels = self.load_pixel_image(image) is_rgba = (image.mode == 'RGBA') - if use_model and torch != None: - image = self.convert_image_by_model(image, use_model_cpu) + if use_model: + if torch != None: + image = self.convert_image_by_model(image, use_model_cpu) + else: + print('Please install the dependencies required for the AI feature: pip install image-go-nord[AI]') else: if not parallel_threading: self.converted_loop(is_rgba, pixels, original_pixels, image.size[0], image.size[1])