openvinotoolkit/openvino

[Good First Issue]: Extend `PrePostProcessor` module with `Clamp`

Open

#24.996 geöffnet am 13. Juni 2024

Auf GitHub ansehen
 (16 Kommentare) (0 Reaktionen) (1 zugewiesene Person)C++ (3.229 Forks)auto 404
good first issueno_stale

Repository-Metriken

Stars
 (10.286 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 14T 3h) (305 gemergte PRs in 30 T)

Beschreibung

Context

Some models require preprocessing done to the data before inference. Usually it's done with packages like numpy or pillow for images, but it adds dependencies and additional steps to the inference pipeline, not to mention that these steps may not be properly performant.

PrePostProcessor module allows users to define such preprocessing steps (also postprocessing if you need it), and then embed it into the graph. It not only fixes the issues mentioned above, but also allows OpenVINO graph transformations and performance improvements to take place, increasing overall inference performance.

Lately there has been a request for a new PrePostProcessor operation - Clamp: https://github.com/openvinotoolkit/openvino/issues/23001. The issue contains information relevant to the task, it's recommended to read it.

What needs to be done?

  1. Modify https://github.com/openvinotoolkit/openvino/blob/master/src/core/src/preprocess/pre_post_process.cpp to include Clamp operation. It should most likely be placed in PreProcessSteps section at https://github.com/openvinotoolkit/openvino/blob/master/src/core/src/preprocess/pre_post_process.cpp#L257.
  2. Add the implementation to https://github.com/openvinotoolkit/openvino/blob/master/src/core/src/preprocess/preprocess_steps_impl.cpp

The implementation is preferred to use existing OpenVINO operators - in this case we have a perfect operator for that: https://docs.openvino.ai/2024/documentation/openvino-ir-format/operation-sets/operation-specs/activation/clamp-1.html 3. Add tests to https://github.com/openvinotoolkit/openvino/blob/master/src/core/tests/preprocess.cpp

Example Pull Requests

Resources

Contact points

@p-wysocki

Ticket

N/A

Contributor Guide