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])