未验证 提交 48704761 编写于 作者: 文幕地方's avatar 文幕地方 提交者: GitHub

add paddleocr to requirements.txt (#5555)

* add PP-OCRv2

* add PP-OCRv2 benckmark

* update app

* update introduction

* update PP-OCRv2 introduction

* add pipeline of PP-OCRv2

* add PP-OCRv3

* update benckmark

* add paddleocr to requirements

* update

* support paddleocr 2.6.0.1

* rm print code
上级 b7f15dc2
......@@ -3,6 +3,7 @@ import base64
from io import BytesIO
from PIL import Image
import paddleocr
from paddleocr import PaddleOCR, draw_ocr
ocr = PaddleOCR(ocr_version='PP-OCRv2', use_angle_cls=True, lang="ch")
......@@ -22,7 +23,8 @@ def model_inference(image):
result = ocr.ocr(image, cls=True)
# 显示结果
result = result[0]
if paddleocr.__version__ >= "2.6.0.2":
result = result[0]
boxes = [line[0] for line in result]
txts = [line[1][0] for line in result]
scores = [line[1][1] for line in result]
......
......@@ -3,6 +3,7 @@ import base64
from io import BytesIO
from PIL import Image
import paddleocr
from paddleocr import PaddleOCR, draw_ocr
ocr = PaddleOCR(use_angle_cls=True, lang="ch")
......@@ -22,7 +23,8 @@ def model_inference(image):
result = ocr.ocr(image, cls=True)
# 显示结果
result = result[0]
if paddleocr.__version__ >= "2.6.0.2":
result = result[0]
boxes = [line[0] for line in result]
txts = [line[1][0] for line in result]
scores = [line[1][1] for line in result]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册