BVLC/caffe

Caffe detection error

Closed this issue · 0 comments

I trained a net in caffe to detect an object ("describe" a bounding box of it). It works perfectly when there are object(s) which I trained the net on the image, although, when there isn't an object, the net returns to me the detection of the last image that had the object. It is possible to see in the log the message:

I0815 13:51:41.195493 476712 detection_output_layer.cu:120] Couldn't find any detections

I used this tutorial to create my code SSD Detection.
My code is almost the same:
`
self.net.blobs['data'].data[...] = np.zeros(shape=(self.image_resize, self.image_resize))
transformed_image = self.transformer.preprocess('data', image)
self.net.blobs['data'].data[...] = transformed_image

        # Forward pass.
        detections = []
        response_net = self.net.forward()
        detections = response_net['detection_out']

        # Parse the outputs.
        det_label = detections[0,0,:,1]
        det_conf = detections[0,0,:,2]
        det_xmin = detections[0,0,:,3]
        det_ymin = detections[0,0,:,4]
        det_xmax = detections[0,0,:,5]
        det_ymax = detections[0,0,:,6]

        top_indices = [i for i, conf in enumerate(det_conf) if conf >= THRESHOLD]

Does some one know the reason why it is happening? I'm using it in a wrong way?

Edit:
Already fixed in this commit.