Add python bindings for PILLOW interpolation modes (#21188)

This commit is contained in:
Meet Patel
2023-11-21 04:09:05 +05:30
committed by GitHub
parent 570817998d
commit 20af42cfd9
2 changed files with 13 additions and 0 deletions

View File

@@ -464,6 +464,8 @@ static void regenum_graph_ResizeAlgorithm(py::module m) {
.value("RESIZE_LINEAR", ov::preprocess::ResizeAlgorithm::RESIZE_LINEAR)
.value("RESIZE_CUBIC", ov::preprocess::ResizeAlgorithm::RESIZE_CUBIC)
.value("RESIZE_NEAREST", ov::preprocess::ResizeAlgorithm::RESIZE_NEAREST)
.value("RESIZE_BILINEAR_PILLOW", ov::preprocess::ResizeAlgorithm::RESIZE_BILINEAR_PILLOW)
.value("RESIZE_BICUBIC_PILLOW", ov::preprocess::ResizeAlgorithm::RESIZE_BICUBIC_PILLOW)
.export_values();
}

View File

@@ -364,6 +364,17 @@ def test_graph_preprocess_set_memory_type():
(ResizeAlgorithm.RESIZE_NEAREST, ColorFormat.BGR, ColorFormat.NV12_SINGLE_PLANE, True),
(ResizeAlgorithm.RESIZE_NEAREST, ColorFormat.BGR, ColorFormat.NV12_TWO_PLANES, True),
(ResizeAlgorithm.RESIZE_NEAREST, ColorFormat.BGR, ColorFormat.UNDEFINED, True),
(ResizeAlgorithm.RESIZE_BILINEAR_PILLOW, ColorFormat.UNDEFINED, ColorFormat.BGR, True),
(ResizeAlgorithm.RESIZE_BILINEAR_PILLOW, ColorFormat.RGB, ColorFormat.NV12_SINGLE_PLANE, True),
(ResizeAlgorithm.RESIZE_BILINEAR_PILLOW, ColorFormat.RGB, ColorFormat.RGBX, True),
(ResizeAlgorithm.RESIZE_BILINEAR_PILLOW, ColorFormat.RGB, ColorFormat.BGRX, True),
(ResizeAlgorithm.RESIZE_BILINEAR_PILLOW, ColorFormat.RGB, ColorFormat.NV12_TWO_PLANES, True),
(ResizeAlgorithm.RESIZE_BILINEAR_PILLOW, ColorFormat.UNDEFINED, ColorFormat.I420_SINGLE_PLANE, True),
(ResizeAlgorithm.RESIZE_BICUBIC_PILLOW, ColorFormat.RGB, ColorFormat.UNDEFINED, True),
(ResizeAlgorithm.RESIZE_BICUBIC_PILLOW, ColorFormat.RGB, ColorFormat.BGR, False),
(ResizeAlgorithm.RESIZE_BICUBIC_PILLOW, ColorFormat.BGR, ColorFormat.RGB, False),
(ResizeAlgorithm.RESIZE_BICUBIC_PILLOW, ColorFormat.BGR, ColorFormat.RGBX, True),
(ResizeAlgorithm.RESIZE_BICUBIC_PILLOW, ColorFormat.BGR, ColorFormat.BGRX, True),
])
def test_graph_preprocess_steps(algorithm, color_format1, color_format2, is_failing):
shape = [1, 3, 3, 3]