How to infer head pose with IE

asked 2020-06-22 09:43:09 -0500

VCAS gravatar image

updated 2020-06-22 09:47:34 -0500

Hi!

I'm doing inference using OpenVino's head-pose-estimation-adas-0001 model in C# using OpenCvSharp.

My code is the following:

var blob2 = CvDnn.BlobFromImage(face, 1.0, new OpenCvSharp.Size(60, 60), new OpenCvSharp.Scalar(0, 0, 0), false, false);
netHead.SetInput(blob2);
var outNames = netHead.GetUnconnectedOutLayersNames(); // three layer names (yaw, pitch, and roll)
using (var detectAngles = netHead.Forward(outNames[0]))
{
     Debug.WriteLine(detectAngles.At<float>(0,0));
}

However, the value that I obtain is always 0. Which leads me to think that I'm not properly accessing the output of the network. The output is three layers (yaw, pitch, and roll) and the shape is [1,1]. I've tried to look for examples in C++ since OpenCvSharp is just a directly wrapper around OpenCV but I can only and barely find samples in python. Anyone might know how to get the output from the network?

edit retag flag offensive close merge delete

Comments

what about the other outputs ?

berak gravatar imageberak ( 2020-06-22 10:28:24 -0500 )edit
1

If I try outNames[1] it also gives me always zero. But if I try outNames[2] it seems that I get the angle values for yaw. But on Intel's website it says the the last layer should be roll. I've checked now on debug and the last is the yaw. However, pitch and rooll continues to be zero.

VCAS gravatar imageVCAS ( 2020-06-22 10:44:02 -0500 )edit