intel / webml-polyfill

Deprecated, the Web Neural Network Polyfill project has been moved to https://github.com/webmachinelearning/webnn-polyfill
Apache License 2.0
160 stars 42 forks source link

[WebGL] The tests failed after align_corner was supported in RESIZE_BILINEAR #419

Closed Christywl closed 5 years ago

Christywl commented 5 years ago

Test Env: Chromium nightly build 70.0.3503.0 (8755e6b) Platform: Android/Mac/Windows/Linux

Expected Result: Tests should pass.

Actual Result: The tests failed after align_corner(https://github.com/intel/webml-polyfill/commit/b4fb43aeb474f2724c138c1ea308eefb2f5e255c) was supported in RESIZE_BILINEAR on WebGL backend.

Before: total 16, pass 16, fail 0
After: total 16, pass 4, fail 12

How to Reproduce:

  1. Launch Chromium and disable the WebML flag
  2. Visit https://brucedai.github.io/nt/test/resize_bilinear.html?backend=webgl
Christywl commented 5 years ago

The data on WebGL backend for with/out align corner:

Test Case expected results w/o align_corner w/align_corner
check result for Resize bilinear example [1.0, 1.0, 1.0, 1.666666667, 1.666666667, 1.666666667, 2.0, 2.0, 2.0] [1.0, 1.0, 1.0, 1.666666667, 1.666666667, 1.666666667, 2.0, 2.0, 2.0] [1, 1, 1, 1.5, 1.5, 1.5, 2, 2, 2]
check result for Resize bilinear example/2 [3, 4, 5, 8, 6, 10, 7, 8, 9, 12, 10, 14, 9, 10, 11, 14, 12, 16] [3, 4, 5, 8, 6, 10, 7, 8, 9, 12, 10, 14, 9, 10, 11, 14, 12, 16] [3, 4, 4.5, 7, 6, 10, 6, 7, 7.5, 10, 9, 13, 9, 10, 10.5, 13, 12, 16]
check result for Resize bilinear distorted example/1 [3, 4, 4.5, 7, 6, 10, 6, 10, 7, 8, 8.5, 11, 10, 14, 10, 14, 9, 10, 10.5, 13, 12, 16, 12, 16, 3, 4, 4.5, 7, 6, 10, 6, 10, 7, 8, 8.5, 11, 10, 14, 10, 14, 9, 10, 10.5, 13, 12, 16, 12, 16] [3, 4, 4.5, 7, 6, 10, 6, 10, 7, 8, 8.5, 11, 10, 14, 10, 14, 9, 10, 10.5, 13, 12, 16, 12, 16, 3, 4, 4.5, 7, 6, 10, 6, 10, 7, 8, 8.5, 11, 10, 14, 10, 14, 9, 10, 10.5, 13, 12, 16, 12, 16] [3, 4, 4, 6, 5, 8, 6, 10, 6, 7, 7, 9, 8, 11, 9, 13, 9, 10, 10, 12, 11, 14, 12, 16, 3, 4, 4, 6, 5, 8, 6, 10, 6, 7, 7, 9, 8, 11, 9, 13, 9, 10, 10, 12, 11, 14, 12, 16]
check result for Resize bilinear distorted example/2 [1, 3, 9, 11, 13, 15, 9, 11, 1, 3, 9, 11, 13, 15, 9, 11] [1, 3, 9, 11, 13, 15, 9, 11, 1, 3, 9, 11, 13, 15, 9, 11] [1, 3, 13, 15, 9, 11, 21, 23, 1, 3, 13, 15, 9, 11, 21, 23]
check result for Resize bilinear distorted example/3 [1, 3, 6.3333335, 8.333334, 11.666667, 13.666667,1, 3, 6.3333335, 8.333334, 11.666667, 13.666667,1, 3, 6.3333335, 8.333334, 11.666667, 13.666667,1, 3, 6.3333335, 8.333334, 11.666667, 13.666667,1, 3, 6.3333335, 8.333334, 11.666667, 13.666667,1, 3, 6.3333335, 8.333334, 11.666667, 13.666667] [1, 3, 6.3333335, 8.333334, 11.666667, 13.666667,1, 3, 6.3333335, 8.333334, 11.666667, 13.666667,1, 3, 6.3333335, 8.333334, 11.666667, 13.666667,1, 3, 6.3333335, 8.333334, 11.666667, 13.666667,1, 3, 6.3333335, 8.333334, 11.666667, 13.666667,1, 3, 6.3333335, 8.333334, 11.666667, 13.666667] [1, 3, 7, 9, 13, 15, 1, 3, 7, 9, 13, 15, 1, 3, 7, 9, 13, 15, 1, 3, 7, 9, 13, 15, 1, 3, 7, 9, 13, 15, 1, 3, 7, 9, 13, 15]
check result for Resize bilinear distorted example/4 [1, 3, 3.6666667, 5.666667, 5, 7, 6.333333, 8.333333, 9, 11, 10.333333, 12.333333, 6.333334, 8.333334, 9.000001, 11.000001, 10.333334, 12.333334, 1, 3, 3.6666667, 5.666667, 5, 7, 6.333333, 8.333333, 9, 11, 10.333333, 12.333333, 6.333334, 8.333334, 9.000001, 11.000001, 10.333334, 12.333334] [1, 3, 3.6666667, 5.666667, 5, 7, 6.333333, 8.333333, 9, 11, 10.333333, 12.333333, 6.333334, 8.333334, 9.000001, 11.000001, 10.333334, 12.333334, 1, 3, 3.6666667, 5.666667, 5, 7, 6.333333, 8.333333, 9, 11, 10.333333, 12.333333, 6.333334, 8.333334, 9.000001, 11.000001, 10.333334, 12.333334] [1, 3, 3, 5, 5, 7, 5, 7, 7, 9, 9, 11, 9, 11, 11, 13, 13, 15, 1, 3, 3, 5, 5, 7, 5, 7, 7, 9, 9, 11, 9, 11, 11, 13, 13, 15]
check result for Resize bilinear remain size example/1 [1, 1, 2, 2] [1, 1, 2, 2] [1, 1, 2, 2]
check result for Resize bilinear remain size example/2 [1, 1, 2, 2, 1, 1, 2, 2] [1, 1, 2, 2, 1, 1, 2, 2] [1, 1, 2, 2, 1, 1, 2, 2]
check result for Resize bilinear remain size example/3 [1, 1, 2, 2, 1, 1, 2, 2] [1, 1, 2, 2, 1, 1, 2, 2] [1, 1, 2, 2, 1, 1, 2, 2]
check result for Resize bilinear remain size example/4 [1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2] [1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2] [1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2]
check result for Resize bilinear zoom in example/1 [3, 3.6666667, 4, 5, 7, 8, 6, 8.6666667, 10, 9, 9.6666667, 10, 11, 13, 14, 12, 14.6666667, 16] [3, 3.6666667, 4, 5, 7, 8, 6, 8.6666667, 10, 9, 9.6666667, 10, 11, 13, 14, 12, 14.6666667, 16] [3, 3.5, 4, 4.5, 5.75, 7, 6, 8, 10, 9, 9.5, 10, 10.5, 11.75, 13, 12, 14, 16]
check result for Resize bilinear zoom in example/2 [3, 4, 5, 8, 6, 10, 7, 8, 9, 12, 10, 14, 9, 10, 11, 14, 12, 16, 3, 4, 5, 8, 6, 10, 7, 8, 9, 12, 10, 14, 9, 10, 11, 14, 12, 16] [3, 4, 5, 8, 6, 10, 7, 8, 9, 12, 10, 14, 9, 10, 11, 14, 12, 16, 3, 4, 5, 8, 6, 10, 7, 8, 9, 12, 10, 14, 9, 10, 11, 14, 12, 16] [3, 4, 4.5, 7, 6, 10, 6, 7, 7.5, 10, 9, 13, 9, 10, 10.5, 13, 12, 16, 3, 4, 4.5, 7, 6, 10, 6, 7, 7.5, 10, 9, 13, 9, 10, 10.5, 13, 12, 16]
check result for Resize bilinear zoom out example/1 [1, 4, 10, 13] [1, 4, 10, 13] [1, 5, 13, 17]
check result for Resize bilinear zoom out example/2 [1, 4, 10, 13, 1, 4, 10, 13] [1, 4, 10, 13, 1, 4, 10, 13] [1, 5, 13, 17, 1, 5, 13, 17]
check result for Resize bilinear zoom out example/3 [1, 3, 7, 9, 10, 12, 11.5, 9] [1, 3, 7, 9, 10, 12, 11.5, 9] [1, 3, 9, 11, 7, 9, 15, 17]
check result for Resize bilinear zoom out example/4 [1, 3, 7, 9, 10, 12, 11.5, 9, 1, 3, 7, 9, 10, 12, 11.5, 9] [1, 3, 7, 9, 10, 12, 11.5, 9, 1, 3, 7, 9, 10, 12, 11.5, 9] [1, 3, 9, 11, 7, 9, 15, 17, 1, 3, 9, 11, 7, 9, 15, 17]
Christywl commented 5 years ago

WASM and clDNN also enable align_corner, the data with align_corner is the same as WebGL.

pinzhenx commented 5 years ago

Closed via https://github.com/intel/webml-polyfill/pull/499