关于fluid.layers.detection 中函数使用的疑问
Created by: WangTaoSpace
detection_output 这个函数的功能是否等同于 box_coder(解码)+ multiclass_nms 我针对官方ssd模型的输出利用上面两种方法获取nms_out进行比较发现差距比较大。部分代码如下 1.
image = fluid.layers.data(name='image', shape=[3,300,300], dtype='float32')
locs, confs, box, box_var = mobilenet_ssd.build_mobilenet_ssd(image, 81, [3,300,300])
boxes = fluid.layers.box_coder(box,box_var,locs,code_type="decode_center_size")
scores = fluid.layers.transpose(confs,perm=[0,2,1])
nms_out = fluid.layers.multiclass_nms(
bboxes=boxes,
scores=scores,
score_threshold=0.01,
nms_top_k=-1,
nms_threshold=0.45,
keep_top_k=-1,
normalized=False)
image = fluid.layers.data(name='image', shape=[3,300,300], dtype='float32')
locs, confs, box, box_var = mobilenet_ssd.build_mobilenet_ssd(image, 81, [3,300,300])
nms_out = fluid.layers.detection_output(
locs, confs, box, box_var, nms_threshold=0.45)
如果第一种方法有误,望指点正确的操作,谢谢。