最新版本YOLOv5输出检测到的边界框的坐标、类别以及置信度

修改代码:https://github.com/ultralytics/yolov5/blob/master/detect.py

搜索# Write results定位代码

最新版本YOLOv5输出检测到的边界框的坐标、类别以及置信度_第1张图片

增加代码:

c1, c2 = (int(xyxy[0]), int(xyxy[1])), (int(xyxy[2]), int(xyxy[3]))
label = '%s %.2f' % (names[int(cls)], conf)
print(label + " (" + str(c1[0]) + "," + str(c1[1]) + "," + str(c2[0]) + "," + str(c2[1]) + ")")

输出结果:

你可能感兴趣的:(机器学习,YOLO,大模型,机器学习)