Issue: DeepLabV3 contains Resize node in ONNX model and ResizeBilinear in TFLite model. It's corresponding op in WebNN is Resample2d. Resize node contains coordinate_transformation_mode=align_corners, ResizeBilinear node contains align_corners=true and half_pixel_centers=false. While WebNN doesn't support such coordinate transformation modes and its default behavior equals to align_corners=false and half_pixel_centers=true.
Compares all the behaviors in different backends and frameworks as follows:
Note: DML backend can support these modes by calculating its InputPixelOffsets and outputPixelOffsets members.
You can refer to its implementation in ONNXRumtime DML backend.
Open: Can we support these coordinate transformation modes in WebNN? At least for asymmetric, half_pixel_centers and align_corners. Or maybe we could refer to DML by defining InputPixelOffsets and outputPixelOffsets options in Resample2d to implement various coordinate transformation modes.
Issue: DeepLabV3 contains
Resizenode in ONNX model andResizeBilinearin TFLite model. It's corresponding op in WebNN isResample2d.Resizenode containscoordinate_transformation_mode=align_corners,ResizeBilinearnode containsalign_corners=trueandhalf_pixel_centers=false. While WebNN doesn't support such coordinate transformation modes and its default behavior equals toalign_corners=falseandhalf_pixel_centers=true.Compares all the behaviors in different backends and frameworks as follows:
Note: DML backend can support these modes by calculating its
InputPixelOffsetsandoutputPixelOffsetsmembers.You can refer to its implementation in ONNXRumtime DML backend.
Open: Can we support these coordinate transformation modes in WebNN? At least for
asymmetric,half_pixel_centersandalign_corners. Or maybe we could refer to DML by definingInputPixelOffsetsandoutputPixelOffsetsoptions inResample2dto implement various coordinate transformation modes.