Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Pillow version to 10.0.0 #8446

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion deploy/pptracking/python/mot/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def draw_box(im, np_boxes, labels, threshold=0.5):

# draw label
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(
[(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill=color)
draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
Expand Down
9 changes: 6 additions & 3 deletions deploy/python/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def draw_box(im, np_boxes, labels, threshold=0.5):

# draw label
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(
[(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill=color)
draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
Expand Down Expand Up @@ -497,7 +498,8 @@ def draw_press_box_lanes(im, np_boxes, labels, threshold=0.5):

# draw label
text = "{}".format(labels[clsid])
tw, th = draw.textsize(text)
left, top, right, bottom = draw.textbbox(text)
tw, th = right - left, bottom - top
draw.rectangle(
[(xmin + 1, ymax - th), (xmin + tw + 1, ymax)], fill=color)
draw.text((xmin + 1, ymax - th), text, fill=(0, 0, 255))
Expand Down Expand Up @@ -570,7 +572,8 @@ def visualize_vehicle_retrograde(im, mot_res, vehicle_retrograde_res):

# draw label
text = "retrograde"
tw, th = draw.textsize(text)
left, top, right, bottom = draw.textbbox(text)
tw, th = right - left, bottom - top
draw.rectangle(
[(xmax + 1, ymin - th), (xmax + tw + 1, ymin)],
fill=(0, 255, 0))
Expand Down
3 changes: 2 additions & 1 deletion ppdet/data/transform/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2212,7 +2212,8 @@ def apply(self, sample, context=None):
fill='green')
# draw label
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(
[(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill='green')
draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
Expand Down
3 changes: 2 additions & 1 deletion ppdet/data/transform/rotated_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ def apply(self, sample, context=None):
xmin = min(x1, x2, x3, x4)
ymin = min(y1, y2, y3, y4)
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(
[(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill='green')
draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
Expand Down
3 changes: 2 additions & 1 deletion ppdet/utils/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def draw_bbox(image, im_id, catid2name, bboxes, threshold):

# draw label
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(
[(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill=color)
draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ terminaltables
Cython
pycocotools
setuptools
Pillow>=10.0.0

# for MOT evaluation and inference
lap
Expand Down