From fab7435ddb528ecdd080bb19030ee64f5b31cc38 Mon Sep 17 00:00:00 2001 From: gaotingquan Date: Wed, 5 Jul 2023 08:53:12 +0000 Subject: [PATCH] adapt to Pillow new version 10.0.0 --- deploy/utils/draw_bbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/utils/draw_bbox.py b/deploy/utils/draw_bbox.py index 9c0bcf61..8daae96e 100644 --- a/deploy/utils/draw_bbox.py +++ b/deploy/utils/draw_bbox.py @@ -39,7 +39,7 @@ def draw_bbox_results(image, xmin, ymin, xmax, ymax = result["bbox"] text = "{}, {:.2f}".format(result["rec_docs"], result["rec_scores"]) th = font_size - tw = font.getsize(text)[0] + tw = font.getlength(text) # tw = int(len(result["rec_docs"]) * font_size) + 60 start_y = max(0, ymin - th) -- GitLab