修改代码:https://github.com/ultralytics/yolov5/blob/master/detect.py
搜索# Write results定位代码
增加代码:
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]) + ")")
输出结果: