openvinotoolkit / openvino

OpenVINO™ is an open-source toolkit for optimizing and deploying AI inference
https://docs.openvino.ai
Apache License 2.0
6.49k stars 2.11k forks source link

[Good First Issue]: Extend Python API with `ROIAlignRotated-15` #25325

Open mitruska opened 2 weeks ago

mitruska commented 2 weeks ago

Context

Instead of doing C++ to Python bindings for each and every OpenVINO operator, we are using internal NodeFactory, which takes the name of the operator as an argument:

op = NodeFactory().create("ROIAlignRotated", *args, **kwargs)  # pseudocode

Such an API is counter intuitive for an end user, so we are also adding Python API with a proper, pythonic and clear functions. Those Python functions are just wrappers around NodeFactory object call, and their primary goal is to provide appropriate inputs docs and more pythonic API:

op = ops.roi_align_rotated(*args, **kwargs)  # pseudocode

This task regards adding such a Python API function for ROIAlignRotated-15 operator.

What needs to be done?

  1. Extend Python API and Python compatibility API with ROIAlignRotated (operator should be added to the opset15/ops.py)
  2. Add tests for both APIs
  3. Create a PR

ROIAlignRotated is a similar op to ROIAlign, with some modifications to enable rotation.

Python API roi_align can be used as an example: https://github.com/openvinotoolkit/openvino/blob/bc505ba8ddafe938e01fa5530ac5d6cc492efe17/src/bindings/python/src/openvino/runtime/opset9/ops.py#L97-L141

Python API roi_align_rotated function should reflect ROIAlignRotated C++ constructor: https://github.com/openvinotoolkit/openvino/blob/bc505ba8ddafe938e01fa5530ac5d6cc492efe17/src/core/include/openvino/op/roi_align_rotated.hpp#L20-L39

Please see attached PR, this task is very similar to the linked Col2Im Python API.

Example Pull Requests

https://github.com/openvinotoolkit/openvino/pull/24569

Resources

Contact points

@mitruska @p-wysocki @akuporos

Ticket

141569

awayzjj commented 2 weeks ago

.take

github-actions[bot] commented 2 weeks ago

Thank you for looking into this issue! Please let us know if you have any questions or require any help.