Instead of
blobFromImage(frame, 1.0, Size(640, 480), Scalar(), true, false);
Try
Mat blob = blobFromImage(frame, 1/127.5, Size(300, 300), Scalar(127.5, 127.5, 127.5), true, false); net.setInput(blob); Mat detections = net.forward();