Denoising an image

How would you denoise an image prior to multi-classification problem similar to this in opencv: https://docs.opencv.org/3.4/d1/d79/group__photo__denoise.html#ga4c6b0031f56ea3f98f768881279ffe93

I know I can do this offline and save the images, I’m asking how it can be done as part of the pipeline?

You would create a transform something like this.

Here you have a nice tuto on how to create your own Transform

Thanks all for the help, i added opencv but it slowed down my training by a lot. Now I found this interesting project https://github.com/cgnorthcutt/cleanlab will try to see if it works with fastai, i assume it will since the model is a pytorch.