16 #include "fastdeploy/fastdeploy_model.h" 17 #include "fastdeploy/vision/common/processors/transform.h" 18 #include "fastdeploy/vision/common/result.h" 19 #include "fastdeploy/vision/ocr/ppocr/utils/ocr_postprocess_op.h" 20 #include "fastdeploy/vision/ocr/ppocr/cls_postprocessor.h" 21 #include "fastdeploy/vision/ocr/ppocr/cls_preprocessor.h" 22 #include "fastdeploy/utils/unique_ptr.h" 42 Classifier(
const std::string& model_file,
const std::string& params_file =
"",
50 virtual std::unique_ptr<Classifier> Clone()
const;
53 std::string
ModelName()
const {
return "ppocr/ocr_cls"; }
62 virtual bool Predict(
const cv::Mat& img,
63 int32_t* cls_label,
float* cls_score);
71 virtual bool Predict(
const cv::Mat& img, vision::OCRResult* ocr_result);
79 virtual bool BatchPredict(
const std::vector<cv::Mat>& images,
80 vision::OCRResult* ocr_result);
89 virtual bool BatchPredict(
const std::vector<cv::Mat>& images,
90 std::vector<int32_t>* cls_labels,
91 std::vector<float>* cls_scores);
92 virtual bool BatchPredict(
const std::vector<cv::Mat>& images,
93 std::vector<int32_t>* cls_labels,
94 std::vector<float>* cls_scores,
95 size_t start_index,
size_t end_index);
104 return postprocessor_;
Option object used when create a new Runtime object.
Definition: runtime_option.h:40
Classifier object is used to load the classification model provided by PaddleOCR. ...
Definition: classifier.h:32
Base model object for all the vision models.
Definition: fastdeploy_model.h:21
ModelFormat
Definition: enum_variables.h:67
Postprocessor object for Classifier serials model.
Definition: cls_postprocessor.h:26
Preprocessor object for Classifier serials model.
Definition: cls_preprocessor.h:26
virtual ClassifierPostprocessor & GetPostprocessor()
Get postprocessor reference of ClassifierPostprocessor.
Definition: classifier.h:103
Model with paddlepaddle format.
Definition: enum_variables.h:69
std::string ModelName() const
Get model's name.
Definition: classifier.h:53
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16
virtual ClassifierPreprocessor & GetPreprocessor()
Get preprocessor reference of ClassifierPreprocessor.
Definition: classifier.h:98