qianliyx commited on
Commit
8774477
·
verified ·
1 Parent(s): f6cfecf

Update README_en.md

Browse files
Files changed (1) hide show
  1. README_en.md +23 -0
README_en.md CHANGED
@@ -122,6 +122,29 @@ res = model.raw_completions('/to/your/image',use_cls=True,use_det=True)
122
  print(res)
123
  ```
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  - If you have better text detection, text recognition can also use only a part of ours.
126
  - You can also export the PaddleOCR model to onnx format and use AnyOCR inference, or you can fine tune the PaddleOCR model yourself and use AnyOCR inference.
127
 
 
122
  print(res)
123
  ```
124
 
125
+ ### Use paddleocr integration
126
+
127
+ ```python
128
+ from paddleocr import PaddleOCR, draw_ocr
129
+
130
+ ocrmodel = PaddleOCR(
131
+ use_gpu = False, # or True
132
+ det_model_dir = "anyocr/paddlemodels/det/ch_PP-OCRv4_det_infer",
133
+ cls_model_dir = "anyocr/paddlemodels/cls/ch_ppocr_mobile_v2.0_cls_infer",
134
+ rec_model_dir = "anyocr/paddlemodels/rec/anyocr_rec_v4_server",
135
+ rec_char_dict_path = "anyocr/paddlemodels/anyocr_keys_v4.txt",
136
+ use_dilation = True,
137
+ )
138
+ img_path = '/to/your/image'
139
+
140
+ result = ocrmodel.ocr(img_path, cls=True)
141
+ for idx in range(len(result)):
142
+ res = result[idx]
143
+ for line in res:
144
+ print(line)
145
+
146
+ ```
147
+
148
  - If you have better text detection, text recognition can also use only a part of ours.
149
  - You can also export the PaddleOCR model to onnx format and use AnyOCR inference, or you can fine tune the PaddleOCR model yourself and use AnyOCR inference.
150