Skip to content

Commit

Permalink
[BugFix] Import error (#8476)
Browse files Browse the repository at this point in the history
* fix_textbbox

* compact_py37

* update_req

* fix_deploy_cannot_find

* fix_merge_error
  • Loading branch information
shiyutang authored Jul 27, 2023
1 parent f4c320e commit 82968f5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion deploy/pptracking/python/mot/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@
from PIL import Image, ImageDraw, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
from collections import deque
from ppdet.utils.compact import imagedraw_textsize_c

def imagedraw_textsize_c(draw, text):
if int(PIL.__version__.split('.')[0]) < 10:
tw, th = draw.textsize(text)
else:
left, top, right, bottom = draw.textbbox((0, 0), text)
tw, th = right - left, bottom - top

return tw, th

def imagedraw_textsize_c(draw, text):
if int(PIL.__version__.split('.')[0]) < 10:
Expand Down

0 comments on commit 82968f5

Please sign in to comment.