17 #include "fastdeploy/vision/ocr/ppocr/ppocr_v2.h" 37 :
PPOCRv2(det_model, cls_model, rec_model) {
39 auto preprocess_shape = recognizer_->GetPreprocessor().GetRecImageShape();
40 preprocess_shape[1] = 48;
41 recognizer_->GetPreprocessor().SetRecImageShape(preprocess_shape);
50 :
PPOCRv2(det_model, rec_model) {
52 auto preprocess_shape = recognizer_->GetPreprocessor().GetRecImageShape();
53 preprocess_shape[1] = 48;
54 recognizer_->GetPreprocessor().SetRecImageShape(preprocess_shape);
61 std::unique_ptr<PPOCRv3>
Clone()
const {
62 std::unique_ptr<PPOCRv3> clone_model = utils::make_unique<PPOCRv3>(
PPOCRv3(*
this));
63 clone_model->detector_ = detector_->Clone().release();
64 if (classifier_ !=
nullptr) {
65 clone_model->classifier_ = classifier_->Clone().release();
67 clone_model->recognizer_ = recognizer_->Clone().release();
74 namespace application {
DBDetector object is used to load the detection model provided by PaddleOCR.
Definition: dbdetector.h:33
Classifier object is used to load the classification model provided by PaddleOCR. ...
Definition: classifier.h:32
PPOCRv3 is used to load PP-OCRv3 series models provided by PaddleOCR.
Definition: ppocr_v3.h:26
std::unique_ptr< PPOCRv3 > Clone() const
Clone a new PPOCRv3 with less memory usage when multiple instances of the same model are created...
Definition: ppocr_v3.h:61
PPOCRv3(fastdeploy::vision::ocr::DBDetector *det_model, fastdeploy::vision::ocr::Classifier *cls_model, fastdeploy::vision::ocr::Recognizer *rec_model)
Set up the detection model path, classification model path and recognition model path respectively...
Definition: ppocr_v3.h:34
PPOCRv3(fastdeploy::vision::ocr::DBDetector *det_model, fastdeploy::vision::ocr::Recognizer *rec_model)
Classification model is optional, so this function is set up the detection model path and recognition...
Definition: ppocr_v3.h:48
Recognizer object is used to load the recognition model provided by PaddleOCR.
Definition: recognizer.h:32
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16
PPOCRv2 is used to load PP-OCRv2 series models provided by PaddleOCR.
Definition: ppocr_v2.h:36