提交 93bd46e9 编写于 作者: L LDOUBLEV

delete support multi-line txt display

上级 eec9155e
......@@ -174,16 +174,7 @@ def draw_ocr(image, boxes, txts, scores, draw_txt=True, drop_score=0.5):
continue
font = ImageFont.truetype(
"./doc/simfang.ttf", font_size, encoding="utf-8")
new_txt = str(count) + ': ' + txt + ' ' + '%.3f' % (
scores[count])
while len(new_txt) > 28:
tmp = new_txt
new_txt = tmp[:28]
draw_txt.text(
(20, gap * (count + 1)), new_txt, txt_color, font=font)
new_txt = tmp[28:]
count += 1
new_txt = str(idx) + ': ' + txt + ' ' + '%.3f' % (scores[idx])
draw_txt.text(
(20, gap * (count + 1)), new_txt, txt_color, font=font)
count += 1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册