yuanming-hu / exposure

Learning infinite-resolution image processing with GAN and RL from unpaired image datasets, using a differentiable photo editing model.
MIT License
767 stars 156 forks source link

Differentiable hsv to rgb #29

Closed sjmoran closed 6 years ago

sjmoran commented 6 years ago

Hi, thank you for your great work and for making the code available. I notice you use the Tensorflow hsv_to_rbg and rgb_to_hsv functions (class SaturationPlusFilter(Filter)) for adjusting the saturation of the images. However, function hsv_to_rgb does not appear differentiable due to the rounding function. How do you deal with this in your method?

yuanming-hu commented 6 years ago

Hi,

Sorry for the delayed reply. We don't actually need that to be differentiable - the output is a linear interpolation between the input and a fully saturated image - and we only need it to be differentiable w.r.t. the interpolation coefficient. (https://github.com/yuanming-hu/exposure/blob/master/filters.py#L498)