From 4ad6d3126a9c1ab9b21a8b5c421fe31880d53d20 Mon Sep 17 00:00:00 2001 From: Joaquin Anton Date: Thu, 10 Aug 2023 11:18:09 +0200 Subject: [PATCH] Add ImageDecoder operator (#5294) ### Description - Adds a new ImageDecoder operator, to be used in preprocessing models. - Tests use generated images and opencv as a reference. ### Motivation and Context Currently, image decoding happens outside of ONNX, bring problems of portability and deployment. --------- Signed-off-by: Joaquin Anton --- docs/Changelog.md | 60 ++++ docs/Operators.md | 271 ++++++++++++++++++ docs/TestCoverage.md | 195 ++++++++++++- onnx/backend/test/case/node/image_decoder.py | 212 ++++++++++++++ .../model.onnx | Bin 0 -> 165 bytes .../test_data_set_0/input_0.pb | Bin 0 -> 4868 bytes .../test_data_set_0/output_0.pb | 101 +++++++ .../model.onnx | Bin 0 -> 168 bytes .../test_data_set_0/input_0.pb | Bin 0 -> 1220 bytes .../test_data_set_0/output_0.pb | Bin 0 -> 4819 bytes .../model.onnx | Bin 0 -> 166 bytes .../test_data_set_0/input_0.pb | Bin 0 -> 2221 bytes .../test_data_set_0/output_0.pb | Bin 0 -> 4819 bytes .../model.onnx | Bin 0 -> 178 bytes .../test_data_set_0/input_0.pb | Bin 0 -> 2221 bytes .../test_data_set_0/output_0.pb | 1 + .../model.onnx | Bin 0 -> 166 bytes .../test_data_set_0/input_0.pb | Bin 0 -> 2221 bytes .../test_data_set_0/output_0.pb | Bin 0 -> 4819 bytes .../model.onnx | Bin 0 -> 165 bytes .../test_data_set_0/input_0.pb | Bin 0 -> 1366 bytes .../test_data_set_0/output_0.pb | 101 +++++++ .../model.onnx | Bin 0 -> 165 bytes .../test_data_set_0/input_0.pb | 104 +++++++ .../test_data_set_0/output_0.pb | 101 +++++++ .../model.onnx | Bin 0 -> 166 bytes .../test_data_set_0/input_0.pb | Bin 0 -> 1194 bytes .../test_data_set_0/output_0.pb | 101 +++++++ .../model.onnx | Bin 0 -> 166 bytes .../test_data_set_0/input_0.pb | Bin 0 -> 374 bytes .../test_data_set_0/output_0.pb | 101 +++++++ onnx/defs/image/defs.cc | 69 +++++ onnx/defs/operator_sets.h | 2 + onnx/reference/ops/_op_list.py | 1 + onnx/reference/ops/op_image_decoder.py | 29 ++ onnx/test/automatic_upgrade_test.py | 10 + onnx/test/test_backend_onnxruntime.py | 1 + requirements-dev.txt | 4 +- requirements-reference.txt | 1 + 39 files changed, 1462 insertions(+), 3 deletions(-) create mode 100644 onnx/backend/test/case/node/image_decoder.py create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_bmp_rgb/model.onnx create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_bmp_rgb/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_bmp_rgb/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg2k_rgb/model.onnx create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg2k_rgb/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg2k_rgb/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg_bgr/model.onnx create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg_bgr/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg_bgr/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg_grayscale/model.onnx create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg_grayscale/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg_grayscale/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg_rgb/model.onnx create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg_rgb/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_jpeg_rgb/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_png_rgb/model.onnx create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_png_rgb/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_png_rgb/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_pnm_rgb/model.onnx create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_pnm_rgb/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_pnm_rgb/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_tiff_rgb/model.onnx create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_tiff_rgb/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_tiff_rgb/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_webp_rgb/model.onnx create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_webp_rgb/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_image_decoder_decode_webp_rgb/test_data_set_0/output_0.pb create mode 100644 onnx/defs/image/defs.cc create mode 100644 onnx/reference/ops/op_image_decoder.py diff --git a/docs/Changelog.md b/docs/Changelog.md index 3bee59ad260..97b62b5f7d0 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -24092,6 +24092,66 @@ This version of the operator has been available since version 20 of the default
Constrain grid types to float tensors.
+### **ImageDecoder-20** + + Loads and decodes and image from a file. If it can't decode for any reason (e.g. corrupted encoded + stream, invalid format, it will return an empty matrix). + The following image formats are supported: + * BMP + * JPEG (note: Lossless JPEG support is optional) + * JPEG2000 + * TIFF + * PNG + * WebP + * Portable image format (PBM, PGM, PPM, PXM, PNM) + Decoded images follow a channel-last layout: (Height, Width, Channels). + **JPEG chroma upsampling method:** + When upsampling the chroma components by a factor of 2, the pixels are linearly interpolated so that the + centers of the output pixels are 1/4 and 3/4 of the way between input pixel centers. + When rounding, 0.5 is rounded down and up at alternative pixels locations to prevent bias towards + larger values (ordered dither pattern). + Considering adjacent input pixels A, B, and C, B is upsampled to pixels B0 and B1 so that + ``` + B0 = round_half_down((1/4) * A + (3/4) * B) + B1 = round_half_up((3/4) * B + (1/4) * C) + ``` + This method, is the default chroma upsampling method in the well-established libjpeg-turbo library, + also referred as "smooth" or "fancy" upsampling. + +#### Version + +This version of the operator has been available since version 20 of the default ONNX operator set. + +#### Attributes + +
+
pixel_format : string (default is RGB)
+
Pixel format. Can be one of "RGB", "BGR", or "Grayscale".
+
+ +#### Inputs + +
+
encoded_stream (non-differentiable) : T1
+
Encoded stream
+
+ +#### Outputs + +
+
image (non-differentiable) : T2
+
Decoded image
+
+ +#### Type Constraints + +
+
T1 : tensor(uint8)
+
Constrain input types to 8-bit unsigned integer tensor.
+
T2 : tensor(uint8)
+
Constrain output types to 8-bit unsigned integer tensor.
+
+ ### **RegexFullMatch-20** RegexFullMatch performs a full regex match on each element of the input tensor. If an element fully matches the regex pattern specified as an attribute, the corresponding element in the output is True and it is False otherwise. [RE2](https://github.com/google/re2/wiki/Syntax) regex syntax is used. diff --git a/docs/Operators.md b/docs/Operators.md index 49a72bfce1f..197b95bc330 100644 --- a/docs/Operators.md +++ b/docs/Operators.md @@ -71,6 +71,7 @@ For an operator input/output's differentiability, it can be differentiable, |Hardmax|13, 11, 1| |Identity|19, 16, 14, 13, 1| |If|19, 16, 13, 11, 1| +|ImageDecoder|20| |InstanceNormalization|6, 1| |IsInf|10| |IsNaN|13, 9| @@ -12063,6 +12064,276 @@ expect( +### **ImageDecoder** + + Loads and decodes and image from a file. If it can't decode for any reason (e.g. corrupted encoded + stream, invalid format, it will return an empty matrix). + The following image formats are supported: + * BMP + * JPEG (note: Lossless JPEG support is optional) + * JPEG2000 + * TIFF + * PNG + * WebP + * Portable image format (PBM, PGM, PPM, PXM, PNM) + Decoded images follow a channel-last layout: (Height, Width, Channels). + **JPEG chroma upsampling method:** + When upsampling the chroma components by a factor of 2, the pixels are linearly interpolated so that the + centers of the output pixels are 1/4 and 3/4 of the way between input pixel centers. + When rounding, 0.5 is rounded down and up at alternative pixels locations to prevent bias towards + larger values (ordered dither pattern). + Considering adjacent input pixels A, B, and C, B is upsampled to pixels B0 and B1 so that + ``` + B0 = round_half_down((1/4) * A + (3/4) * B) + B1 = round_half_up((3/4) * B + (1/4) * C) + ``` + This method, is the default chroma upsampling method in the well-established libjpeg-turbo library, + also referred as "smooth" or "fancy" upsampling. + +#### Version + +This version of the operator has been available since version 20 of the default ONNX operator set. + +#### Attributes + +
+
pixel_format : string (default is RGB)
+
Pixel format. Can be one of "RGB", "BGR", or "Grayscale".
+
+ +#### Inputs + +
+
encoded_stream (non-differentiable) : T1
+
Encoded stream
+
+ +#### Outputs + +
+
image (non-differentiable) : T2
+
Decoded image
+
+ +#### Type Constraints + +
+
T1 : tensor(uint8)
+
Constrain input types to 8-bit unsigned integer tensor.
+
T2 : tensor(uint8)
+
Constrain output types to 8-bit unsigned integer tensor.
+
+ + +#### Examples + +
+image_decoder_decode_bmp_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".bmp", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_bmp_rgb", +) +``` + +
+ + +
+image_decoder_decode_jpeg2k_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".jp2", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg2k_rgb", +) +``` + +
+ + +
+image_decoder_decode_jpeg_bgr + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="BGR", +) + +data, output = generate_test_data(".jpg", "BGR") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg_bgr", +) +``` + +
+ + +
+image_decoder_decode_jpeg_grayscale + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="Grayscale", +) + +data, output = generate_test_data(".jpg", "Grayscale") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg_grayscale", +) +``` + +
+ + +
+image_decoder_decode_jpeg_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".jpg", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg_rgb", +) +``` + +
+ + +
+image_decoder_decode_png_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".png", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_png_rgb", +) +``` + +
+ + +
+image_decoder_decode_pnm_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".pnm", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_pnm_rgb", +) +``` + +
+ + +
+image_decoder_decode_tiff_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".tiff", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_tiff_rgb", +) +``` + +
+ + +
+image_decoder_decode_webp_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".webp", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_webp_rgb", +) +``` + +
+ + ### **InstanceNormalization** Carries out instance normalization as described in the paper diff --git a/docs/TestCoverage.md b/docs/TestCoverage.md index 3e2a2d8e77b..20b5d98888c 100644 --- a/docs/TestCoverage.md +++ b/docs/TestCoverage.md @@ -6,7 +6,7 @@ * [Overall Test Coverage](#overall-test-coverage) # Node Test Coverage ## Summary -Node tests have covered 178/191 (93.19%, 5 generators excluded) common operators. +Node tests have covered 179/192 (93.23%, 5 generators excluded) common operators. Node tests have covered 0/0 (N/A) experimental operators. @@ -8181,6 +8181,199 @@ expect( +### ImageDecoder +There are 9 test cases, listed as following: +
+image_decoder_decode_bmp_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".bmp", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_bmp_rgb", +) +``` + +
+
+image_decoder_decode_jpeg2k_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".jp2", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg2k_rgb", +) +``` + +
+
+image_decoder_decode_jpeg_bgr + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="BGR", +) + +data, output = generate_test_data(".jpg", "BGR") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg_bgr", +) +``` + +
+
+image_decoder_decode_jpeg_grayscale + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="Grayscale", +) + +data, output = generate_test_data(".jpg", "Grayscale") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg_grayscale", +) +``` + +
+
+image_decoder_decode_jpeg_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".jpg", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg_rgb", +) +``` + +
+
+image_decoder_decode_png_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".png", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_png_rgb", +) +``` + +
+
+image_decoder_decode_pnm_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".pnm", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_pnm_rgb", +) +``` + +
+
+image_decoder_decode_tiff_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".tiff", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_tiff_rgb", +) +``` + +
+
+image_decoder_decode_webp_rgb + +```python +node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", +) + +data, output = generate_test_data(".webp", "RGB") +expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_webp_rgb", +) +``` + +
+ + ### InstanceNormalization There are 1 test cases, listed as following:
diff --git a/onnx/backend/test/case/node/image_decoder.py b/onnx/backend/test/case/node/image_decoder.py new file mode 100644 index 00000000000..69105dee62d --- /dev/null +++ b/onnx/backend/test/case/node/image_decoder.py @@ -0,0 +1,212 @@ +# Copyright (c) ONNX Project Contributors +# +# SPDX-License-Identifier: Apache-2.0 + +import cv2 +import numpy as np + +import onnx +from onnx.backend.test.case.base import Base +from onnx.backend.test.case.node import expect + + +def generate_checkerboard(width, height, square_size): + # Create an empty RGB image + image = np.zeros((height, width, 3), dtype=np.uint8) + + # Calculate the number of squares in each dimension + num_squares_x = width // square_size + num_squares_y = height // square_size + + # Generate a random color for each square + colors = np.random.randint( + 0, 256, size=(num_squares_y, num_squares_x, 3), dtype=np.uint8 + ) + + # Iterate over each square + for i in range(num_squares_y): + for j in range(num_squares_x): + # Calculate the position of the current square + x = j * square_size + y = i * square_size + + # Get the color for the current square + color = colors[i, j] + + # Fill the square with the corresponding color + image[y : y + square_size, x : x + square_size, :] = color + + return image + + +def generate_test_data(extension, pixel_format="RGB", h=40, w=40, tile_sz=5): + data, output = None, None + np.random.seed(12345) + image = generate_checkerboard(h, w, tile_sz) + image_bgr = cv2.cvtColor(image, cv2.COLOR_RGB2BGR) + _, encoded_image = cv2.imencode(extension, image_bgr) + data = np.frombuffer(encoded_image, dtype=np.uint8) + if pixel_format == "BGR": + output = cv2.imdecode(data, cv2.IMREAD_COLOR) + elif pixel_format == "RGB": + output_bgr = cv2.imdecode(data, cv2.IMREAD_COLOR) + output = cv2.cvtColor(output_bgr, cv2.COLOR_BGR2RGB) + elif pixel_format == "Grayscale": + output = cv2.imdecode(data, cv2.IMREAD_GRAYSCALE) + output = np.expand_dims(output, axis=2) # (H, W) to (H, W, 1) + return data, output + + +class ImageDecoder(Base): + @staticmethod + def export_image_decoder_decode_jpeg_rgb() -> None: + node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", + ) + + data, output = generate_test_data(".jpg", "RGB") + expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg_rgb", + ) + + @staticmethod + def export_image_decoder_decode_jpeg_grayscale() -> None: + node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="Grayscale", + ) + + data, output = generate_test_data(".jpg", "Grayscale") + expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg_grayscale", + ) + + @staticmethod + def export_image_decoder_decode_jpeg_bgr() -> None: + node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="BGR", + ) + + data, output = generate_test_data(".jpg", "BGR") + expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg_bgr", + ) + + @staticmethod + def export_image_decoder_decode_jpeg2k_rgb() -> None: + node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", + ) + + data, output = generate_test_data(".jp2", "RGB") + expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_jpeg2k_rgb", + ) + + @staticmethod + def export_image_decoder_decode_bmp_rgb() -> None: + node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", + ) + + data, output = generate_test_data(".bmp", "RGB") + expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_bmp_rgb", + ) + + @staticmethod + def export_image_decoder_decode_png_rgb() -> None: + node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", + ) + + data, output = generate_test_data(".png", "RGB") + expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_png_rgb", + ) + + @staticmethod + def export_image_decoder_decode_tiff_rgb() -> None: + node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", + ) + + data, output = generate_test_data(".tiff", "RGB") + expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_tiff_rgb", + ) + + @staticmethod + def export_image_decoder_decode_webp_rgb() -> None: + node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", + ) + + data, output = generate_test_data(".webp", "RGB") + expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_webp_rgb", + ) + + @staticmethod + def export_image_decoder_decode_pnm_rgb() -> None: + node = onnx.helper.make_node( + "ImageDecoder", + inputs=["data"], + outputs=["output"], + pixel_format="RGB", + ) + + data, output = generate_test_data(".pnm", "RGB") + expect( + node, + inputs=[data], + outputs=[output], + name="test_image_decoder_decode_pnm_rgb", + ) diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_bmp_rgb/model.onnx b/onnx/backend/test/data/node/test_image_decoder_decode_bmp_rgb/model.onnx new file mode 100644 index 0000000000000000000000000000000000000000..69eded0b8b4deffb42b8c33a74014f236683ea9f GIT binary patch literal 165 zcmd!b0RQ~;*R2u z;*R2u;*R2u;*R1`*HeeL^S8uO^Yva}a!*UmP))0ue9&lWw#_yx`r6G%(|+S9?kMgk z?kMgk?kMgk?kFC0J#~0H$9gMG>fL3t=t8%7yy=B$z8^Oq2j824@r|aZWsY$acNBLN zcNBLNcNBLNcNCAho;tjp6L&M_?dcMetvhd)Z1`dpEF3e>F6}cj>)Xu8)pp}3?kMgk z?kMgk?kMgk?kFC0J#~0HH|+djw&eTG=*sJ6_~3fea`CWP^YFEq6;zlR&u#4)r`NN^SdDI%1b@`O(Po6c$7WbI#2PRG9@SxcI~uO>{x^t8#Boiv%gW#-E2auch%VI0LB#T~^R T#T~^R#T~^R#iOpL4sYi_YxZ+v literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_bmp_rgb/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_image_decoder_decode_bmp_rgb/test_data_set_0/output_0.pb new file mode 100644 index 00000000000..6ed563ac91a --- /dev/null +++ b/onnx/backend/test/data/node/test_image_decoder_decode_bmp_rgb/test_data_set_0/output_0.pb @@ -0,0 +1,101 @@ +((BoutputJ%QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuuvlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_ZPZPZPZPZPvUvUvUvUvU'Ь'Ь'Ь'Ь'-QqzsH`F=Op@V(S|udJB>)uW;bP*@fMRAR7A^(>5dgh%ESCTP literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_jpeg2k_rgb/test_data_set_0/input_0.pb b/onnx/backend/test/data/node/test_image_decoder_decode_jpeg2k_rgb/test_data_set_0/input_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..2dfca67b041f5cd28fde79f3d6b0efca619daac1 GIT binary patch literal 1220 zcmdX(; zQi_1I1{gE5vjb@c2L9yyoFYarQ-FbiB@?JP`M>}FKn8uV7(_9ciG|P1&d3Ns|AQEK zfC?BHSXo#Y82`sG2s=1%NHJc?)TxB?Ch-a6#`uI z`nhJZo;-eu&+dT5?*k1Cn>txbr*jq`zr+QUPY~dm&i$2f{_$f{H3t{JRla zXF}kwgO<&@n)BtO*5sZ`ox%Ii<3j!Yh&4aE&d=yjb6sR_)8(jrW~=G`f1OiUm)Y+S zb>TZz*!F;Jg4n!GXRg{V5;gV={iC~F^N-Kjdgqi6o&_4IQ9_@J6pkN^lv~;!AYu2S zsoTc))Qul+d1iGKZhdm~^?&z%zt`*9gk~-fEZ`57`}Te2_9fA;oxgNTt@aUdYo}c|n)+Lv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aPoYMS^qIJ_3U(naO=-ch|Et|ap$X<@yex}n-y2D!X{o&-?y5yp!l)G)|4?A+{ zfYt$Ea0HmpSq;eCT3(s?A&D80DLL?~g)mrQ}Nu^(_L4R9}Xns zR>ob&C*SJHxKmp|2XyuU!$aUAmCbPHl+Km3l92o&SWZz~W)VEPB+~6xh}#{1w|h|6 Y+x9LcJKL3%%`WnK*AC%7|6jfT1Jw<9e*gdg literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_bgr/model.onnx b/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_bgr/model.onnx new file mode 100644 index 0000000000000000000000000000000000000000..6278b3c7fd38457b456ef810496b5f324d79e5b7 GIT binary patch literal 166 zcmd&5TENIGqy*9)p9xYLp8`<}rQ@>-Qq$v;(u<;mp(b;4 nadI#Tv2rnU%oj|O;euKuB*Y~E6z1V#;?RI%W+xUd1_2QOP1-Bx literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_bgr/test_data_set_0/input_0.pb b/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_bgr/test_data_set_0/input_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..1773f14db39ee32c8a7d9cf897b8f153d15f70a9 GIT binary patch literal 2221 zcmbW0dpOf?AIHDj%pB8FOwJ)9Q6c=wo^qyWNsU5Utb?;0!>$ep%YIsTa?EilOKT1( z%n0e1&=6BHntt_bwN03I`b}Ne^ZfJt@jTDxzCNGpzOVap-`D$fe?GTDC44>jfZUnT zi=keXaOtFU7Fh4)=II82KmY)e4L~{#I0InNnyp3fn#n=dB2-QeA}0@(m;dQ7MFn}7 zB1~RhL0LgjY0YFa6=fxrwZ+;czm9^T5C~KWCJ+0W@;?P>Hvm@v%m6b8XbS*_gCKB_ z^ckQp(+T}4PbT)4fxr+ss60$2Ls^#4vR)=10+ES^$`s48(`EaB92~mAaOZw`byO&9 zOYFv7mkX*Cj1Exfn~scfjd!1pyP~M1p^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kvdvYMHsc@O*cP+|vH1pr%6LpEb0&VN>x& z8dSsM;8MSZDH29|`JlLt#tKVw=zN1?DG4WoPWu zBGcObQg6_H@;f<)U0K4uR}+0mtve=V8EMtit43rOas}x7e)X(v_U_bMw`#>FB0kb) z-;#ZBaLIJVHcFR^i*IJqYsh+o59b3}ic1uqv>@ z08F>CFg5!hqplgF-*3O9EG6e|`iN>Ld6LF$wWhyX3|PJMr-zNazP58C7ID#!UD?sG zgdN1eZA+UbL%!g+4Mqf%?C+3XN@R_C4X@Qfqek*YG~+(JxN5O{s%IYIz{9ZeRMq;6 z^_$0Q8FrnxBs-FAEnf9b3Ae4J>K|&&DMQVg#;49y#Gyh8xy$h-u?go`)RG6C4#p)# zL!SJWy0$?5H+#>~bxghKI}mf%Pt8(Qf>L?pz~PE&(y>~D+HcW`*13TZ1xBUeLnemdF*ROQRsn33=I2WKsY!Vz2{KyfOP6_EOrs% literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_bgr/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_bgr/test_data_set_0/output_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..bdce5b58386638490ea838c32aafdc17f4417548 GIT binary patch literal 4819 zcmV;^5-jZqCcy%&y~mjPuTJ==I|=w z?k42#8R6#_Q2zdd>i<6(d36VccL;)P6>C&4Lvw*w zSC}$Nr65eA9(R~9h&&9eEE%jU8j&a^XedTcI(Qv6m;x@N4=}F_Dy#cd-u+YI|4-=N zSK*j%(2~UdP}=b^=j|@#?<(i-8Q|j<U>2MRtQ-R+chNr6W?PByNuFZGL?o9F0SLc&$&z;NvVcq9H<=Q^u+dS#v zE#=)L?*Bm^XmAj9bPsuH7iv)|N_%~2WQ;{y zlrmqLG`Y;LgURkr`tz3Z^Plndneg(KgQh$L{NIe%*Kp$2>BuY0ZHY_+tL~A)deJ?nIGC6`X zJ%fW2SOVX-7&!|7qr$)-9V#l#4ZDT=a zY))o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@bB;>^e7 z#MRxt)7j9%q|0xd+*+L7T%glhz0+xSZWN7cAD3hvn`9rFWF4xiH~+og|HJI>!0z$F^V!qJbHX!S)B|GK0(8t2l&(07Yc{D; zT(&}OxPT zaF>3Da%Z$@Ys_S8(qn7WV`}v$9Q7w0^d%kSCn>ulI{&-j|GVw-!1nXM^xxOYY`ZL8 z*8^hM198X_n6W>KX*j1*UARSXw?uESQC0K3aP7!g?8RN>#bVjXX<1kRPgMp*R0=~@ z4Jla{KBjRYrFJB#cRQhXZIpV3b7r$^Ys+M7(PeAVV`uCmAnha}?IR-FCM&WeH~+uh z{=et$!R+zD>)+bNZ@(~H)d*hH1#rk0kFY*}YBrfuS*1s5r%7v{QCQ`)h~2t&-@AL+ zx_isJcvn&lQB)65Sr$D{3M*9@MxJmqqIff(bWNXpbCP|5a%rY)ZM|x8yku&?W^CXj zFyAFH+#xW_BQvKZHvh-i{><3z&DikG+uGf>albWM(Gg$L5o*aHe6TxfbTxusRf` zK8Wc{mfUBSy>h3lk*=ekt)ZW+o3>ati&-+DSTLYkHM}p^7f!$_z$Z>SKg>d|-xpUXOQUf>%_9QCNOZR(4llTU24p-0i^Q z_paUYvE=xz;`XcwL8k{nqzFZq5I%h!DF5Ee`|G^x@UrdlwBY`wl;T)~>_>&}ONs1S zf!t?u#c+1MiE*=#ak7$npu;R7%QOxAG7bGS6W~TGv2$XgeRObueOG^dT8esOfK^h8 zQCW*sTzXMiW>;m;+3UgL_O{~ruHW^r;`plxL#GErqX$Qp4?lbyC;#8d`Rlvs@v!Of zu-yHklj2o|?n#C0OM~WAe%WMo$a8VIgm$@?loT7`OFfK*e9Qd^8rSbk4fXH;X^-}1iQ^0VLev*Y`$-t{i8aAN=f literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_grayscale/model.onnx b/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_grayscale/model.onnx new file mode 100644 index 0000000000000000000000000000000000000000..61b1beb83fa36270c7b1275040ed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w)R(q}EzeYk`?(FraQMKN;D@}8dl zWM$}5z_Cu!h`C=Bfyws(clA2f^-5H@L))L=$xA*dv&FlJS%x#sK~Y#uvrC@AgM0p{ zBbYkOo1=x;#>2k;N7n~uSygNb4aC(5hD?f}%=qM-m|eY-P&@2!3WKM!-OSqc4eueZ?FL@VBGn=Oo7+7W}z6zY~1=yKti_AT4bnJ74C&> zT(^E=+HeG>>%!+sos0=7Fok@yuQFHGej%%sJcHM@LgaF*lkfySivKj~J100`mZp#l zo5wM6EI7BQuu%$xeG$4dZ6@CgF7AmOD7#;_8p#lLEH|BR71!fV>0;@vH0r+bnalBW zWT#iUyQIMWQu=X~oP==AVf^!n8Se;d+Dk;k6rWg78J)NHw~B<^m->3P*BdrRG9HZG z_4D6X(kvdvYMHsc@O*cP+|vH1pr%6LpEb0&VN>x& z8dSsM;8MSZDH29|`JlLt#tKVw=zN1?DG4WoPWu zBGcObQg6_H@;f<)U0K4uR}+0mtve=V8EMtit43rOas}x7e)X(v_U_bMw`#>FB0kb) z-;#ZBaLIJVHcFR^i*IJqYsh+o59b3}ic1uqv>@ z08F>CFg5!hqplgF-*3O9EG6e|`iN>Ld6LF$wWhyX3|PJMr-zNazP58C7ID#!UD?sG zgdN1eZA+UbL%!g+4Mqf%?C+3XN@R_C4X@Qfqek*YG~+(JxN5O{s%IYIz{9ZeRMq;6 z^_$0Q8FrnxBs-FAEnf9b3Ae4J>K|&&DMQVg#;49y#Gyh8xy$h-u?go`)RG6C4#p)# zL!SJWy0$?5H+#>~bxghKI}mf%Pt8(Qf>L?pz~PE&(y>~D+HcW`*13TZ1xBUeLnemdF*ROQRsn33=I2WKsY!Vz2{KyfOP6_EOrs% literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_grayscale/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_grayscale/test_data_set_0/output_0.pb new file mode 100644 index 00000000000..7117d4fc04b --- /dev/null +++ b/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_grayscale/test_data_set_0/output_0.pb @@ -0,0 +1 @@ +((BoutputJ :9999srsqu65538OPLRM89:98vqtwl74753ONPPP7:998upvrv27655ONOMN89:98wrptt43248NQOON;:888rwtrs38:51PPMNQ^\b`[iba`_bdghd94598IMKJOxzz`]a``abegcecaag39968OMLNJz~|y_`]_`cbcaadedf`<6876JKNLJ{{||__^_^ebcccddcdb97767NLLJK}|||}_]b_^dcddbaedef57876KLLMM}{{{}}}}~b]_``eb__eDJJHH~y~x^]c\\acdcaIGFGG|z~~_^_^acabaaIIHIJ|~{|````\acaaeDHHGE|{|~]_^]caacc^KGFIJb`cc_gfgeg`abbbgfgfebcca`fegdha`bcbgfefgcabb_eehdf–nkkjncdddfqpoqqLLOMMSROQTmknjleedccooqopNOMOMNQRSNkkmnkdbdeepqpqoOMNMMPSORQmlkljfdddcpoporLONOOQQRPShqimncccfaroqpoNNLNNQPQPPbdabf½ΫQVTVSbbeaaĿͬV[QT[eafdcŠʮXWWWQbc_bbͰVUTZWcfdbcĿͫTXUVU<8=:>։^]\^_=<>?=spstr<;9=8Ў__\`[=??=@qrrrr;;:=;ԇ^^_^]==<>@qsrsq9::<:ԋ]]\^\>?D8>qsvpr=>;;9э``^`^=>;A@qqmst)+*,/றTWVVXuursrYZ[YY--,,,ݮYWWVVssrwuZ[ZXZ+++,+޲WTWXWtvust[YW]Y,+,-+యUYYTVwtrsuYZ]X]-+,-*ޯYWTYXrsuusY[YW[ \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_rgb/model.onnx b/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_rgb/model.onnx new file mode 100644 index 0000000000000000000000000000000000000000..d2dd7b9a20812df660b8d9c73644a49216ae297f GIT binary patch literal 166 zcmd-Qq$v$(vzZup(b;4 nadI#Tv2rnU%oj|O;euKuB*Y~E6z1V#;?RI%W+xUd1_2QOP8uuc literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_rgb/test_data_set_0/input_0.pb b/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_rgb/test_data_set_0/input_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..1773f14db39ee32c8a7d9cf897b8f153d15f70a9 GIT binary patch literal 2221 zcmbW0dpOf?AIHDj%pB8FOwJ)9Q6c=wo^qyWNsU5Utb?;0!>$ep%YIsTa?EilOKT1( z%n0e1&=6BHntt_bwN03I`b}Ne^ZfJt@jTDxzCNGpzOVap-`D$fe?GTDC44>jfZUnT zi=keXaOtFU7Fh4)=II82KmY)e4L~{#I0InNnyp3fn#n=dB2-QeA}0@(m;dQ7MFn}7 zB1~RhL0LgjY0YFa6=fxrwZ+;czm9^T5C~KWCJ+0W@;?P>Hvm@v%m6b8XbS*_gCKB_ z^ckQp(+T}4PbT)4fxr+ss60$2Ls^#4vR)=10+ES^$`s48(`EaB92~mAaOZw`byO&9 zOYFv7mkX*Cj1Exfn~scfjd!1pyP~M1p^4DiY_iqVY@4}_t=%4b2S;ZYS2uSLPcOft z{>P4^0|GH;!osm<&z+CIn2?y1oRWI=T4q-E^_<+B#9M_$#s9orQe9J9S5LazaPJYd zxuv!3ar={=-e-ON1J4Ivyk?AzPrR9&VzTDuKd=`*{`u)MkH7eRX?aDk`eTg?1VDaa z$>M+Hg3GwTYc+taae=@|GKawBpoTl;H|$5jLSxmp?7FP5@jyWpg|29{`v`Z_>9|oP z4PzUY32zPUC)s}ocIE#f`xn^1xtM?o1SBgS1P&kpjugPEP5;4C>mld_CFea0*5MhC z9ID&*$g;5fseSzRgNmw-_)s;R*AE80vema&_YzAKqTl%4GUeh0bU5uM(;E#P%pZU2 z0nW*da`KDR=Em)Ew-@-baP+23%|OwpV7T|wrn^*(_R04{N~@&|NFtAT<1H>TRCH1> zJU^VBIzi^Tvx;*!yr&OFSl(e&wPq#o9~i1R=9C9Ix3h`mt6JUtfWH2G_Lc7)2j8YQ=|avIIf4nUAf+fW9dkyg-OdxweV=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oder_decode_jpeg_rgb/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_image_decoder_decode_jpeg_rgb/test_data_set_0/output_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..bb2d5aa1168b3b8a939a0c0a4b37462b149869bf GIT binary patch literal 4819 zcmV;^5-jZqCMlYm;c9=^4L%C<}dEz zD(~bb=iwRT;}_%R9pK_0<>4m(`$+%#P5=8({{B$^>VtV1KZOT%f(UnO6>LK zGMHB&rAi*6OfZ;t3_OS#EUX$VtR*OsMkr`_I!~B39iuJ+uP_g*Dhu9K`{7gl=uiLQ zSKiQXnEu3)@!C-B=P~c)F7M|m?S*z2 zJ%tB#g9v(U6>LQ;Q(c30GL}{&rA;KLQYVjY4Lye#E2|qXtS2gyK_g>&IZc-{8>%n| ztu70$Ee+mN_TW+Y>QMgRSKHBVnE%I>?%Y!5=P~K$GU(?k=)|3}gBR=(43 zk@Cc%+}?ZB?P%8SX4UIj&ErDN`iS%LmiFvBzR#Z76JK zL2_nJb7)L&Vp2viKtd@=L@7*1EmT4+R8c=^RYGu5KyXb#Z%a;Lafxqch*fEcSZ{`0 ze}ih)$iL;r%<9C^~@99^(ESAbSm zP;OK>eNi-hNH=~ukJNXN(`k~{XO_-$puv(|Xk=?#g>O}qaaWdPSb#A>Kq5jbBttPO zJU%=wQe`rIfFYHT9HEOGo_8*0iHJ3Gm;iB^0CATPZ;w2}+q=He;=IlHztQ=-&-DEc zU;PeW`wm{=9b2t9Qh{1kO>j~+eN#AnP&$4=kI{FO)@+c^WSPr!r^J+AXkcnwe{NNe zZ&j3LS%oe=KqEpjBSAGQIzK%xQ)xGVfFqWS8=s0An0YQ{hlVqBnE-T|0CbfSa*sW} z*0jOYalcn#_fd%x#v@ zbDPP2sJxkEUuAPxg?Uhxdrz8pRFXU`N;ot^J2XZ?FG)@%O>{78h$MQFAAXe}dx9}h zjD$0Ik_vZ|3UrYgaF9E?-mbOV(5%(lu-xCX-{PNK(4Sn;pIp$RUdgCky3c^m(Sg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^LG@r*K8MZ$!6MQLu2m^H|93UB&ET#pP+q*#KBs231cAR7DL| zLl;>oai%_Yr6G5zBzK`ZdX#NubB1ecvuk9_Yh}@AW6>ZZ>>(uWA|vf9Cfhe8vfjV{ z=fD2!!S3t9@x|KTFu!jI)m#PCUKhx4KCq8AYJXW%nQ2F*Ye}bAQJ;vk<#xK=d%NFz zy4iTU%MDUj4^&YWSx^d3Js4FhaGpkZqBL}$Gkl*-eUfu&a)E7ZrgCb%YGk}@X238c z;4vlNFd^JCBg-}=r`X5;*v$Ue&F$OG@V4FBHNSBY(OMDGUm?kAJFt8;bZb>#f?`vO zWL1o0RE4&o%(b7!xuD0eqQju8y(dLY98F3TO-372NFh--c$s2;m{)w5U44>gg^+-7 zaC&lUjBsR?!zAO&DD-F9W6Rj>BlGD)t(A@vf;q}qr_q_4vR^XC9^n*U| zfJ^C!XWW)@y_S)zr=O#)pP{X`o2-jBSfDalpfFgHH(Gc{U3+kTV|;*9e|}Vee_DNZ zOkq${U`$kDP*q)0Sz1-(-rnut=kVa_>DlAy+~qn9wK@&5It#Bf5uYm@h0fRi#OD9M z?DE6w^{w>cR^XCG@PkP3gH-B7xDIRpOIL?uJY3g;eH)WZ8am$aRFdag@1slC^WaoO915GWrZK_y{fJ88@;nMw?!3 tY;}5Af`D3qfM0rrQ&fOkQj1tnj95>8V^nAI-`VorzV_d<`{T3q-mKNraAN=f literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_png_rgb/model.onnx b/onnx/backend/test/data/node/test_image_decoder_decode_png_rgb/model.onnx new file mode 100644 index 0000000000000000000000000000000000000000..b33613c0076d28216df6e978b6dc17a5338d678f GIT binary patch literal 165 zcmdOoFgDfIPzyKKr0xkgomBpfo9zdbAQOo8+fl2tW ziPVY_1JxiX9yQ{EAP{Sux?4`HA})XgifCkOz(fJ5{Riq}AMU*m-^2HIX}9T+2{w1D zaF=l9ZF*6pfNw>gPp42QR^efI)Ted+H#Cz^Z7O&7qfpEk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001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_png_rgb/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_image_decoder_decode_png_rgb/test_data_set_0/output_0.pb new file mode 100644 index 00000000000..6ed563ac91a --- /dev/null +++ b/onnx/backend/test/data/node/test_image_decoder_decode_png_rgb/test_data_set_0/output_0.pb @@ -0,0 +1,101 @@ +((BoutputJ%QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuuvlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_ZPZPZPZPZPvUvUvUvUvU'Ь'Ь'Ь'Ь'!zsYz#FCO&lIS&u)6-Ln;TJOlLxV+^{stB?UiPM@OU)WCCJbNdZ4@swJjh5F zZeGZklyOATVNUk(g!L|wMJ^0J_B}=wB0{cQZ61pRHATYom3rM(0)O(H@>ZX6>PgT| zn?wG_lg}>sJk#b=zx~93)CpEPdi{b+j;<`+mD4m|ZN;foMK9h;rAExUwp{e&-KyGz zzAH=oA5>QPnVIi-^7PV*Aiq0~-72rclcxEl<<3%hcll!$;qqy8klxGd9pxr*S7;^p7-?J=FHjSpYM6I zH9=;s#xEw%-*aDzHy@d3({DWQi>-h1oga4oi{JdQ_j|qX!=8NYb6=MDN8g%g`@YNN z=f0J~@BZvADE`giATWiUOL@ZGhfs+pdN>uUBL zY3!KXq-qd1xxwjUfACe)*r-2)i>ms#9QQ@YmOQOYew6$?Y5Jahhmnmc(E>gI;TaI)#Q_w)2jH-7x<;AJhN2pS}YMKH8Jr=muu%! zj(Pe$OCs)BO-%mDV>t22PAmVZi8tC*yHtM8Gwn;h$>usqCDJUZJwr0Bb^41=vEErP zC67&=`?BNR-1!e@@x}B#lhQL>{OrZM;-$}bRY~!;tP7ILp3MHskDb{WnC5z$4*8V| zbndc>n8dX2o7x;r%X|t(Q(XMml9+nmU0-E3S)VDL^GN;r7uhcBn_uQM@n8Nl*I)nY=h!UQ z2j#W=sTY?xF^GgNdA#$KlFE~b|GZQlIrdbkJdRistMZuRiRO~$57#kVJyH-h`PaQe zu5YV5#rJ+ti5EZNG2i%wivP-QLh5(^h&g|%>yLf2cl)mI_qiX}te^X3-}YO-?{|N$ z+FwS literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_webp_rgb/test_data_set_0/input_0.pb b/onnx/backend/test/data/node/test_image_decoder_decode_webp_rgb/test_data_set_0/input_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..7ff77992a84f23c7ea27b6830018af982c14226d GIT binary patch literal 374 zcmV-+0g3(y=mHP|LIh-CbYV*90#ZpvMqmK|09QpqP*zYlOj7{>052!N2>}1$HUa>` zdE2b4O3|Jf>@S^d+s+(L0{}o8+}#sdKd{Ch+{qm@lDp1*ZUX=yo7k*vx0l$j>VZtP zJ=wPAKkf!S#TTesR>y_ZFa{47W$+LTN|xT=S2%mlD^+mmb(%o4BRu8wM+gK3>^X}@ z`K0GJ@4tjUIu_I24;$K_KQdu&1jrnUr`Dv<_<&%Au|qsaEb4CsMFip!!%p3c^UDzV#wbn5gh1b9 z6m02vBs2v*H_9mMV}K;dwrT6xwr%@;|M`zA`==ez{|Tsg_Ts^gTVvJ@pQ9VQj$GL? z=cnP5x8&NUZRh@)GJF=!Y*@7K)ren)Puho5tJZuu@oo4#{V{9Voi`Ky8$MC*?j8H# U(u@VeC+@dNd!8IP^w01C00+jkF#rGn literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_image_decoder_decode_webp_rgb/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_image_decoder_decode_webp_rgb/test_data_set_0/output_0.pb new file mode 100644 index 00000000000..6ed563ac91a --- /dev/null +++ b/onnx/backend/test/data/node/test_image_decoder_decode_webp_rgb/test_data_set_0/output_0.pb @@ -0,0 +1,101 @@ +((BoutputJ%QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +QQQQQ-----PPPPPvvvvv!M!M!M!M!M/////- +- +- +- +- +^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuu^^^^^4~Q4~Q4~Q4~Q4~QeeeeemVmVmVmVmV"B6"B6"B6"B6"B6uuuuuvlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_vlvlvlvlvlqqqqq@v;@v;@v;@v;@v;66666zzzzziXiXiXiXiX[[[[[L_L_L_L_L_ZPZPZPZPZPvUvUvUvUvU'Ь'Ь'Ь'Ь' + +#include "onnx/defs/data_type_utils.h" +#include "onnx/defs/schema.h" +#include "onnx/defs/tensor_proto_util.h" + +namespace ONNX_NAMESPACE { + +static const char* ImageDecoder_ver20_doc = + R"DOC(Loads and decodes and image from a file. If it can't decode for any reason (e.g. corrupted encoded +stream, invalid format, it will return an empty matrix). +The following image formats are supported: +* BMP +* JPEG (note: Lossless JPEG support is optional) +* JPEG2000 +* TIFF +* PNG +* WebP +* Portable image format (PBM, PGM, PPM, PXM, PNM) +Decoded images follow a channel-last layout: (Height, Width, Channels). +**JPEG chroma upsampling method:** +When upsampling the chroma components by a factor of 2, the pixels are linearly interpolated so that the +centers of the output pixels are 1/4 and 3/4 of the way between input pixel centers. +When rounding, 0.5 is rounded down and up at alternative pixels locations to prevent bias towards +larger values (ordered dither pattern). +Considering adjacent input pixels A, B, and C, B is upsampled to pixels B0 and B1 so that +``` +B0 = round_half_down((1/4) * A + (3/4) * B) +B1 = round_half_up((3/4) * B + (1/4) * C) +``` +This method, is the default chroma upsampling method in the well-established libjpeg-turbo library, +also referred as "smooth" or "fancy" upsampling. +)DOC"; + +ONNX_OPERATOR_SET_SCHEMA( + ImageDecoder, + 20, + OpSchema() + .SetDoc(ImageDecoder_ver20_doc) + .Attr( + "pixel_format", + "Pixel format. Can be one of \"RGB\", \"BGR\", or \"Grayscale\".", + AttributeProto::STRING, + std::string("RGB")) + .Input(0, "encoded_stream", "Encoded stream", "T1", OpSchema::Single, true, 1, OpSchema::NonDifferentiable) + .Output(0, "image", "Decoded image", "T2", OpSchema::Single, true, 1, OpSchema::NonDifferentiable) + .TypeConstraint("T1", {"tensor(uint8)"}, "Constrain input types to 8-bit unsigned integer tensor.") + .TypeConstraint("T2", {"tensor(uint8)"}, "Constrain output types to 8-bit unsigned integer tensor.") + .TypeAndShapeInferenceFunction([](InferenceContext& ctx) { + if (hasInputShape(ctx, 0)) { + auto& input_shape = getInputShape(ctx, 0); + if (input_shape.dim_size() != 1) { + fail_shape_inference("Input tensor must be 1-dimensional"); + } + } + propagateElemTypeFromDtypeToOutput(ctx, TensorProto::UINT8, 0); + auto output_type = ctx.getOutputType(0); + auto* sh = output_type->mutable_tensor_type()->mutable_shape(); + sh->clear_dim(); + sh->add_dim(); + sh->add_dim(); + sh->add_dim(); + })); + +} // namespace ONNX_NAMESPACE diff --git a/onnx/defs/operator_sets.h b/onnx/defs/operator_sets.h index 7b500b01b32..c599f4c5ef4 100644 --- a/onnx/defs/operator_sets.h +++ b/onnx/defs/operator_sets.h @@ -1109,6 +1109,7 @@ class ONNX_OPERATOR_SET_SCHEMA_CLASS_NAME(Onnx, 20, ConstantOfShape); class ONNX_OPERATOR_SET_SCHEMA_CLASS_NAME(Onnx, 20, StringConcat); class ONNX_OPERATOR_SET_SCHEMA_CLASS_NAME(Onnx, 20, RegexFullMatch); class ONNX_OPERATOR_SET_SCHEMA_CLASS_NAME(Onnx, 20, StringSplit); +class ONNX_OPERATOR_SET_SCHEMA_CLASS_NAME(Onnx, 20, ImageDecoder); // Iterate over schema from ai.onnx version 20 class OpSet_Onnx_ver20 { @@ -1121,6 +1122,7 @@ class OpSet_Onnx_ver20 { fn(GetOpSchema()); fn(GetOpSchema()); fn(GetOpSchema()); + fn(GetOpSchema()); } }; diff --git a/onnx/reference/ops/_op_list.py b/onnx/reference/ops/_op_list.py index 5caabeed7ce..c8a3fface44 100644 --- a/onnx/reference/ops/_op_list.py +++ b/onnx/reference/ops/_op_list.py @@ -114,6 +114,7 @@ from onnx.reference.ops.op_hardmax import Hardmax from onnx.reference.ops.op_identity import Identity from onnx.reference.ops.op_if import If +from onnx.reference.ops.op_image_decoder import ImageDecoder from onnx.reference.ops.op_instance_normalization import InstanceNormalization from onnx.reference.ops.op_isinf import IsInf from onnx.reference.ops.op_isnan import IsNaN diff --git a/onnx/reference/ops/op_image_decoder.py b/onnx/reference/ops/op_image_decoder.py new file mode 100644 index 00000000000..1b1090b478b --- /dev/null +++ b/onnx/reference/ops/op_image_decoder.py @@ -0,0 +1,29 @@ +# Copyright (c) ONNX Project Contributors + +# SPDX-License-Identifier: Apache-2.0 +# pylint: disable=C0123,C3001,R0912,R0913,R0914,R1730,W0221,W0613 + +import cv2 +import numpy as np + +from onnx.reference.op_run import OpRun + + +class ImageDecoder(OpRun): + def _run( # type: ignore + self, + encoded, + pixel_format="RGB", + ): + decoded = None + if pixel_format == "BGR": + decoded = cv2.imdecode(encoded, cv2.IMREAD_COLOR) + elif pixel_format == "RGB": + decoded = cv2.imdecode(encoded, cv2.IMREAD_COLOR) + decoded = cv2.cvtColor(decoded, cv2.COLOR_BGR2RGB) + elif pixel_format == "Grayscale": + decoded = cv2.imdecode(encoded, cv2.IMREAD_GRAYSCALE) + decoded = np.expand_dims(decoded, axis=2) # (H, W) to (H, W, 1) + else: + raise RuntimeError(f"pixel_format={pixel_format!r} is not supported.") + return (decoded,) diff --git a/onnx/test/automatic_upgrade_test.py b/onnx/test/automatic_upgrade_test.py index 8fa6dea19c5..94cb1146879 100644 --- a/onnx/test/automatic_upgrade_test.py +++ b/onnx/test/automatic_upgrade_test.py @@ -598,6 +598,16 @@ def test_If(self) -> None: attrs={"then_branch": then_graph, "else_branch": else_graph}, ) + def test_ImageDecoder(self) -> None: + self._test_op_upgrade( + "ImageDecoder", + 20, + [[None]], + [[None, None, 3]], + input_types=[TensorProto.UINT8], + output_types=[TensorProto.UINT8], + ) + def test_InstanceNormalization(self) -> None: self._test_op_upgrade( "InstanceNormalization", diff --git a/onnx/test/test_backend_onnxruntime.py b/onnx/test/test_backend_onnxruntime.py index 974e7e0c378..ca909797cb2 100644 --- a/onnx/test/test_backend_onnxruntime.py +++ b/onnx/test/test_backend_onnxruntime.py @@ -256,6 +256,7 @@ def run_node(cls, node, inputs, device=None, outputs_info=None, **kwargs): "|string_split" "|string_concat" "|gelu" + "|image_decoder" ")" ) diff --git a/requirements-dev.txt b/requirements-dev.txt index 66aa8f93a9d..2da762ee3fd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -11,6 +11,6 @@ twine # Dependencies for linting. Versions match those in setup.py. lintrunner>=0.10.7 lintrunner-adapters>=0.8 -# Dependencies for the reference implementation. -google-re2 # Edit additional linter dependencies in requirements-lintrunner.txt +# Dependencies for the reference implementation. +-r requirements-reference.txt diff --git a/requirements-reference.txt b/requirements-reference.txt index 2347a47f5cb..d03b30f5747 100644 --- a/requirements-reference.txt +++ b/requirements-reference.txt @@ -1 +1,2 @@ google-re2 +opencv-python \ No newline at end of file