def illumintaion_augmentation_generator(generator, white_rgb): warn("using deprecated generator brightness_augmentation_by_multiplication_generator", Warning) '''This generator implements illumination color augmentation. The idea here is that we can estimate the illumination of all training samples and then transfer that to other training samples, thereby augmenting the data. In order for this to work properly, your images have to be on the range of [0, 255] and they must be natural images (meaning for instance that one of the color channels does not exploit the whole range of [0, 255]. This technique does not work properly with images that have to be manually rescaled to this range (such as MRI images) due to the way the color constancy method works. white_rgb: list of illuminations to choose from for the augmentation. Can be generated using the white_colors returned by utils.general_cc_var_num_channels''' for data_dict in generator: data_dict['data'] = augment_illumination(data_dict['data'], white_rgb) yield data_dict
def __call__(self, **data_dict): data_dict[self.data_key] = augment_illumination( data_dict[self.data_key], self.white_rgb) return data_dict
def __call__(self, **data_dict): data_dict[self.data_key] = augment_illumination(data_dict[self.data_key], self.white_rgb) return data_dict