Skip to content

Enhance resize

Houssem ROUIS requested to merge enhance_resize into dev

Context

This merge request finalizes the implementation of the Resize operator in aidge_core, ensuring full support for all attributes and inputs across all ONNX versions (up to OPSET 19).
It resolves aidge_backend_cpu#53 (closed), improving ONNX models compatibility.

What’s New

This MR brings the Resize operator to full ONNX compliance by:

  • Adding support for the interpolation mode: cubic
  • Implementing the remaining coordinate_transformation_mode options:
    • align_corners: Aligns the corners of input and output.
    • half_pixel_symmetric: Applies symmetric half-pixel shifts.
    • pytorch_half_pixel: Matches PyTorch resize behavior.
    • tf_crop_and_resize: Emulates TensorFlow-style crop and resize.
  • Supporting the ROI input:
    • Enables region-specific resizing by defining a box in the input and output.
    • Used exclusively with tf_crop_and_resize mode.
  • Adding support for additional ONNX attributes:
    • antialias: Applies a low-pass filter when downscaling (for linear and cubic modes).
    • axes: Specifies which axes to resize. Defaults to all spatial axes if omitted.
    • cubic_coeff_a: Adjusts the cubic interpolation sharpness.
    • exclude_outside: Ignores values outside the interpolation area when true.
    • extrapolation_value: Fills output regions when input is out of bounds.
    • keep_aspect_ratio_policy: Controls aspect ratio preservation during resize.
  • 🧪 Expanding test coverage to validate all new attributes and edge cases.

These changes make the Resize operator fully ONNX-compliant, unlocking support for a wider range of models and making the operator more robust across different deployment scenarios.

Edited by Houssem ROUIS

Merge request reports

Loading