14 lines
474 B
Python
14 lines
474 B
Python
from paddleocr import PaddleOCR
|
|
# 初始化 PaddleOCR 实例
|
|
ocr = PaddleOCR(
|
|
use_doc_orientation_classify=False,
|
|
use_doc_unwarping=False,
|
|
use_textline_orientation=False)
|
|
# 对示例图像执行 OCR 推理
|
|
result = ocr.predict(
|
|
input="https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png")
|
|
# 可视化结果并保存 json 结果
|
|
for res in result:
|
|
res.print()
|
|
res.save_to_img("output")
|
|
res.save_to_json("output") |