Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Different channel shift values at different image channels #18

Closed
wants to merge 1 commit into from

Conversation

zhenglilei
Copy link

The channel shift values for different image channels can be different. So it is incorrect to do a one-time randomization before calling the "apply_channel_shift" function. The changes are made according to the codes in the previous version, Keras 2.1.6, i.e., randomization is done for each channel of an image.

channel_images = [ np.clip(x_channel + np.random.uniform(-intensity, intensity), min_x, max_x) for x_channel in x]

A reference for using channel shift in data augmentation: https://github.com/JustinhoCHN/keras-image-data-augmentation#8-channel_shift_range

The channel shift values for different image channels can be different. So it is incorrect to do a one-time randomization before calling the "apply_channel_shift" function. The changes are made according to the codes in the previous version, Keras 2.1.6.
@Dref360
Copy link
Contributor

Dref360 commented Jun 23, 2018

The point of apply_channel_shift is to be deterministic.

@Dref360 Dref360 added the invalid This doesn't seem right label Jun 26, 2018
@Dref360 Dref360 closed this Jun 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants