未验证 提交 1632c27d 编写于 作者: livingbody's avatar livingbody 提交者: GitHub

Update Pillow version to 10.0.0 (#8446)

* Update Pillow version to 10.0.0

* upgrade pillow to 10.0.0

* Update Pillow version to 10.0.0
上级 49074b0b
...@@ -109,7 +109,8 @@ def draw_box(im, np_boxes, labels, threshold=0.5): ...@@ -109,7 +109,8 @@ def draw_box(im, np_boxes, labels, threshold=0.5):
# draw label # draw label
text = "{} {:.4f}".format(labels[clsid], score) text = "{} {:.4f}".format(labels[clsid], score)
tw, th = draw.textsize(text) left, top, right, bottom = draw.textbbox(text)
tw, th = right - left, bottom - top
draw.rectangle( draw.rectangle(
[(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill=color) [(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill=color)
draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255)) draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
......
...@@ -159,7 +159,8 @@ def draw_box(im, np_boxes, labels, threshold=0.5): ...@@ -159,7 +159,8 @@ def draw_box(im, np_boxes, labels, threshold=0.5):
# draw label # draw label
text = "{} {:.4f}".format(labels[clsid], score) text = "{} {:.4f}".format(labels[clsid], score)
tw, th = draw.textsize(text) left, top, right, bottom = draw.textbbox(text)
tw, th = right - left, bottom - top
draw.rectangle( draw.rectangle(
[(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill=color) [(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill=color)
draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255)) draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
...@@ -497,7 +498,8 @@ def draw_press_box_lanes(im, np_boxes, labels, threshold=0.5): ...@@ -497,7 +498,8 @@ def draw_press_box_lanes(im, np_boxes, labels, threshold=0.5):
# draw label # draw label
text = "{}".format(labels[clsid]) text = "{}".format(labels[clsid])
tw, th = draw.textsize(text) left, top, right, bottom = draw.textbbox(text)
tw, th = right - left, bottom - top
draw.rectangle( draw.rectangle(
[(xmin + 1, ymax - th), (xmin + tw + 1, ymax)], fill=color) [(xmin + 1, ymax - th), (xmin + tw + 1, ymax)], fill=color)
draw.text((xmin + 1, ymax - th), text, fill=(0, 0, 255)) draw.text((xmin + 1, ymax - th), text, fill=(0, 0, 255))
...@@ -570,7 +572,8 @@ def visualize_vehicle_retrograde(im, mot_res, vehicle_retrograde_res): ...@@ -570,7 +572,8 @@ def visualize_vehicle_retrograde(im, mot_res, vehicle_retrograde_res):
# draw label # draw label
text = "retrograde" text = "retrograde"
tw, th = draw.textsize(text) left, top, right, bottom = draw.textbbox(text)
tw, th = right - left, bottom - top
draw.rectangle( draw.rectangle(
[(xmax + 1, ymin - th), (xmax + tw + 1, ymin)], [(xmax + 1, ymin - th), (xmax + tw + 1, ymin)],
fill=(0, 255, 0)) fill=(0, 255, 0))
......
...@@ -2212,7 +2212,8 @@ class DebugVisibleImage(BaseOperator): ...@@ -2212,7 +2212,8 @@ class DebugVisibleImage(BaseOperator):
fill='green') fill='green')
# draw label # draw label
text = str(gt_class[i][0]) text = str(gt_class[i][0])
tw, th = draw.textsize(text) left, top, right, bottom = draw.textbbox(text)
tw, th = right - left, bottom - top
draw.rectangle( draw.rectangle(
[(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill='green') [(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill='green')
draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255)) draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
......
...@@ -433,7 +433,8 @@ class VisibleRBox(BaseOperator): ...@@ -433,7 +433,8 @@ class VisibleRBox(BaseOperator):
xmin = min(x1, x2, x3, x4) xmin = min(x1, x2, x3, x4)
ymin = min(y1, y2, y3, y4) ymin = min(y1, y2, y3, y4)
text = str(gt_class[i][0]) text = str(gt_class[i][0])
tw, th = draw.textsize(text) left, top, right, bottom = draw.textbbox(text)
tw, th = right - left, bottom - top
draw.rectangle( draw.rectangle(
[(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill='green') [(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill='green')
draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255)) draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
......
...@@ -125,7 +125,8 @@ def draw_bbox(image, im_id, catid2name, bboxes, threshold): ...@@ -125,7 +125,8 @@ def draw_bbox(image, im_id, catid2name, bboxes, threshold):
# draw label # draw label
text = "{} {:.2f}".format(catid2name[catid], score) text = "{} {:.2f}".format(catid2name[catid], score)
tw, th = draw.textsize(text) left, top, right, bottom = draw.textbbox(text)
tw, th = right - left, bottom - top
draw.rectangle( draw.rectangle(
[(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill=color) [(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill=color)
draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255)) draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
......
...@@ -10,6 +10,7 @@ terminaltables ...@@ -10,6 +10,7 @@ terminaltables
Cython Cython
pycocotools pycocotools
setuptools setuptools
Pillow>=10.0.0
# for MOT evaluation and inference # for MOT evaluation and inference
lap lap
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册