Update README

This commit is contained in:
SWHL committed 2022-04-06 22:17:41 +08:00
1 parent 1df17cc068
commit 354fa500d5
3 files changed
+13 -4

No files matched your search

+11
View File
@@ -5,5 +5,16 @@ pip install openvino==2022.1.0
pip install openvino-dev==2022.1.0
```
#### 模型转换为IR
```bash
# 转动态模型 占用内存平均为3.5G左右
mo --input_model models/ch_PP-OCRv2_det_infer.onnx --output_dir models/IR/
# 转静态模型 占用内存平均为1G左右
mo --input_model models/ch_PP-OCRv2_det_infer.onnx \
--output_dir models/IR/static \
--input_shape 1,3, 12128,800
```
#### 测试图像下载
- [long1.jpg](https://drive.google.com/file/d/1iJcGvOVIdUlyOS52bBdvO8uzx8QORo5M/view?usp=sharing)
@@ -118,6 +118,7 @@ class TextDetector(object):
shape_list = np.expand_dims(shape_list, axis=0)
start_time = time.time()
print(img.shape)
self.vino_session.infer(inputs=[img])
vino_preds = self.vino_session.get_output_tensor().data
@@ -125,9 +126,6 @@ class TextDetector(object):
dt_boxes = post_result[0]['points']
dt_boxes = self.filter_tag_det_res(dt_boxes, ori_im.shape)
elapse = time.time() - start_time
src_im = draw_text_det_res(dt_boxes, r'E:\PythonProjects\RapidOCR\python\test_images\long1.jpg')
cv2.imwrite('det_results.jpg', src_im)
return dt_boxes, elapse
+1 -1
View File
@@ -36,7 +36,7 @@ import numpy as np
import cv2
from ch_ppocr_mobile_v2_det_openvino_ir import TextDetector as TextDetectorIR
det_model_path = 'models/IR/FP16/ch_PP-OCRv2_det_infer.xml'
det_model_path = 'models/IR/static/ch_PP-OCRv2_det_infer.xml'
img_path = 'test_images/long1.jpg'
img = cv2.imread(img_path)