yolov3 SSD 生成detection truth

基本上都是在test检测文件中

SSD-tensorflow中的修改

ymin = int(bboxes[i, 0] * height)
            xmin = int(bboxes[i, 1] * width)
            ymax = int(bboxes[i, 2] * height)
            xmax = int(bboxes[i, 3] * width)
            # xmi.append(xmin)
            # ymi.append(ymin)
            # xma.append(xmax)
            # yma.append(ymax)
            if cls_id == 1:
                with open('/home/lab515/tt/code_jmy/SSD-Tensorflow/map/map/detections_txt/%s.txt' % name, 'a') as file:

                    file.writelines("columnar"+" "+str('{:.3f}'.format(score))+" "+ str(xmin)+" "+str(ymin)+" "+str(xmax)+" "+str(ymax))
                    file.write('\n')

yolov3-keras中的修改

top = max(0, np.floor(top + 0.5).astype('int32'))
            left = max(0, np.floor(left + 0.5).astype('int32'))
            bottom = min(image.size[1], np.floor(bottom + 0.5).astype('int32'))
            right = min(image.size[0], np.floor(right + 0.5).astype('int32'))

            if predicted_class == 'no':
                no = [left, top, right, bottom]
                label_a = '整体判断1,检测到正常行为 ' + str(score)
                ####jmy####

                with open('./map/detections_txt/%s.txt' % name, 'a') as file:
                    file.writelines(
                        "no" + " " + str('{:.3f}'.format(score)) + " " + str(left) + " " + str(top) + " " + str(right) + " " + str(bottom))
                    file.write('\n')
                ####jmy####

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值