带框的可视化结果如何实现 #12676
Unanswered
lwtgithublwt
asked this question in
Q&A
带框的可视化结果如何实现
#12676
Replies: 4 comments
-
请问使用的是哪个模型呢 |
Beta Was this translation helpful? Give feedback.
0 replies
-
使用的PaddleOCR 快速开始里的python脚本,模型应该都是最新的,没有更改里面的模型参数,我认为应该是绘图函数方面的问题 |
Beta Was this translation helpful? Give feedback.
0 replies
-
能提供一下链接吗,这边不太清楚你说的是哪个脚本,我们这边看下哈 |
Beta Was this translation helpful? Give feedback.
0 replies
-
from paddleocr import PaddleOCR, draw_ocr
# Paddleocr目前支持的多语言语种可以通过修改lang参数进行切换
# 例如`ch`, `en`, `fr`, `german`, `korean`, `japan`
ocr = PaddleOCR(use_angle_cls=True, lang="ch") # need to run only once to download and load model into memory
img_path = './imgs/11.jpg'
result = ocr.ocr(img_path, cls=True)
for idx in range(len(result)):
res = result[idx]
for line in res:
print(line)
# 显示结果
from PIL import Image
result = result[0]
image = Image.open(img_path).convert('RGB')
boxes = [line[0] for line in result]
txts = [line[1][0] for line in result]
scores = [line[1][1] for line in result]
im_show = draw_ocr(image, boxes, txts, scores, font_path='./fonts/simfang.ttf')
im_show = Image.fromarray(im_show)
im_show.save('result.jpg') |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
请尽量不要包含图片在问题中/Please try to not include the image in the issue.
我的可视化结果是那种没有框的,想问一下如何实现在原位置带框的可视化结果
Beta Was this translation helpful? Give feedback.
All reactions