Trying to create custom transforms in Fastai, I have encountered serious difficulties. My transforms are meant to change pixel values, not their position I.e solarize, posterize, etc. I used PIL.ImageOps and torch.transforms and I wrapped the basic function in tfmLighting. The results were nonsensical. Tracking the code within Fastai, I found that tfmLighting modifies the original Image tensor by applying the Logit function; therefore, all calculations involving PIL and torch transforms give incorrect results. I have the following questions:
- What is the rationale for modifying the original image tensor with Logit in tfmLighting and yet leaving the tensor unmodified when wrapped in tfmPixel?
- Would mixing modified and unmodified tensors introduce instability during training?
- Can I wrap my pixel-changing transforms in tfmPixel instead of tfmLightning. If I can’t, the only solution to the problem is to apply Inverse Logit at the beginning of the transform and then apply Logit at the end.