onnxruntime/js/web/lib/onnxjs/backends/webgl/ops
Seungwon Jeong 307ad1413a
[js/web] support 'pytorch_half_pixel' mode for WebGL kernel 'Resize' (#11208)
**Description**: 
1. add pytorch_half_pixel interpolation mode in resize-packed.ts
Changes: add the following case in createPackedResizeProgramInfo
function:
```
case 'pytorch_half_pixel':
          getSourceFracIndex = `
                    vec4 getSourceFracIndex(ivec4 coords) {
                        vec4 fcoords = vec4(coords);
                        return vec4(
                            ${outputWidth}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,
                            ${outputHeight}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,
                            ${outputWidth}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,
                            ${outputHeight}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0
                          );
                    }
                `;
          break;
```
2. fix "unrecognized input '' for node: Resize_$num" error when inputs
like [input_tensor, None, scale_factor] (roiInput not given) are fed
into the resize layer.
Changes: change in input handling logic in upsample.ts & node scanning
logic in graph.ts

**Motivation and Context**
Before this fix, we aren't able to use webGL backend when the neural
network contains pytorch resize layers. This fix adds
'pytorch_half_pixel' interpolation mode support and makes it possible to
use webGL backend for more kind of computer vision networks.

This commit solves:
#10430

Co-authored-by: neo <neo@icode-lab.com>
Co-authored-by: Yulong Wang <7679871+fs-eire@users.noreply.github.com>
2022-11-21 12:03:48 -08:00
..
batch-normalization.ts
binary-op.ts
cast.ts [js/web] Support opset-13 for squeeze, unsqueeze, maxpool, pad, cast and clip (#9249) 2021-10-14 16:29:37 -07:00
concat-packed.ts [js] upgrade async@3.2.3 /js/ (#11421) 2022-05-03 23:41:36 -07:00
concat.ts
conv-grouped.ts [js/web] add ConvTranspose2D to WebGL backend (#11990) 2022-07-27 13:57:12 -07:00
conv-pack.ts [js] upgrade async@3.2.3 /js/ (#11421) 2022-05-03 23:41:36 -07:00
conv-transpose.ts replace 'master' branch ref to 'main' for onnx repo (#12678) 2022-08-30 13:41:42 -07:00
conv.ts replace 'master' branch ref to 'main' for onnx repo (#12678) 2022-08-30 13:41:42 -07:00
depth-to-space.ts
dot-product.ts [js/web] add ConvTranspose2D to WebGL backend (#11990) 2022-07-27 13:57:12 -07:00
flatten.ts
fuse-utils.ts [js/web] add ConvTranspose2D to WebGL backend (#11990) 2022-07-27 13:57:12 -07:00
gather.ts
gemm.ts
im2col-pack.ts [js] upgrade async@3.2.3 /js/ (#11421) 2022-05-03 23:41:36 -07:00
im2col.ts [js] upgrade async@3.2.3 /js/ (#11421) 2022-05-03 23:41:36 -07:00
image-scaler.ts
instance-normalization.ts
matmul-pack.ts [js/web] add ConvTranspose2D to WebGL backend (#11990) 2022-07-27 13:57:12 -07:00
matmul.ts [js/web] add ConvTranspose2D to WebGL backend (#11990) 2022-07-27 13:57:12 -07:00
pack.ts
packing-utils.ts
pad.ts [js/web] Support opset-13 for squeeze, unsqueeze, maxpool, pad, cast and clip (#9249) 2021-10-14 16:29:37 -07:00
pool.ts [js/web] Support opset-13 for squeeze, unsqueeze, maxpool, pad, cast and clip (#9249) 2021-10-14 16:29:37 -07:00
reduce.ts
reshape-packed.ts
reshape.ts
resize-packed.ts [js/web] support 'pytorch_half_pixel' mode for WebGL kernel 'Resize' (#11208) 2022-11-21 12:03:48 -08:00
shape.ts
slice.ts
softmax.ts replace 'master' branch ref to 'main' for onnx repo (#12678) 2022-08-30 13:41:42 -07:00
split.ts
squeeze.ts [js/web] Support opset-13 for squeeze, unsqueeze, maxpool, pad, cast and clip (#9249) 2021-10-14 16:29:37 -07:00
sum.ts
tile.ts
transpose.ts
uint8-encode.ts
unary-op.ts [js/web] Support opset-13 for squeeze, unsqueeze, maxpool, pad, cast and clip (#9249) 2021-10-14 16:29:37 -07:00
unpack.ts [js] upgrade async@3.2.3 /js/ (#11421) 2022-05-03 23:41:36 -07:00
unsqueeze.ts [js/web] Support opset-13 for squeeze, unsqueeze, maxpool, pad, cast and clip (#9249) 2021-10-14 16:29:37 -07:00
upsample.ts [js/web] support 'pytorch_half_pixel' mode for WebGL kernel 'Resize' (#11208) 2022-11-21 12:03:48 -08:00