Skip to content

feat(pnnx): relax F_interpolate_onnx Resize pattern matching#6651

Open
kalcohol wants to merge 1 commit intoTencent:masterfrom
kalcohol:feat/onnx-resize-interpolate
Open

feat(pnnx): relax F_interpolate_onnx Resize pattern matching#6651
kalcohol wants to merge 1 commit intoTencent:masterfrom
kalcohol:feat/onnx-resize-interpolate

Conversation

@kalcohol
Copy link
Copy Markdown
Contributor

@kalcohol kalcohol commented Apr 6, 2026

F_interpolate_onnx and F_interpolate_onnx_dynamic rejected Resize nodes with non-empty ROI or nearest_mode=round_prefer_floor, which are common in opset 11-13 ONNX models from Caffe2ONNX, ncnn caffe2onnx, etc.

Accept:

  • Non-empty identity ROI [1,1,...,1] (fused by fuse_constant_as_attribute)
  • nearest_mode round_prefer_floor (maps to ncnn nearest default behavior)

Verified on 5 models:

  • picodet_l_640_coco.sim
  • pp_human_seg_mobile_sim
  • 59_crop_512128_opset11
  • opset13_fromcaffe (Resize part, ArgMax separate)
  • deeplabv3.sim.fix (Resize part, ArgMax separate)

Co-developed with GLM-5-Turbo (ZhipuAI API, annual max subscription), orchestrated via OpenCode

F_interpolate_onnx and F_interpolate_onnx_dynamic rejected Resize nodes
with non-empty ROI or nearest_mode=round_prefer_floor, which are common
in opset 11-13 ONNX models from Caffe2ONNX, ncnn caffe2onnx, etc.

Accept:
- Non-empty identity ROI [1,1,...,1] (fused by fuse_constant_as_attribute)
- nearest_mode round_prefer_floor (maps to ncnn nearest default behavior)

Verified on 5 models:
  - picodet_l_640_coco.sim
  - pp_human_seg_mobile_sim
  - 59_crop_512128_opset11
  - gaomei_od_indoor_sf_60ms_opset13_fromcaffe (Resize part, ArgMax separate)
  - deeplabv3.sim.fix (Resize part, ArgMax separate)

Co-developed with GLM-5-Turbo (ZhipuAI API, annual max subscription), orchestrated via OpenCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant