From 689aefeb2f6b15e1b8afa83ac0e1276f31f38fe2 Mon Sep 17 00:00:00 2001 From: iperov Date: Thu, 28 Mar 2019 11:12:19 +0400 Subject: [PATCH] Converter: fix for input images with ch > 3 --- mainscripts/Converter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mainscripts/Converter.py b/mainscripts/Converter.py index e7cb231..7d035db 100644 --- a/mainscripts/Converter.py +++ b/mainscripts/Converter.py @@ -62,6 +62,9 @@ class ConvertSubprocessor(Subprocessor): cv2_imwrite ( str(output_filename_path), image ) else: image = (cv2_imread(str(filename_path)) / 255.0).astype(np.float32) + h,w,c = image.shape + if c > 3: + image = image[...,0:3] if self.converter.type == Converter.TYPE_IMAGE: image = self.converter.convert_image(image, None, self.debug)