openvino icon indicating copy to clipboard operation
openvino copied to clipboard

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

Open p-wysocki opened this issue 1 year ago • 11 comments

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

p-wysocki avatar Jun 13 '24 09:06 p-wysocki

I would like to work on this issue. Could you please assign this to me?

amansharma612 avatar Jun 14 '24 01:06 amansharma612

The task is yours @amansharma612, have fun :)

mlukasze avatar Jun 14 '24 04:06 mlukasze

any updates @amansharma612?

mlukasze avatar Jul 25 '24 06:07 mlukasze

Hey, @mlukasze been AFK for quite some time due to some work, thanks for reminding. I'll get working on this now and give you updates soon.

amansharma612 avatar Jul 25 '24 11:07 amansharma612

awesome, thank you!

mlukasze avatar Jul 25 '24 11:07 mlukasze

If this task is not done yet, may I take the lead??

Diya910 avatar Aug 25 '24 03:08 Diya910

Yes you can

amansharma612 avatar Aug 25 '24 04:08 amansharma612

I did some changes in the code and while i was testing , i downloaded openvino toolkit and cmake and build whole code using it. But I am not able to run the preprocess file. Could you help me with that as this is my first contribution to open source and I am eager to learn it.

Diya910 avatar Aug 27 '24 14:08 Diya910

Can you please check my pull request some of the cases are passed and some of them are failed. I don't know what these cases exactly mean.

Diya910 avatar Aug 27 '24 15:08 Diya910

this one, right? https://github.com/openvinotoolkit/openvino/pull/26240

mlukasze avatar Aug 28 '24 05:08 mlukasze

yess

Diya910 avatar Aug 28 '24 06:08 Diya910

If this task is open, I would like to work on it.

vatsalashanubhag avatar Nov 25 '24 12:11 vatsalashanubhag

it's yours now, @vatsalashanubhag :)

mlukasze avatar Nov 25 '24 12:11 mlukasze

Hi, please help me enable all CI checks for the Pull Request: https://github.com/openvinotoolkit/openvino/pull/27973

vatsalashanubhag avatar Dec 09 '24 09:12 vatsalashanubhag