1

I want to do object recognition on my webcam input with c#. First I was able to do it with yolov3 but it was too slow. So I wanted to try it with tiny-yolov3. But all the outputs seem to be "Not a number" all the time and consequently there are no objects detected. When changing the code from yolov3 to tiny-yolov3 I only changed the model- and the weight-file path to the ones of tiny-yolov3. Do I have to do other changes? The number of output-layers should be the same.

I use the following code to initiate and progress through the neural net:

capture.Read(frame);

var blob = CvDnn.BlobFromImage(frame, 1.0 / 255, new Size(416, 416), new Scalar(), true, false);

var net = Net.ReadNetFromDarknet(cfg, weights);

net.SetPreferableTarget(0);

net.SetInput(blob);

var outNames = net.GetUnconnectedOutLayersNames();

var outs = outNames.Select(_ => new Mat()).ToArray();

net.Forward(outs, outNames);
Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
Ingo D
  • 11
  • 1

0 Answers0