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.

OpenVino : output of one network is input for another one

jain__ankit
Beginner
625 Views

Is it possible to pass the output blob object of face-detection-model to emotion-detection model and get the results ?

If yes, could you please elaborate .

Thanks in advance.

0 Kudos
4 Replies
Shubha_R_Intel
Employee
625 Views

ankit, may I understand your use-case better ? Please take a look at deployment_tools\inference_engine\samples\interactive_face_detection_demo.  In this sample we detect faces and then pass detected boxes to the pre-trained emotion_detection networks (also, depending on a user’s needs ageGender, HeadPose and FacialLandmark recognition networks can also be used in the pipeline using intel pre-trained models).

 

0 Kudos
jain__ankit
Beginner
625 Views

Hi Shubha

I have refered the OpenVino  documentation : computer_vision_sdk_2018.4.420/deployment_tools/documentation/docs/_docs_IE_DG_Integrate_with_customer_application_new_API.html

Optimal way for a cascade of networks (output of one network is input for another). Get output blob from the first request using InferenceEngine::InferRequest::GetBlob() and set it as input for the second request using InferenceEngine::InferRequest::SetBlob().

auto output = infer_request1->GetBlob(output_name);

infer_request2->SetBlob(input_name, output);

In interactive_face_detection_demo, I have observed that the cropped face (output from face detection)  cv::mat is used as input for successive models (geGender, HeadPose and FacialLandmark recognition networks). 

In another example  security_barrier_demo, the approach of  make_shared_blob & ROI is used.

But nowhere i am  able to find example for cascade of networks , where the above approach(Optimal way for a cascade of networks) is used.

Could you please share us an example.

Thanks in advance.

0 Kudos
Shubha_R_Intel
Employee
625 Views

Hello Ankit. We don't have cascading demos. But you can still try and make it work or simply wait for a stable version in a near-term future release.

So if you are talking about cascade implementation exactly (when input blob of second network just points to output blob of first network to avoid unnecessary copies) then OpenVino does not have such demos... In this case input shape of second network must be equal to output shape of first network. But sometimes, if output size of first network is always fixed (e.g. not bounding boxes but something else) then before loading to a plugin you can just reshape second network to sizes of output from the first network. And then you can put 2 networks in cascade. `reshape()` method is described as a part of Shape Inference functionality. But please note that in R5 we don’t have complete implementation of ShapeInference feature.  So, it’s possible that not all layers of the network will be able to be reshaped. And the reshape will fail. OpenVino plans to have more or less stable version in a future release.

 

0 Kudos
Hyodo__Katsuya
Innovator
625 Views

My Github.

It is a sample program of cascade reasoning. (Python)

Please replace with C++.

https://github.com/PINTO0309/OpenVINO-EmotionRecognition.git

 

0 Kudos
Reply