未验证 提交 82968f5d 编写于 作者: S shiyutang 提交者: GitHub

[BugFix] Import error (#8476)

* fix_textbbox

* compact_py37

* update_req

* fix_deploy_cannot_find

* fix_merge_error
上级 f4c320ec
......@@ -21,8 +21,15 @@ import PIL
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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册