pytorch: 1.9.0
skimage: 0.18.3
opencv: 4.5.3
scipy: 1.7.1
Pillow: 8.3.2
TensorFlow: 2.6.0
------ Check resize op ------
- check output size: 2 <- 32
Error: PyTorch result is different from Scikit-image result. MAE: 86.83333587646484
PTH: [153. 241.]
SkI: [193. 77.]
Error: PyTorch result is different from Pillow result. MAE: 86.83333333333333
PTH: [153. 241.]
PIL: [193. 77.]
PyTorch result matches OpenCV INTER_NEAREST result.
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 88.41666412353516
Error: PyTorch result is different from TF result. MAE: 86.83333587646484
- check output size: 10 <- 32
Error: PyTorch result is different from Scikit-image result. MAE: 88.75
PTH: [153. 40. 254. 246. 159. 241. 10. 47. 131. 234.]
SkI: [145. 252. 227. 5. 228. 106. 64. 10. 1. 52.]
Error: PyTorch result is different from Pillow result. MAE: 89.29666666666667
PTH: [153. 40. 254. 246. 159. 241. 10. 47. 131. 234.]
PIL: [145. 252. 227. 5. 228. 106. 64. 244. 1. 52.]
PyTorch result matches OpenCV INTER_NEAREST result.
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 87.66999816894531
Error: PyTorch result is different from TF result. MAE: 88.75
- check output size: 16 <- 32
Error: PyTorch result is different from Scikit-image result. MAE: 88.90885162353516
PTH: [153. 181. 65. 254. 59. 63. 159. 52. 241. 86.]
SkI: [145. 8. 252. 17. 35. 5. 59. 111. 106. 206.]
Error: PyTorch result is different from Pillow result. MAE: 88.90885416666667
PTH: [153. 181. 65. 254. 59. 63. 159. 52. 241. 86.]
PIL: [145. 8. 252. 17. 35. 5. 59. 111. 106. 206.]
PyTorch result matches OpenCV INTER_NEAREST result.
PyTorch result matches OpenCV INTER_NEAREST_EXACT result.
Error: PyTorch result is different from TF result. MAE: 88.90885162353516
- check output size: 20 <- 32
Error: PyTorch result is different from Scikit-image result. MAE: 82.72333526611328
PTH: [153. 248. 40. 65. 254. 59. 246. 154. 159. 52.]
SkI: [153. 181. 65. 93. 187. 59. 63. 159. 36. 32.]
Error: PyTorch result is different from Pillow result. MAE: 81.44833333333334
PTH: [153. 248. 40. 65. 254. 59. 246. 154. 159. 52.]
PIL: [153. 181. 65. 93. 187. 59. 63. 154. 36. 32.]
PyTorch result matches OpenCV INTER_NEAREST result.
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 82.72333526611328
Error: PyTorch result is different from TF result. MAE: 82.72333526611328
- check output size: 24 <- 32
Error: PyTorch result is different from Scikit-image result. MAE: 74.85821533203125
PTH: [153. 248. 181. 65. 93. 254. 59. 246. 63. 159.]
SkI: [153. 181. 40. 65. 254. 187. 59. 63. 154. 159.]
Error: PyTorch result is different from Pillow result. MAE: 62.88483796296296
PTH: [153. 248. 181. 65. 93. 254. 59. 246. 63. 159.]
PIL: [153. 181. 40. 65. 93. 187. 59. 63. 154. 159.]
PyTorch result matches OpenCV INTER_NEAREST result.
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 45.02430725097656
Error: PyTorch result is different from TF result. MAE: 74.85821533203125
- check output size: 30 <- 32
Error: PyTorch result is different from Scikit-image result. MAE: 66.76629638671875
PTH: [153. 248. 181. 40. 65. 93. 254. 187. 59. 246.]
SkI: [153. 248. 181. 40. 65. 93. 254. 59. 246. 63.]
Error: PyTorch result is different from Pillow result. MAE: 60.63851851851852
PTH: [153. 248. 181. 40. 65. 93. 254. 187. 59. 246.]
PIL: [153. 248. 181. 40. 65. 93. 254. 187. 246. 63.]
PyTorch result matches OpenCV INTER_NEAREST result.
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 60.638519287109375
Error: PyTorch result is different from TF result. MAE: 66.76629638671875
- check output size: 32 <- 32
PyTorch result matches Scikit-image result.
PyTorch result matches Pillow result.
PyTorch result matches OpenCV INTER_NEAREST result.
PyTorch result matches OpenCV INTER_NEAREST_EXACT result.
PyTorch result matches TF result.
- check output size: 36 <- 32
Error: PyTorch result is different from Scikit-image result. MAE: 59.06301498413086
PTH: [153. 153. 248. 181. 40. 65. 93. 254. 187. 59.]
SkI: [153. 248. 181. 40. 65. 65. 93. 254. 187. 59.]
Error: PyTorch result is different from Pillow result. MAE: 59.06301440329218
PTH: [153. 153. 248. 181. 40. 65. 93. 254. 187. 59.]
PIL: [153. 248. 181. 40. 65. 65. 93. 254. 187. 59.]
PyTorch result matches OpenCV INTER_NEAREST result.
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 47.17155456542969
Error: PyTorch result is different from TF result. MAE: 59.06301498413086
- check output size: 40 <- 32
Error: PyTorch result is different from Scikit-image result. MAE: 55.266666412353516
PTH: [153. 153. 248. 181. 40. 65. 65. 93. 254. 187.]
SkI: [153. 248. 181. 181. 40. 65. 93. 254. 254. 187.]
Error: PyTorch result is different from Pillow result. MAE: 52.56166666666667
PTH: [153. 153. 248. 181. 40. 65. 65. 93. 254. 187.]
PIL: [153. 248. 181. 181. 40. 65. 93. 93. 254. 187.]
PyTorch result matches OpenCV INTER_NEAREST result.
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 52.80479049682617
Error: PyTorch result is different from TF result. MAE: 55.266666412353516
- check output size: 42 <- 32
Error: PyTorch result is different from Scikit-image result. MAE: 52.50944900512695
PTH: [153. 153. 248. 181. 40. 40. 65. 93. 254. 254.]
SkI: [153. 248. 248. 181. 40. 65. 65. 93. 254. 187.]
Error: PyTorch result is different from Pillow result. MAE: 49.97392290249433
PTH: [153. 153. 248. 181. 40. 40. 65. 93. 254. 254.]
PIL: [153. 248. 248. 181. 40. 65. 65. 93. 254. 187.]
PyTorch result matches OpenCV INTER_NEAREST result.
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 47.168556213378906
Error: PyTorch result is different from TF result. MAE: 52.50944900512695
- check output size: 64 <- 32
PyTorch result matches Scikit-image result.
PyTorch result matches Pillow result.
PyTorch result matches OpenCV INTER_NEAREST result.
PyTorch result matches OpenCV INTER_NEAREST_EXACT result.
PyTorch result matches TF result.
- check output size: 72 <- 32
Error: PyTorch result is different from Scikit-image result. MAE: 34.035430908203125
PTH: [153. 153. 153. 248. 248. 181. 181. 40. 40. 65.]
SkI: [153. 153. 248. 248. 181. 181. 181. 40. 40. 65.]
Error: PyTorch result is different from Pillow result. MAE: 28.26999742798354
PTH: [153. 153. 153. 248. 248. 181. 181. 40. 40. 65.]
PIL: [153. 153. 248. 248. 181. 181. 181. 40. 40. 65.]
PyTorch result matches OpenCV INTER_NEAREST result.
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 18.03382110595703
Error: PyTorch result is different from TF result. MAE: 34.035430908203125
--> 0 of OpenCV INTER_NEAREST result mismatches
--> 9 of OpenCV INTER_NEAREST_EXACT result mismatches
--> 10 of Scikit-Image result mismatches
--> 10 of Pillow result mismatches
--> 10 of TensorFlow result mismatches
------ Check rescale op ------
recompute_scale_factor: True
- check scale_factor=0.1234
Error: different shapes: opencv (4, 4), (4, 4) vs sk-img (4, 4) vs scipy (4, 4) vs pth (3, 3)
- check scale_factor=0.5
Error: PyTorch result is different from Scikit-image result. MAE: 88.90885162353516
Error: PyTorch result is different from Scipy result. MAE: 88.90885162353516
PyTorch result matches OpenCV result.
PyTorch result matches OpenCV INTER_NEAREST_EXACT result.
- check scale_factor=0.6
Error: PyTorch result is different from Scikit-image result. MAE: 83.61126708984375
Error: PyTorch result is different from Scipy result. MAE: 83.61126708984375
PyTorch result matches OpenCV result.
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 81.30101776123047
- check scale_factor=0.7
Error: PyTorch result is different from Scikit-image result. MAE: 78.77823638916016
Error: PyTorch result is different from Scipy result. MAE: 78.77823638916016
Error: PyTorch result is different from OpenCV result. MAE: 34.127410888671875
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 73.97933959960938
- check scale_factor=0.9999
Error: different shapes: opencv (32, 32), (32, 32) vs sk-img (32, 32) vs scipy (32, 32) vs pth (31, 31)
- check scale_factor=1.0
PyTorch result matches Scikit-image result.
PyTorch result matches Scipy result.
PyTorch result matches OpenCV result.
PyTorch result matches OpenCV INTER_NEAREST_EXACT result.
- check scale_factor=1.00001
PyTorch result matches Scikit-image result.
PyTorch result matches Scipy result.
PyTorch result matches OpenCV result.
PyTorch result matches OpenCV INTER_NEAREST_EXACT result.
- check scale_factor=1.3
Error: different shapes: opencv (42, 42), (42, 42) vs sk-img (42, 42) vs scipy (42, 42) vs pth (41, 41)
- check scale_factor=1.71
Error: different shapes: opencv (55, 55), (55, 55) vs sk-img (55, 55) vs scipy (55, 55) vs pth (54, 54)
- check scale_factor=1.8
Error: different shapes: opencv (58, 58), (58, 58) vs sk-img (58, 58) vs scipy (58, 58) vs pth (57, 57)
- check scale_factor=1.9999
Error: different shapes: opencv (64, 64), (64, 64) vs sk-img (64, 64) vs scipy (64, 64) vs pth (63, 63)
- check scale_factor=2.0
PyTorch result matches Scikit-image result.
PyTorch result matches Scipy result.
PyTorch result matches OpenCV result.
PyTorch result matches OpenCV INTER_NEAREST_EXACT result.
- check scale_factor=2.3
Error: different shapes: opencv (74, 74), (74, 74) vs sk-img (74, 74) vs scipy (74, 74) vs pth (73, 73)
- check scale_factor=2.72
Error: PyTorch result is different from Scikit-image result. MAE: 28.029813766479492
Error: PyTorch result is different from Scipy result. MAE: 28.029813766479492
Error: PyTorch result is different from OpenCV result. MAE: 1.807196021080017
Error: PyTorch result is different from OpenCV INTER_NEAREST_EXACT result. MAE: 26.52005958557129
- check scale_factor=2.9999
Error: different shapes: opencv (96, 96), (96, 96) vs sk-img (96, 96) vs scipy (96, 96) vs pth (95, 95)
- check scale_factor=3.0
PyTorch result matches Scikit-image result.
PyTorch result matches Scipy result.
PyTorch result matches OpenCV result.
PyTorch result matches OpenCV INTER_NEAREST_EXACT result.
- check scale_factor=3.000001
PyTorch result matches Scikit-image result.
PyTorch result matches Scipy result.
Error: PyTorch result is different from OpenCV result. MAE: 45.80577087402344
PyTorch result matches OpenCV INTER_NEAREST_EXACT result.
- check scale_factor=3.34
Error: different shapes: opencv (107, 107), (107, 107) vs sk-img (107, 107) vs scipy (107, 107) vs pth (106, 106)
- check scale_factor=3.6789
Error: different shapes: opencv (118, 118), (118, 118) vs sk-img (118, 118) vs scipy (118, 118) vs pth (117, 117)
--> 10 of size mismatches
--> 3 of OpenCV INTER_NEAREST result mismatches
--> 3 of OpenCV INTER_NEAREST_EXACT result mismatches
--> 4 of Scikit-Image result mismatches
--> 4 of Scipy result mismatches
PyTorch code: https://github.com/Quansight/pytorch/pull/new/vfdev-5/fix-nearest-upsampling PR: pytorch/pytorch#64501