I built an inference pipeline in opencv for one of my computer vision models. After I tested this pipeline I noticed some big differences in scoring compared to pytorch inference. I tracked the difference to the resize step. PIL and torchvision by default use downsampling algorithms with anti-aliasing, for opencv anti-aliased downsampling doesn’t seem to be possible. This only seems to be a big problem with models with a low resolution (my model is for 112x112), for larger resolutions the difference is a lot smaller.
I considered turning the anti-aliasing off in torchvision but this article (The dangers behind image resizing) indicates that it gives much better quality when downscaling the images. For now I’ll be turning anti-aliasing off. But now being able to use this in opencv means that for a lot of pretrained models inference will give wrong results.
So the question is, is anti-aliased downsampling possible? If not, is there a place I could add a feature request to add this?