main.cpp 769 Bytes
Newer Older
liuhy's avatar
liuhy committed
1
#include "ocr_engine.hpp"
2
 
liuhy's avatar
liuhy committed
3
4
using namespace ppocr;
 
5
int main(int argc, char** argv){
liuhy's avatar
liuhy committed
6
7
    std::string det_model_onnx = "../Resource/Models/ppocrv5_server_det_infer.onnx";
    std::string rec_model_onnx = "../Resource/Models/ppocrv5_server_rec_infer.onnx";
8
    std::string img_path = "../Resource/Images/demo.png";
liuhy's avatar
liuhy committed
9
    std::string character_dict_path = "../Resource/ppocr_keys_v5.txt";
10
    std::string front = "../Resource/fonts/SimHei.ttf";
liuhy's avatar
liuhy committed
11
12
13
14
15
    float segm_thres=0.3;
    float box_thresh=0.3; 
    ppOcrEngine ocr_engine(det_model_onnx,
        rec_model_onnx,
        character_dict_path,
16
        front,
liuhy's avatar
liuhy committed
17
18
19
        segm_thres,
        box_thresh,
        true,
20
21
        "fp16");
    
liuhy's avatar
liuhy committed
22
23
24
25
    cv::Mat img=cv::imread(img_path);
    ocr_engine.forward(img);
    return 0;
}
26
27
28
 


liuhy's avatar
liuhy committed
29