Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to infer head pose

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 find in python. Anyone might know how to get the output from the network?

How to infer head pose

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?

How to infer head pose

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?