Neural network 在caffe中,py更快的rcnn;分数“;返回一个大矩阵,为什么?

Neural network 在caffe中,py更快的rcnn;分数“;返回一个大矩阵,为什么?,neural-network,computer-vision,deep-learning,caffe,pycaffe,Neural Network,Computer Vision,Deep Learning,Caffe,Pycaffe,我使用py更快的rcnn演示来进一步构建我的项目,包括20个类。 然而,我试图获得softmax,我的类的最后一层概率 例如: # Load the demo image im_file = os.path.join(cfg.DATA_DIR, 'demo', image_name) im = cv2.imread(im_file) # Detect all object classes and regress object bounds timer = Timer() timer.tic(

我使用py更快的rcnn演示来进一步构建我的项目,包括20个类。 然而,我试图获得softmax,我的类的最后一层概率

例如:

# Load the demo image
im_file = os.path.join(cfg.DATA_DIR, 'demo', image_name)

im = cv2.imread(im_file)

# Detect all object classes and regress object bounds
timer = Timer()
timer.tic()
scores, boxes = im_detect(net, im)
timer.toc()
print ('Detection took {:.3f}s for '
       '{:d} object proposals').format(timer.total_time, boxes.shape[0])

# Visualize detections for each class
CONF_THRESH = 0.8
NMS_THRESH = 0.3
for cls_ind, cls in enumerate(CLASSES[1:]):
    cls_ind += 1 # because we skipped background
    cls_boxes = boxes[:, 4*cls_ind:4*(cls_ind + 1)]
    cls_scores = scores[:, cls_ind]
    dets = np.hstack((cls_boxes,
                      cls_scores[:, np.newaxis])).astype(np.float32)
    keep = nms(dets, NMS_THRESH)
    dets = dets[keep, :]
    vis_detections(im, cls, dets, thresh=CONF_THRESH)

print scores
当我打印分数时,它会给我一个非常大的矩阵输出, 而不是1 x 20。我不知道为什么,我怎样才能得到最后的概率矩阵


感谢原始
分数
检测器输出包括重叠检测和极低分数检测。
请注意,只有在使用
nms\u THRESH=0.3应用非最大抑制(也称为“nms”)后,功能
vis\u detection
仅显示置信度大于
CONF\u THRESH=0.8的检测

因此,如果您想查看“真实”对象,您需要检查内部
vis_detection
,只检查它在图像上呈现的检测

非常感谢你。所以,如果我想输出一个1x20矩阵(包括0就可以了)。我该怎么做?@UniversalStack您想打印哪个检测框的向量?@UniversalStack您需要向ck支付您感兴趣的检测框的索引,然后查看相应的
分数行
,我可以只返回一个概率矩阵(1x20)来表示没有框的整个图片吗?谢谢。@UniversalStack为什么???你是想进行图像分类还是目标检测?!