fastai
fastai copied to clipboard
Saturation Calls a RGB Grayscale Conversion in Logit Space
The Saturation transform converts the input image to grayscale using RGB Luma 601-2 when the input image is already in logit space.
For an accurate conversion, the image would either need to be in RGB space or the grayscale
method modified to be in logit space.
class _SaturationLogit():
def __call__(self, x):
#interpolate between grayscale and original in-place
gs = grayscale(x)
gs.mul_(1-self.change[:,None,None,None])
x.mul_(self.change[:,None,None,None])
return x.add_(gs)