openvinotoolkit / model_api

https://openvinotoolkit.github.io/model_api/latest
Apache License 2.0
26 stars 16 forks source link

Difference of `fit_to_window` between python and opset #167

Closed sungchul2 closed 7 months ago

sungchul2 commented 8 months ago

fit_to_window for opset is resize_image_with_aspect and it has pad as well. https://github.com/openvinotoolkit/model_api/blob/41c20267122bed9fe9b21631166d15818f669379/model_api/python/model_api/adapters/utils.py#L358-L367

But, fit_to_window for python is resize_image_with_aspect_ocv and it doesn't have pad. It just does resize keeping aspect ratio. https://github.com/openvinotoolkit/model_api/blob/41c20267122bed9fe9b21631166d15818f669379/model_api/python/model_api/adapters/utils.py#L427-L430

I'd like to know if it is intended.

Wovchena commented 8 months ago

Not intended. But OpenCV version isn't used anywhere. It was left as a reference implementation. Apparently it diverged. Feel free to submit a fix and optionally a test. The test could create a dummy model without weights which does resize only.