| 14 | OCR_PPredictor::OCR_PPredictor(const OCR_Config &config) : _config(config) {} |
| 15 | |
| 16 | int OCR_PPredictor::init(const std::string &det_model_content, |
| 17 | const std::string &rec_model_content, |
| 18 | const std::string &cls_model_content) { |
| 19 | _det_predictor = std::unique_ptr<PPredictor>(new PPredictor{ |
| 20 | _config.use_opencl, _config.thread_num, NET_OCR, _config.mode}); |
| 21 | _det_predictor->init_nb(det_model_content); |
| 22 | |
| 23 | _rec_predictor = std::unique_ptr<PPredictor>(new PPredictor{ |
| 24 | _config.use_opencl, _config.thread_num, NET_OCR_INTERNAL, _config.mode}); |
| 25 | _rec_predictor->init_nb(rec_model_content); |
| 26 | |
| 27 | _cls_predictor = std::unique_ptr<PPredictor>(new PPredictor{ |
| 28 | _config.use_opencl, _config.thread_num, NET_OCR_INTERNAL, _config.mode}); |
| 29 | _cls_predictor->init_nb(cls_model_content); |
| 30 | return RETURN_OK; |
| 31 | } |
| 32 | |
| 33 | int OCR_PPredictor::init_from_file(const std::string &det_model_path, |
| 34 | const std::string &rec_model_path, |
no test coverage detected