For now quickest to do it in numpy and use LibRaw/rawpy. Implement the other noise steps in torch, and leave option open to implement demosaicing in torch later, if that provides performance benefit.
We can't instantiate a rawpy object from a numpy array, so we need to keep the entire rawpy object around, or at least the reference to the file, so we can instantiate it again with the updated array
For now quickest to do it in numpy and use LibRaw/rawpy. Implement the other noise steps in torch, and leave option open to implement demosaicing in torch later, if that provides performance benefit. We can't instantiate a rawpy object from a numpy array, so we need to keep the entire rawpy object around, or at least the reference to the file, so we can instantiate it again with the updated array