-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PyOV] Add torchvision to OpenVINO preprocessing converter #17934
Conversation
src/bindings/python/tests/test_torchvision_to_ov/test_preprocessor.py
Outdated
Show resolved
Hide resolved
|
||
from openvino.preprocess.torchvision_to_ov import PreprocessConverter | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think it makes sense to add it into PyTorch layer tests scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests do not match the definition of layer tests. If there's a better place we can put preprocessing tests I'll move them somewhere else, but I don't think they belong to openvino/tests/layer_tests
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem we have here is that different categories of tests (read as "folder with python code") require the same frameworks.
And it results to the fact we have requirements files, where we have a lot of frameworks like ONNX and PT. We already have a ticket (and PR) to move ONNX tests from python folder to folder closer to ONNX FE. Similar with PR tests - what are we testing here? Python API ? or integration with PT? I suppose the later one, so here I aligned with @rkazants that such tests are closer to PT tests, which allows to group tests by frameworks:
- (No frameworks) - OpenVINO Python API, which does not require heavy dependencies
- (PT) - PT Layer tests, PT decoder, preprocessing tests
- (ONNX) - ONNX tests
- ...
Alternatively, we need to create tox.ini files where developers can test only Python API or only PT preprocessing or only interaction of ONNX and OpenVINO. Currently, we have a mix of everything in one place - OpenVINO Python API, ONNX tests and newly introduced PT preprocessing, also we have different decoders in openvino.frontends package. And it's hard to test everything together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One remark.
Details:
Tools for converting a
torchvision.transforms
object into OpenVINO preprocessingBased on @AlexKoff88's POC
List of supported torchvision transforms:
Bindings for PILLOW interpolation modes
Example use case:
Tickets:
TODO
add test cases fortorch.nn.Sequential
object instead oftorchvision.transforms.Compose
torch.nn.Sequential
does not work with PIL objects https://pytorch.org/vision/stable/transforms.html#transforms-scriptabilityadd tests for PILLOW interpolation modes bindings