main.cpp 707 Bytes
Newer Older
liuhy's avatar
liuhy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "ocr_engine.hpp"

using namespace ppocr;
 
int main(int argc, char** argv)
{
    std::string det_model_onnx = "../Resource/Models/ppocrv5_server_det_infer.onnx";
    std::string rec_model_onnx = "../Resource/Models/ppocrv5_server_rec_infer.onnx";
    std::string img_path = "../Resource/Images/20250703205038.png";
    std::string character_dict_path = "../Resource/ppocr_keys_v5.txt";
    float segm_thres=0.3;
    float box_thresh=0.3; 
    ppOcrEngine ocr_engine(det_model_onnx,
        rec_model_onnx,
        character_dict_path,
        segm_thres,
        box_thresh,
        true,
        "fp32");
       
    cv::Mat img=cv::imread(img_path);
    ocr_engine.forward(img);
    return 0;
}