detectron2做目标检测的结果(坐标)
from PIL import Image, ImageDraw
img_file_name = '/Users/xuehuiping/Downloads/改进点/WX20210406-173135@2x.png'
im = Image.open(img_file_name)
draw = ImageDraw.Draw(im) # 实例化一个对象
x1, y1, x2, y2, = 1122.2716, 687.9698, 1549.0522, 994.3609
# 左上角坐标x,y;右下角坐标x,y
draw.rectangle((x1, y1, x2, y2), outline=(0, 255, 0))
im.show()
绿色的是重新画上去的