fasdfsa commited on
Commit
84eac2d
·
1 Parent(s): 598b103

add ppv5.py

Browse files
Files changed (5) hide show
  1. .gitignore +1 -0
  2. data/CRNN.jpg +3 -0
  3. data/无标点符号.jpg +3 -0
  4. data/第一单元.jpg +3 -0
  5. 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

  • SHA256: f3dcbac24d9095baaee8e67eb4a3d31d262cf34acfbd55c81adfa99790f9ded5
  • Pointer size: 129 Bytes
  • Size of remote file: 1.61 kB
data/无标点符号.jpg ADDED

Git LFS Details

  • SHA256: a277c5ce4f66ca99ed33b33f68ad06e86ad986e37ae972ee1a52a605e02edd6a
  • Pointer size: 131 Bytes
  • Size of remote file: 745 kB
data/第一单元.jpg ADDED

Git LFS Details

  • SHA256: e4b5abd604e150665b17de76a52401450efdb36f21f3fafac1253b997d87c715
  • Pointer size: 129 Bytes
  • Size of remote file: 7.27 kB
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
+