YOLOv3模型修改prototx文件来添加YoloV3DetectionOutput算子以实现DetectionOutput功能

对于YOLOv3,首先要加一个img输入

input:"img_info"
input_shape{
  dim:1
  dim:4
}

因为YOLO有三个输出,所以在增加YoloV3DetectionOutput算子之前需要先增加三个Yolo算子,分别对应三个输出结果

layer {
	bottom: "374"#对应输出的数值
	top: "yolo1_coords"
	top: "yolo1_obj"
	top: "yolo1_classes"
	name: "yolo1"
	type: "Yolo"
	yolo_param {
		boxes: 3
		coords: 4
		classes: 9  
		yolo_version: "V3"
		softmax: true
		background: false
    }
}
layer {
	bottom: "360"
	top: "yolo2_coords"
	top: "yolo2_obj"
	top: "yolo2_classes"
	name: "yolo2"
	type: "Yolo"
	yolo_param {
		boxes: 3
		coords: 4
		classes: 9
		yolo_version: "V3"
		softmax: true
		background: false
	}
}
layer {
	bottom: "output"
	top: "yolo3_coords"
	top: "yolo3_obj"
	top: "yolo3_classes"
	name: "yolo3"
	type: "Yolo"
	yolo_param {
		boxes: 3
		coords: 4
		classes: 9
		yolo_version: "V3"
		softmax: true
		background: false
	}
}

YoloV3DetectionOutput算子有十个输入,两个输出;根据该原则,构造的后处理算子代码样例如下:

layer {
       name: "detection_out3"
       type: "YoloV3DetectionOutput"
       bottom: "yolo1_coords" #对应刚刚写好的三个算子
       bottom: "yolo2_coords"
       bottom: "yolo3_coords"
       bottom: "yolo1_obj"
       bottom: "yolo2_obj" 
       bottom: "yolo3_obj"
       bottom: "yolo1_classes"
       bottom: "yolo2_classes"
       bottom: "yolo3_classes" 
      bottom: "img_info"
       top: "box_out"
       top: "box_out_num"
       yolov3_detection_output_param {
                           boxes: 3
                           classes: 9
                           relative: true
                           obj_threshold: 0.5
                           score_threshold: 0.5
                           iou_threshold: 0.45
                           pre_nms_topn: 512
                           post_nms_topn: 1024
                           biases_high: 18
                           biases_high: 52
                           biases_high: 50
                           biases_high: 50
                           biases_high: 87
                           biases_high: 103
                           biases_mid: 10
                           biases_mid: 29  
                           biases_mid: 22
                           biases_mid: 18
                           biases_mid: 31
                           biases_mid: 30
                           biases_low: 9
                           biases_low: 12
                           biases_low: 7
                           biases_low: 18
                           biases_low: 14
                           biases_low: 14
       }
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值