Ask Your Question
0

YOLO v2 outputs zero scores and classes

asked 2018-06-13 04:27:44 -0500

Hello,

I'm trying to test Yolo v2 working in C++. I have replicated in my own project the example code to perform object detection from:

OpenCV DNN Object Detection Sample

My code is correctly working with Faster-RCNN VGG/ZF however, when I try YOLO I get an output of bounding boxes but all of them have associated score 0 and class 0 which I assume is not correct.

Y have downloaded and compiled the last GitHub version of OpenCV with the contrib modules.

Has anyone faced this issue and knows what may be wrong?

edit retag flag offensive close merge delete

Comments

@AlexLopez, please specify all the steps to help us reproduce your problem. Attach an image, command line arguments, network reference (there are different YOLOs fot 416x416 and 608x608 input resolutions).

dkurt gravatar imagedkurt ( 2018-06-14 02:47:25 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-06-21 06:28:41 -0500

const char* keys =
"{ help  h     | | Print help message. }"
"{ device      |  1 | camera device number. }"
"{ input i     | | Path to input image or video file. Skip this argument to capture frames from a camera. }"
"{ model m     | yolov2-tiny.weights | Path to a binary file of model contains trained weights. "
                  "It could be a file with extensions .caffemodel (Caffe), "
                  ".pb (TensorFlow), .t7 or .net (Torch), .weights (Darknet).}"
"{ config c    | yolov2-tiny.cfg | Path to a text file of model contains network configuration. "
                  "It could be a file with extensions .prototxt (Caffe), .pbtxt (TensorFlow), .cfg (Darknet).}"
"{ framework f | | Optional name of an origin framework of the model. Detect it automatically if it does not set. }"
"{ classes     | coco.names | Optional path to a text file with names of classes to label detected objects. }"
"{ mean        |  | Preprocess input image by subtracting mean values. Mean values should be in BGR order and delimited by spaces. }"
"{ scale       |  0.003921.f | Preprocess input image by multiplying on a scale factor. }"
"{ width       | 416 | Preprocess input image by resizing to a specific width. }"
"{ height      | 416 | Preprocess input image by resizing to a specific height. }"
"{ rgb         |  1  | Indicate that model works with RGB input images instead BGR ones. }"
"{ thr         | .5 | Confidence threshold. }"
"{ backend     |  0 | Choose one of computation backends: "
                     "0: automatically (by default), "
                     "1: Halide language (http://halide-lang.org/), "
                     "2: Intel's Deep Learning Inference Engine (https://software.intel.com/openvino-toolkit), "
                     "3: OpenCV implementation }"
"{ target      | 0 | Choose one of target computation devices: "
                     "0: CPU target (by default), "
                     "1: OpenCL, "
                     "2: OpenCL fp16 (half-float precision), "
                     "3: VPU }";

scale: 0.003921.f = 1/255.f

This is how I configured it. It works well.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-06-13 04:27:44 -0500

Seen: 22 times

Last updated: Jun 13