"ppocr/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "f96b873aa4eb5bc0c167d1ee485725b59ec5e785"
Commit eec9155e authored by LDOUBLEV's avatar LDOUBLEV
Browse files

adjust txt word in line

parent afecc497
......@@ -176,12 +176,14 @@ def draw_ocr(image, boxes, txts, scores, draw_txt=True, drop_score=0.5):
"./doc/simfang.ttf", font_size, encoding="utf-8")
new_txt = str(count) + ': ' + txt + ' ' + '%.3f' % (
scores[count])
while len(new_txt) > 25:
while len(new_txt) > 28:
tmp = new_txt
new_txt = tmp[:25]
new_txt = tmp[:28]
draw_txt.text(
(20, gap * (count + 1)), new_txt, txt_color, font=font)
new_txt = tmp[25:]
new_txt = tmp[28:]
count += 1
draw_txt.text(
(20, gap * (count + 1)), new_txt, txt_color, font=font)
count += 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment