FastDeploy  latest
Fast & Easy to Deploy!
Typedefs | Functions
model.h File Reference
#include "fastdeploy_capi/core/fd_common.h"
#include "fastdeploy_capi/core/fd_type.h"
#include "fastdeploy_capi/runtime/runtime_option.h"
#include "fastdeploy_capi/vision/result.h"
#include "fastdeploy_capi/vision/ocr/ppocr/base_define.h"
Include dependency graph for model.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct FD_C_RecognizerWrapper FD_C_RecognizerWrapper
 
typedef struct FD_C_ClassifierWrapper FD_C_ClassifierWrapper
 
typedef struct FD_C_DBDetectorWrapper FD_C_DBDetectorWrapper
 
typedef struct FD_C_PPOCRv2Wrapper FD_C_PPOCRv2Wrapper
 
typedef struct FD_C_PPOCRv3Wrapper FD_C_PPOCRv3Wrapper
 

Functions

FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_RecognizerWrapperFD_C_CreateRecognizerWrapper (const char *model_file, const char *params_file, const char *label_path, FD_C_RuntimeOptionWrapper *fd_c_runtime_option_wrapper, const FD_C_ModelFormat model_format)
 Create a new FD_C_RecognizerWrapper object. More...
 
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyRecognizerWrapper (__fd_take FD_C_RecognizerWrapper *fd_c_recognizer_wrapper)
 Destroy a FD_C_RecognizerWrapper object. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_RecognizerWrapperPredict (__fd_keep FD_C_RecognizerWrapper *fd_c_recognizer_wrapper, FD_C_Mat img, FD_C_Cstr *text, float *rec_score)
 Predict the ocr result for an input image. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_RecognizerWrapperInitialized (__fd_keep FD_C_RecognizerWrapper *fd_c_recognizer_wrapper)
 Check if the model is initialized successfully. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_RecognizerWrapperBatchPredict (__fd_keep FD_C_RecognizerWrapper *fd_c_recognizer_wrapper, FD_C_OneDimMat imgs, FD_C_OneDimArrayCstr *texts, FD_C_OneDimArrayFloat *rec_scores)
 Predict the ocr results for a batch of input images. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_RecognizerWrapperBatchPredictWithIndex (__fd_keep FD_C_RecognizerWrapper *fd_c_recognizer_wrapper, FD_C_OneDimMat imgs, FD_C_OneDimArrayCstr *texts, FD_C_OneDimArrayFloat *rec_scores, size_t start_index, size_t end_index, FD_C_OneDimArrayInt32 indices)
 
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_ClassifierWrapperFD_C_CreateClassifierWrapper (const char *model_file, const char *params_file, FD_C_RuntimeOptionWrapper *fd_c_runtime_option_wrapper, const FD_C_ModelFormat model_format)
 Create a new FD_C_ClassifierWrapper object. More...
 
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyClassifierWrapper (__fd_take FD_C_ClassifierWrapper *fd_c_classifier_wrapper)
 Destroy a FD_C_ClassifierWrapper object. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_ClassifierWrapperPredict (__fd_keep FD_C_ClassifierWrapper *fd_c_classifier_wrapper, FD_C_Mat img, int32_t *cls_label, float *cls_score)
 Predict the input image and get OCR classification model cls_result. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_ClassifierWrapperInitialized (__fd_keep FD_C_ClassifierWrapper *fd_c_classifier_wrapper)
 Check if the model is initialized successfully. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_ClassifierWrapperBatchPredict (__fd_keep FD_C_ClassifierWrapper *fd_c_classifier_wrapper, FD_C_OneDimMat imgs, FD_C_OneDimArrayInt32 *cls_labels, FD_C_OneDimArrayFloat *cls_scores)
 BatchPredict the input image and get OCR classification model cls_result. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_ClassifierWrapperBatchPredictWithIndex (__fd_keep FD_C_ClassifierWrapper *fd_c_classifier_wrapper, FD_C_OneDimMat imgs, FD_C_OneDimArrayInt32 *cls_labels, FD_C_OneDimArrayFloat *cls_scores, size_t start_index, size_t end_index)
 
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_DBDetectorWrapperFD_C_CreateDBDetectorWrapper (const char *model_file, const char *params_file, FD_C_RuntimeOptionWrapper *fd_c_runtime_option_wrapper, const FD_C_ModelFormat model_format)
 Create a new FD_C_DBDetectorWrapper object. More...
 
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyDBDetectorWrapper (__fd_take FD_C_DBDetectorWrapper *fd_c_dbdetector_wrapper)
 Destroy a FD_C_DBDetectorWrapper object. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_DBDetectorWrapperPredict (__fd_keep FD_C_DBDetectorWrapper *fd_c_dbdetector_wrapper, FD_C_Mat img, FD_C_TwoDimArrayInt32 *boxes_result)
 Predict the input image and get OCR detection model result. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_DBDetectorWrapperInitialized (__fd_keep FD_C_DBDetectorWrapper *fd_c_dbdetector_wrapper)
 Check if the model is initialized successfully. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_DBDetectorWrapperBatchPredict (__fd_keep FD_C_DBDetectorWrapper *fd_c_dbdetector_wrapper, FD_C_OneDimMat imgs, FD_C_ThreeDimArrayInt32 *det_results)
 BatchPredict the input image and get OCR detection model result. More...
 
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_PPOCRv2WrapperFD_C_CreatePPOCRv2Wrapper (FD_C_DBDetectorWrapper *det_model, FD_C_ClassifierWrapper *cls_model, FD_C_RecognizerWrapper *rec_model)
 Set up the detection model path, classification model path and recognition model path respectively. More...
 
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyPPOCRv2Wrapper (__fd_take FD_C_PPOCRv2Wrapper *fd_c_ppocrv2_wrapper)
 Destroy a FD_C_PPOCRv2Wrapper object. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv2WrapperPredict (__fd_keep FD_C_PPOCRv2Wrapper *fd_c_ppocrv2_wrapper, FD_C_Mat img, FD_C_OCRResult *result)
 Predict the input image and get OCR result. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv2WrapperInitialized (__fd_keep FD_C_PPOCRv2Wrapper *fd_c_ppocrv2_wrapper)
 Check if the model is initialized successfully. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv2WrapperBatchPredict (__fd_keep FD_C_PPOCRv2Wrapper *fd_c_ppocrv2_wrapper, FD_C_OneDimMat imgs, FD_C_OneDimOCRResult *batch_result)
 BatchPredict the input image and get OCR result. More...
 
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_PPOCRv3WrapperFD_C_CreatePPOCRv3Wrapper (FD_C_DBDetectorWrapper *det_model, FD_C_ClassifierWrapper *cls_model, FD_C_RecognizerWrapper *rec_model)
 Set up the detection model path, classification model path and recognition model path respectively. More...
 
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyPPOCRv3Wrapper (__fd_take FD_C_PPOCRv3Wrapper *fd_c_ppocrv3_wrapper)
 Destroy a FD_C_PPOCRv3Wrapper object. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv3WrapperPredict (__fd_keep FD_C_PPOCRv3Wrapper *fd_c_ppocrv3_wrapper, FD_C_Mat img, FD_C_OCRResult *result)
 Predict the input image and get OCR result. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv3WrapperInitialized (__fd_keep FD_C_PPOCRv3Wrapper *fd_c_ppocrv3_wrapper)
 Check if the model is initialized successfully. More...
 
FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv3WrapperBatchPredict (__fd_keep FD_C_PPOCRv3Wrapper *fd_c_ppocrv3_wrapper, FD_C_OneDimMat imgs, FD_C_OneDimOCRResult *batch_result)
 BatchPredict the input image and get OCR result. More...
 

Typedef Documentation

◆ FD_C_ClassifierWrapper

◆ FD_C_DBDetectorWrapper

◆ FD_C_PPOCRv2Wrapper

◆ FD_C_PPOCRv3Wrapper

◆ FD_C_RecognizerWrapper

Function Documentation

◆ FD_C_ClassifierWrapperBatchPredict()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_ClassifierWrapperBatchPredict ( __fd_keep FD_C_ClassifierWrapper fd_c_classifier_wrapper,
FD_C_OneDimMat  imgs,
FD_C_OneDimArrayInt32 cls_labels,
FD_C_OneDimArrayFloat cls_scores 
)

BatchPredict the input image and get OCR classification model cls_result.

Parameters
[in]fd_c_classifier_wrapperpointer to FD_C_ClassifierWrapper object
[in]imgsThe list of input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format.
[in]cls_labelsThe label results of cls model will be written in to this vector.
[in]cls_scoresThe score results of cls model will be written in to this vector.
Returns
true if the prediction is successed, otherwise false.

◆ FD_C_ClassifierWrapperBatchPredictWithIndex()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_ClassifierWrapperBatchPredictWithIndex ( __fd_keep FD_C_ClassifierWrapper fd_c_classifier_wrapper,
FD_C_OneDimMat  imgs,
FD_C_OneDimArrayInt32 cls_labels,
FD_C_OneDimArrayFloat cls_scores,
size_t  start_index,
size_t  end_index 
)

◆ FD_C_ClassifierWrapperInitialized()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_ClassifierWrapperInitialized ( __fd_keep FD_C_ClassifierWrapper fd_c_classifier_wrapper)

Check if the model is initialized successfully.

Parameters
[in]fd_c_classifier_wrapperpointer to FD_C_ClassifierWrapper object
Returns
Return a bool of value true if initialized successfully

◆ FD_C_ClassifierWrapperPredict()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_ClassifierWrapperPredict ( __fd_keep FD_C_ClassifierWrapper fd_c_classifier_wrapper,
FD_C_Mat  img,
int32_t *  cls_label,
float *  cls_score 
)

Predict the input image and get OCR classification model cls_result.

Parameters
[in]fd_c_classifier_wrapperpointer to FD_C_ClassifierWrapper object
[in]imgThe input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format.
[in]cls_labelThe label result of cls model will be written in to this param.
[in]cls_scoreThe score result of cls model will be written in to this param.
Returns
true if the prediction is successed, otherwise false.

◆ FD_C_CreateClassifierWrapper()

FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_ClassifierWrapper* FD_C_CreateClassifierWrapper ( const char *  model_file,
const char *  params_file,
FD_C_RuntimeOptionWrapper fd_c_runtime_option_wrapper,
const FD_C_ModelFormat  model_format 
)

Create a new FD_C_ClassifierWrapper object.

Parameters
[in]model_filePath of model file, e.g ./ch_ppocr_mobile_v2.0_cls_infer/model.pdmodel.
[in]params_filePath of parameter file, e.g ./ch_ppocr_mobile_v2.0_cls_infer/model.pdiparams, if the model format is ONNX, this parameter will be ignored.
[in]fd_c_runtime_option_wrapperRuntimeOption for inference, the default will use cpu, and choose the backend defined in valid_cpu_backends.
[in]model_formatModel format of the loaded model, default is Paddle format.
Returns
Return a pointer to FD_C_ClassifierWrapper object

◆ FD_C_CreateDBDetectorWrapper()

FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_DBDetectorWrapper* FD_C_CreateDBDetectorWrapper ( const char *  model_file,
const char *  params_file,
FD_C_RuntimeOptionWrapper fd_c_runtime_option_wrapper,
const FD_C_ModelFormat  model_format 
)

Create a new FD_C_DBDetectorWrapper object.

Parameters
[in]model_filePath of model file, e.g ./ch_PP-OCRv3_det_infer/model.pdmodel.
[in]params_filePath of parameter file, e.g ./ch_PP-OCRv3_det_infer/model.pdiparams, if the model format is ONNX, this parameter will be ignored.
[in]custom_optionRuntimeOption for inference, the default will use cpu, and choose the backend defined in valid_cpu_backends.
[in]model_formatModel format of the loaded model, default is Paddle format.
Returns
Return a pointer to FD_C_DBDetectorWrapper object

◆ FD_C_CreatePPOCRv2Wrapper()

FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_PPOCRv2Wrapper* FD_C_CreatePPOCRv2Wrapper ( FD_C_DBDetectorWrapper det_model,
FD_C_ClassifierWrapper cls_model,
FD_C_RecognizerWrapper rec_model 
)

Set up the detection model path, classification model path and recognition model path respectively.

Parameters
[in]det_modelPath of detection model, e.g ./ch_PP-OCRv2_det_infer
[in]cls_modelPath of classification model, e.g ./ch_ppocr_mobile_v2.0_cls_infer
[in]rec_modelPath of recognition model, e.g ./ch_PP-OCRv2_rec_infer

◆ FD_C_CreatePPOCRv3Wrapper()

FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_PPOCRv3Wrapper* FD_C_CreatePPOCRv3Wrapper ( FD_C_DBDetectorWrapper det_model,
FD_C_ClassifierWrapper cls_model,
FD_C_RecognizerWrapper rec_model 
)

Set up the detection model path, classification model path and recognition model path respectively.

Parameters
[in]det_modelPath of detection model, e.g ./ch_PP-OCRv2_det_infer
[in]cls_modelPath of classification model, e.g ./ch_ppocr_mobile_v2.0_cls_infer
[in]rec_modelPath of recognition model, e.g ./ch_PP-OCRv2_rec_infer

◆ FD_C_CreateRecognizerWrapper()

FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_RecognizerWrapper* FD_C_CreateRecognizerWrapper ( const char *  model_file,
const char *  params_file,
const char *  label_path,
FD_C_RuntimeOptionWrapper fd_c_runtime_option_wrapper,
const FD_C_ModelFormat  model_format 
)

Create a new FD_C_RecognizerWrapper object.

Parameters
[in]model_filePath of model file, e.g ./ch_PP-OCRv3_rec_infer/model.pdmodel.
[in]params_filePath of parameter file, e.g ./ch_PP-OCRv3_rec_infer/model.pdiparams, if the model format is ONNX, this parameter will be ignored.
[in]label_pathPath of label file used by OCR recognition model. e.g ./ppocr_keys_v1.txt
[in]custom_optionRuntimeOption for inference, the default will use cpu, and choose the backend defined in valid_cpu_backends.
[in]model_formatModel format of the loaded model, default is Paddle format.
Returns
Return a pointer to FD_C_RecognizerWrapper object

◆ FD_C_DBDetectorWrapperBatchPredict()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_DBDetectorWrapperBatchPredict ( __fd_keep FD_C_DBDetectorWrapper fd_c_dbdetector_wrapper,
FD_C_OneDimMat  imgs,
FD_C_ThreeDimArrayInt32 det_results 
)

BatchPredict the input image and get OCR detection model result.

Parameters
[in]fd_c_dbdetector_wrapperpointer to FD_C_DBDetectorWrapper object
[in]imgsThe list input of image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format.
[in]det_resultsThe output of OCR detection model result will be writen to this structure.
Returns
true if the prediction is successed, otherwise false.

◆ FD_C_DBDetectorWrapperInitialized()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_DBDetectorWrapperInitialized ( __fd_keep FD_C_DBDetectorWrapper fd_c_dbdetector_wrapper)

Check if the model is initialized successfully.

Parameters
[in]fd_c_dbdetector_wrapperpointer to FD_C_DBDetectorWrapper object
Returns
Return a bool of value true if initialized successfully

◆ FD_C_DBDetectorWrapperPredict()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_DBDetectorWrapperPredict ( __fd_keep FD_C_DBDetectorWrapper fd_c_dbdetector_wrapper,
FD_C_Mat  img,
FD_C_TwoDimArrayInt32 boxes_result 
)

Predict the input image and get OCR detection model result.

Parameters
[in]fd_c_dbdetector_wrapperpointer to FD_C_DBDetectorWrapper object
[in]imgThe input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format.
[in]boxes_resultThe output of OCR detection model result will be writen to this structure.
Returns
true if the prediction is successed, otherwise false.

◆ FD_C_DestroyClassifierWrapper()

FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyClassifierWrapper ( __fd_take FD_C_ClassifierWrapper fd_c_classifier_wrapper)

Destroy a FD_C_ClassifierWrapper object.

Parameters
[in]fd_c_classifier_wrapperpointer to FD_C_ClassifierWrapper object

◆ FD_C_DestroyDBDetectorWrapper()

FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyDBDetectorWrapper ( __fd_take FD_C_DBDetectorWrapper fd_c_dbdetector_wrapper)

Destroy a FD_C_DBDetectorWrapper object.

Parameters
[in]fd_c_dbdetector_wrapperpointer to FD_C_DBDetectorWrapper object

◆ FD_C_DestroyPPOCRv2Wrapper()

FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyPPOCRv2Wrapper ( __fd_take FD_C_PPOCRv2Wrapper fd_c_ppocrv2_wrapper)

Destroy a FD_C_PPOCRv2Wrapper object.

Parameters
[in]fd_c_ppocrv2_wrapperpointer to FD_C_PPOCRv2Wrapper object

◆ FD_C_DestroyPPOCRv3Wrapper()

FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyPPOCRv3Wrapper ( __fd_take FD_C_PPOCRv3Wrapper fd_c_ppocrv3_wrapper)

Destroy a FD_C_PPOCRv3Wrapper object.

Parameters
[in]fd_c_ppocrv3_wrapperpointer to FD_C_PPOCRv3Wrapper object

◆ FD_C_DestroyRecognizerWrapper()

FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyRecognizerWrapper ( __fd_take FD_C_RecognizerWrapper fd_c_recognizer_wrapper)

Destroy a FD_C_RecognizerWrapper object.

Parameters
[in]fd_c_recognizer_wrapperpointer to FD_C_RecognizerWrapper object

◆ FD_C_PPOCRv2WrapperBatchPredict()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv2WrapperBatchPredict ( __fd_keep FD_C_PPOCRv2Wrapper fd_c_ppocrv2_wrapper,
FD_C_OneDimMat  imgs,
FD_C_OneDimOCRResult batch_result 
)

BatchPredict the input image and get OCR result.

Parameters
[in]fd_c_ppocrv2_wrapperpointer to FD_C_PPOCRv2Wrapper object
[in]imgsThe list of input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format.
[in]batch_resultThe output list of OCR result will be writen to this structure.
Returns
true if the prediction successed, otherwise false.

◆ FD_C_PPOCRv2WrapperInitialized()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv2WrapperInitialized ( __fd_keep FD_C_PPOCRv2Wrapper fd_c_ppocrv2_wrapper)

Check if the model is initialized successfully.

Parameters
[in]fd_c_ppocrv2_wrapperpointer to FD_C_PPOCRv2Wrapper object
Returns
Return a bool of value true if initialized successfully

◆ FD_C_PPOCRv2WrapperPredict()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv2WrapperPredict ( __fd_keep FD_C_PPOCRv2Wrapper fd_c_ppocrv2_wrapper,
FD_C_Mat  img,
FD_C_OCRResult result 
)

Predict the input image and get OCR result.

Parameters
[in]fd_c_ppocrv2_wrapperpointer to FD_C_PPOCRv2Wrapper object
[in]imgThe input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format.
[in]resultThe output OCR result will be writen to this structure.
Returns
true if the prediction successed, otherwise false.

◆ FD_C_PPOCRv3WrapperBatchPredict()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv3WrapperBatchPredict ( __fd_keep FD_C_PPOCRv3Wrapper fd_c_ppocrv3_wrapper,
FD_C_OneDimMat  imgs,
FD_C_OneDimOCRResult batch_result 
)

BatchPredict the input image and get OCR result.

Parameters
[in]fd_c_ppocrv3_wrapperpointer to FD_C_PPOCRv3Wrapper object
[in]imgsThe list of input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format.
[in]batch_resultThe output list of OCR result will be writen to this structure.
Returns
true if the prediction successed, otherwise false.

◆ FD_C_PPOCRv3WrapperInitialized()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv3WrapperInitialized ( __fd_keep FD_C_PPOCRv3Wrapper fd_c_ppocrv3_wrapper)

Check if the model is initialized successfully.

Parameters
[in]fd_c_ppocrv3_wrapperpointer to FD_C_PPOCRv3Wrapper object
Returns
Return a bool of value true if initialized successfully

◆ FD_C_PPOCRv3WrapperPredict()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_PPOCRv3WrapperPredict ( __fd_keep FD_C_PPOCRv3Wrapper fd_c_ppocrv3_wrapper,
FD_C_Mat  img,
FD_C_OCRResult result 
)

Predict the input image and get OCR result.

Parameters
[in]fd_c_ppocrv3_wrapperpointer to FD_C_PPOCRv3Wrapper object
[in]imgThe input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format.
[in]resultThe output OCR result will be writen to this structure.
Returns
true if the prediction successed, otherwise false.

◆ FD_C_RecognizerWrapperBatchPredict()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_RecognizerWrapperBatchPredict ( __fd_keep FD_C_RecognizerWrapper fd_c_recognizer_wrapper,
FD_C_OneDimMat  imgs,
FD_C_OneDimArrayCstr texts,
FD_C_OneDimArrayFloat rec_scores 
)

Predict the ocr results for a batch of input images.

Parameters
[in]fd_c_recognizer_wrapperpointer to FD_C_RecognizerWrapper object
[in]imgsThe list of input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format.
[in]textsThe list of text results of rec model will be written into this vector.
[in]rec_scoresThe list of sccore result of rec model will be written into this vector.
Returns
true if the prediction successed, otherwise false

◆ FD_C_RecognizerWrapperBatchPredictWithIndex()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_RecognizerWrapperBatchPredictWithIndex ( __fd_keep FD_C_RecognizerWrapper fd_c_recognizer_wrapper,
FD_C_OneDimMat  imgs,
FD_C_OneDimArrayCstr texts,
FD_C_OneDimArrayFloat rec_scores,
size_t  start_index,
size_t  end_index,
FD_C_OneDimArrayInt32  indices 
)

◆ FD_C_RecognizerWrapperInitialized()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_RecognizerWrapperInitialized ( __fd_keep FD_C_RecognizerWrapper fd_c_recognizer_wrapper)

Check if the model is initialized successfully.

Parameters
[in]fd_c_recognizer_wrapperpointer to FD_C_RecognizerWrapper object
Returns
Return a bool of value true if initialized successfully

◆ FD_C_RecognizerWrapperPredict()

FASTDEPLOY_CAPI_EXPORT FD_C_Bool FD_C_RecognizerWrapperPredict ( __fd_keep FD_C_RecognizerWrapper fd_c_recognizer_wrapper,
FD_C_Mat  img,
FD_C_Cstr text,
float *  rec_score 
)

Predict the ocr result for an input image.

Parameters
[in]fd_c_recognizer_wrapperpointer to FD_C_RecognizerWrapper object
[in]imgThe input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format.
[in]textThe text result of rec model will be written into this parameter.
[in]rec_scoreThe sccore result of rec model will be written into this parameter.
Returns
true if the prediction is successed, otherwise false.