Face detection model doesn't detect any face (OpenCV with IE) [closed]
Hi, I've compile OpenCV with inference engine (IE) successfully. Since I'm using OpenCVSharp, I've also complied it with OpenCV with IE. Then, when I try to detect faces with the model face-detection-adas-0001 it doesn't detect any faces. The model is loaded successfully, it seems to do the foward pass but the output Mat has always col=-1 and row=-1. Although I'm using C#, if someone has already used this model in C++, please clarify how the input blob should be. I think that is probably what I'm getting wrong. Here is the code:
var net = CvDnn.ReadNet(model, modeltxt);
var image = System.IO.Path.Combine(Location, sampleImage);
var frame = Cv2.ImRead(image);
net.SetPreferableBackend(Net.Backend.INFERENCE_ENGINE);
net.SetPreferableTarget(Net.Target.CPU);
var frame = Cv2.ImRead(image);
var test = new Mat();
frame.ConvertTo(test, MatType.CV_8U);
var blob = CvDnn.BlobFromImage(test, 1.0, new OpenCvSharp.Size(672, 384), default, false, false);
net.SetInput(blob);
var outNames = net.GetUnconnectedOutLayersNames();
using (var predictions = net.Forward(outNames[0]))
{
PrintMat(predictions);
}
Thanks!
sorry to say so, but totally off-topic/unsupported 3rd party effort
(don't get me wrong, i like it, but noone here will be able to help you with specific api bugs of that)
bs. it's already like that (CV_8UC3, to be exact)
did you ever check, if
var frame = Cv2.ImRead(image)
;is valid ? `
Hi, I've managed to solve it. The code is correct but I was not accessing the output data from the net correctly. So here is the code if anyone needs in the future: