Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6551 Discussions

How to setup prepostprocessor if input tensor more than 4 dimensions in c++?

AlloyHsu
Novice
1,545 Views

Hello,

 

I have a model with input dimensions [1,1,224,224,3].
represents
[batch, frames, height, weight, channel]

How do I set the layout of my PrePostProcessor? Is the following correct?

 

 

// Try fill cv::Mat (BGR format to input tensor

ov::preprocess::PrePostProcessor ppp(model);
 
ppp.input("image").tensor().set_element_type(ov::element::u8).set_color_format(ov::preprocess::ColorFormat::BGR).set_layout("N?HWC");
ppp.input().preprocess().convert_element_type(ov::element::f32);
ppp.input().preprocess().scale({ 255.0, 255.0, 255.0 });
ppp.input().preprocess().convert_layout("NCHW");
ppp.input().preprocess().convert_color(ov::preprocess::ColorFormat::RGB);
 
model = ppp.build();
0 Kudos
11 Replies
Vipin_S_Intel
Moderator
1,475 Views

Hi Alloy, could you please provide us with the following details?


  • The exact name and build version of the Intel® Toolkit you’re using.
  • The operating system and its build version.
  • Whether the product has been installed.
  • A detailed explanation of your query, along with a screenshot if possible.


To assist you further, we would require these details.


0 Kudos
AlloyHsu
Novice
1,392 Views
  • The exact name and build version of the Intel® Toolkit you’re using.
    w_openvino_toolkit_windows_2024.2.0.15519.5c0f38f83f6_x86_64
  • The operating system and its build version.
    WIN10 22H2
  • Whether the product has been installed.
    Yes
  • A detailed explanation of your query, along with a screenshot if possible.
    As above
0 Kudos
Witold_Intel
Employee
1,185 Views

Hi AlloyHsu,

 

we have a comment from the OpenVino developers. They ask "Why do you need "frames" dimension? can it be merged with "batch"?" Could you elaborate on that please? Thanks in advance.

0 Kudos
AlloyHsu
Novice
1,155 Views

I just want porting MoViNet Video Action Recognition which create by google.

MoViNet input dimensions are as follows: [batch_size, number_of_frames, height, width, channels]

0 Kudos
Vipin_S_Intel
Moderator
1,360 Views

Hi Alloy, thank you for sharing the required information. We would like to inform you that we are routing your query to the dedicated team for further assistance.


Witold_Intel
Employee
1,152 Views

@AloyHsu thank you for explaining the dimensions. I will share this information with the developers.


0 Kudos
Witold_Intel
Employee
1,111 Views

Hi @AloyHsu, there is a suggestion from the devs:

> ppp.input().preprocess().convert_layout("NCHW");


 Maybe you can try ppp.input().preprocess().convert_layout("N?CHW") ? OpenVINO does not know how to convert N?HWC to NCHW, because "?" dimension is unknown. Would this be a valid solution for you?


AlloyHsu
Novice
1,065 Views

ppp.input().preprocess().convert_layout("N?HWC") work for me

 

0 Kudos
Witold_Intel
Employee
1,045 Views

Hi Alloy, this is great news. Do you need further support from us or can we close this case?


0 Kudos
Witold_Intel
Employee
934 Views

Hi Alloy, do you need further support from us? I will have to close this case if there is no response for 7 business days.


0 Kudos
Zulkifli_Intel
Moderator
793 Views

Thank you for your question. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored.


0 Kudos
Reply