add ppv5.py
Browse files- .gitignore +1 -0
- data/CRNN.jpg +3 -0
- data/无标点符号.jpg +3 -0
- data/第一单元.jpg +3 -0
- ppv5.py +21 -0
.gitignore
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
Debug/
|
| 2 |
node_modules/
|
|
|
|
| 3 |
package-lock.json
|
| 4 |
Release/
|
| 5 |
x64/
|
|
|
|
| 1 |
Debug/
|
| 2 |
node_modules/
|
| 3 |
+
output/
|
| 4 |
package-lock.json
|
| 5 |
Release/
|
| 6 |
x64/
|
data/CRNN.jpg
ADDED
|
Git LFS Details
|
data/无标点符号.jpg
ADDED
|
Git LFS Details
|
data/第一单元.jpg
ADDED
|
Git LFS Details
|
ppv5.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
from paddleocr import PaddleOCR
|
| 4 |
+
# 初始化 PaddleOCR 实例
|
| 5 |
+
ocr = PaddleOCR(
|
| 6 |
+
use_doc_orientation_classify=False,
|
| 7 |
+
use_doc_unwarping=False,
|
| 8 |
+
use_textline_orientation=False)
|
| 9 |
+
|
| 10 |
+
# 对示例图像执行 OCR 推理
|
| 11 |
+
result = ocr.predict(
|
| 12 |
+
input= "data/无标点符号.jpg", # "data/第一单元.jpg", # "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png",
|
| 13 |
+
return_word_box=True
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
# 可视化结果并保存 json 结果
|
| 17 |
+
for res in result:
|
| 18 |
+
res.print()
|
| 19 |
+
res.save_to_img("output")
|
| 20 |
+
res.save_to_json("output")
|
| 21 |
+
|