Resizing image with/without Detectron2 not giving equivalent results #3239
-
I'd like to transform images in a similar way to Detectron2, using only PIL and Numpy. However, the following is not giving me equivalent results. I've made a Colab to reproduce my issue.
When printing the PyTorch tensor and Numpy array, they are not the same. I wonder why this might be the case. It seems to have to do with resizing (before resizing, both are equivalent). However, resizing does not involve the color channels, so are PIL.resize and ResizeTransform different? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The default interpolation is different. Please see docs of https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.resize and https://detectron2.readthedocs.io/en/latest/modules/data_transforms.html#detectron2.data.transforms.ResizeTransform |
Beta Was this translation helpful? Give feedback.
The default interpolation is different. Please see docs of https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.resize and https://detectron2.readthedocs.io/en/latest/modules/data_transforms.html#detectron2.data.transforms.ResizeTransform