Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[Docs] Add Interpolate torchvision compatibility note (#37803)

Pawel Raasz7f71a0fc0c7a
diff --git a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/image/interpolate-11.rst b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/image/interpolate-11.rst
index d0916314b7a..38189c9443c 100644
--- a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/image/interpolate-11.rst
+++ b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/image/interpolate-11.rst
@@ -57,6 +57,13 @@ Interpolate
* **Type**: string
* **Default value**: ``round_prefer_floor``
* **Required**: *no*
+ * **Note**: Frameworks such as Pillow sample the source pixel with
+ ``floor((x_resized + 0.5) * scale)``, which is closest to ``coordinate_transformation_mode == half_pixel`` with
+ ``nearest_mode == round_prefer_ceil``, but exact equivalence is not guaranteed for all shapes. Consumers
+ requiring strict Pillow/torchvision parity should validate the selected combination against their target
+ input/output sizes. See the
+ :doc:`Torchvision Preprocessing Converter <../../../../../openvino-workflow/running-inference/optimize-inference/optimize-preprocessing/torchvision-preprocessing-converter>`
+ article for known limitations.
* *antialias*
@@ -145,4 +152,3 @@ Interpolate
</port>
</output>
</layer>
-
diff --git a/docs/articles_en/openvino-workflow/running-inference/optimize-inference/optimize-preprocessing/torchvision-preprocessing-converter.rst b/docs/articles_en/openvino-workflow/running-inference/optimize-inference/optimize-preprocessing/torchvision-preprocessing-converter.rst
index 0ce8354332a..8c74a43e5d6 100644
--- a/docs/articles_en/openvino-workflow/running-inference/optimize-inference/optimize-preprocessing/torchvision-preprocessing-converter.rst
+++ b/docs/articles_en/openvino-workflow/running-inference/optimize-inference/optimize-preprocessing/torchvision-preprocessing-converter.rst
@@ -33,6 +33,18 @@ the overall application complexity and enabling additional performance optimizat
transforms.Resize
+.. note::
+
+ ``transforms.Resize`` with ``InterpolationMode.NEAREST`` is implemented on top of the
+ ``Interpolate`` operator's ``nearest`` mode, configured with ``coordinate_transformation_mode``
+ and ``nearest_mode`` attributes chosen to closely mirror Pillow's rounding behavior. This
+ configuration is not guaranteed to be bit-exact with torchvision/Pillow for every
+ input/output size combination, especially for non-square images where the height and width
+ scale factors differ. See the ``nearest_mode`` note in the
+ :doc:`Interpolate <../../../../documentation/openvino-ir-format/operation-sets/operation-specs/image/interpolate-11>`
+ operation specification for details.
+
+
Example
###################