Converter: fix for input images with ch > 3

This commit is contained in:
iperov 2019-03-28 11:12:19 +04:00
parent 3cf3bb786e
commit 689aefeb2f

View file

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