I need to enlarge multi-channel images and would like to use ImageDataGenerator Unfortunately, it only supports 1.3 and 4-channel images, and I need much more. Would it be ok to directly edit the site packages / Keras / preprocessing / image.py, adding the required number of channels?
if x.shape[self.channel_axis] not in {1, 3, 4, XXX}: raise ValueError( 'Expected input to be images (as Numpy array) ' 'following the dimension ordering convention "' + self.dim_ordering + '" ' '(channels on axis ' + str(self.channel_axis) + '), ie expected ' 'either 1, 3 or 4 channels on axis ' + str(self.channel_axis) + '. ' 'However, it was passed an array with shape ' + str(x.shape) + ' (' + str(x.shape[self.channel_axis]) + ' channels).')
where XXX is the number of channels I need. Does it break anything? Thanks!
source share