提交 a8c8d9a8 authored 作者: blu's avatar blu

ai.detect: anchor region box

上级 f99bf983
...@@ -23,7 +23,6 @@ def get_args(): ...@@ -23,7 +23,6 @@ def get_args():
args = parser.parse_args() args = parser.parse_args()
return args return args
def test(opt): def test(opt):
tsEpoch = datetime.datetime.utcfromtimestamp(0) tsEpoch = datetime.datetime.utcfromtimestamp(0)
model = torch.load(opt.pretrained_model, map_location='cpu').module model = torch.load(opt.pretrained_model, map_location='cpu').module
...@@ -128,8 +127,10 @@ def test(opt): ...@@ -128,8 +127,10 @@ def test(opt):
xmin, ymin, xmax, ymax = boxes[box_id, :] xmin, ymin, xmax, ymax = boxes[box_id, :]
color = colors[pred_label] color = colors[pred_label]
color = (255, 0, 0) color = (255, 0, 0)
colorG = (0, 255, 0)
font = cv2.FONT_HERSHEY_PLAIN font = cv2.FONT_HERSHEY_PLAIN
cv2.rectangle(output_image, (xmin, ymin), (xmax, ymax), color, 1) cv2.rectangle(output_image, (xmin, ymin), (xmax, ymax), color, 1)
cv2.rectangle(output_image, (px1, py1), (px2, py2), colorG, 1)
text_size = cv2.getTextSize( text_size = cv2.getTextSize(
COCO_CLASSES[pred_label] + ' : %.2f' % pred_prob, font, 1, 1)[0] COCO_CLASSES[pred_label] + ' : %.2f' % pred_prob, font, 1, 1)[0]
cv2.rectangle(output_image, (xmin, ymin), (xmin + cv2.rectangle(output_image, (xmin, ymin), (xmin +
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论