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.
6572 토론

Extracting a feature map of Convolution layer by inputing differebt image size

timosy
새로운 기여자 I
1,532 조회수

I'd like to extract feature map from Convolution layer by inputting
larg

레이블 (2)
0 포인트
1 솔루션
IntelSupport
관리자
1,486 조회수

Hi hep77to,

 

Thanks for reaching out.

 

OpenVINO™ provides capabilities to change model input shape during the runtime. You can set a new input shape with the reshape method. Refer to Changing input shapes for the details. The reshape method is useful in case you would like to feed model an input that has different size than model input shape.

 

Apart from that, the Hello Reshape SSD C++ Sample demonstrates how to do synchronous inference of object detection models using input reshape feature. Below is the reshape method used in the sample:


/ Step 5. Reshape model to image size and batch size

       // assume model layout NCHW

       const ov::Layout model_layout{"NCHW"};

 

       ov::Shape tensor_shape = model->input().get_shape();

 

       size_t batch_size = 1;

 

       tensor_shape[ov::layout::batch_idx(model_layout)] = batch_size;

       tensor_shape[ov::layout::channels_idx(model_layout)] = image_channels;

       tensor_shape[ov::layout::height_idx(model_layout)] = image_height;

       tensor_shape[ov::layout::width_idx(model_layout)] = image_width;

 

       std::cout << "Reshape network to the image size = [" << image_height << "x" << image_width << "] " << std::endl;

       model->reshape({{model->input().get_any_name(), tensor_shape}});

       printInputAndOutputsInfo(*model);

 

Hope this helps.

 

 

Regards,

Aznie


원본 게시물의 솔루션 보기

0 포인트
3 응답
IntelSupport
관리자
1,487 조회수

Hi hep77to,

 

Thanks for reaching out.

 

OpenVINO™ provides capabilities to change model input shape during the runtime. You can set a new input shape with the reshape method. Refer to Changing input shapes for the details. The reshape method is useful in case you would like to feed model an input that has different size than model input shape.

 

Apart from that, the Hello Reshape SSD C++ Sample demonstrates how to do synchronous inference of object detection models using input reshape feature. Below is the reshape method used in the sample:


/ Step 5. Reshape model to image size and batch size

       // assume model layout NCHW

       const ov::Layout model_layout{"NCHW"};

 

       ov::Shape tensor_shape = model->input().get_shape();

 

       size_t batch_size = 1;

 

       tensor_shape[ov::layout::batch_idx(model_layout)] = batch_size;

       tensor_shape[ov::layout::channels_idx(model_layout)] = image_channels;

       tensor_shape[ov::layout::height_idx(model_layout)] = image_height;

       tensor_shape[ov::layout::width_idx(model_layout)] = image_width;

 

       std::cout << "Reshape network to the image size = [" << image_height << "x" << image_width << "] " << std::endl;

       model->reshape({{model->input().get_any_name(), tensor_shape}});

       printInputAndOutputsInfo(*model);

 

Hope this helps.

 

 

Regards,

Aznie


0 포인트
timosy
새로운 기여자 I
1,478 조회수

Dear

Community Manager
 
 
 
 
 

 

Nice infoamtion!

Thanks a lot.

0 포인트
IntelSupport
관리자
1,464 조회수

Hi hep77to,


This thread will no longer be monitored since this we have provided the information. If you need any additional information from Intel, please submit a new question.



Regards,

Aznie


0 포인트
응답