FastDeploy  latest
Fast & Easy to Deploy!
Public Member Functions | List of all members
fastdeploy::vision::ocr::DBDetectorPreprocessor Class Reference

Preprocessor object for DBDetector serials model. More...

#include <det_preprocessor.h>

Inheritance diagram for fastdeploy::vision::ocr::DBDetectorPreprocessor:
Inheritance graph
[legend]
Collaboration diagram for fastdeploy::vision::ocr::DBDetectorPreprocessor:
Collaboration graph
[legend]

Public Member Functions

virtual bool Apply (FDMatBatch *image_batch, std::vector< FDTensor > *outputs)
 Process the input image and prepare input tensors for runtime. More...
 
void SetMaxSideLen (int max_side_len)
 Set max_side_len for the detection preprocess, default is 960.
 
int GetMaxSideLen () const
 Get max_side_len of the detection preprocess.
 
void SetNormalize (const std::vector< float > &mean, const std::vector< float > &std, bool is_scale)
 
const std::vector< std::array< int, 4 > > * GetBatchImgInfo ()
 
void DisableNormalize ()
 This function will disable normalize in preprocessing step.
 
void DisablePermute ()
 This function will disable hwc2chw in preprocessing step.
 
void SetDetImageShape (const std::vector< int > &det_image_shape)
 
std::vector< int > GetDetImageShape () const
 Get cls_image_shape for the classification preprocess.
 
void SetStaticShapeInfer (bool static_shape_infer)
 
bool GetStaticShapeInfer () const
 Get static_shape_infer of the recognition preprocess.
 
- Public Member Functions inherited from fastdeploy::vision::ProcessorManager
void UseCuda (bool enable_cv_cuda=false, int gpu_id=-1)
 Use CUDA to boost the performance of processors. More...
 
bool Run (std::vector< FDMat > *images, std::vector< FDTensor > *outputs)
 Process the input images and prepare input tensors for runtime. More...
 

Detailed Description

Preprocessor object for DBDetector serials model.

Member Function Documentation

◆ Apply()

bool fastdeploy::vision::ocr::DBDetectorPreprocessor::Apply ( FDMatBatch image_batch,
std::vector< FDTensor > *  outputs 
)
virtual

Process the input image and prepare input tensors for runtime.

Parameters
[in]image_batchThe input image batch
[in]outputsThe output tensors which will feed in runtime
Returns
true if the preprocess successed, otherwise false

Implements fastdeploy::vision::ProcessorManager.

◆ GetBatchImgInfo()

const std::vector<std::array<int, 4> >* fastdeploy::vision::ocr::DBDetectorPreprocessor::GetBatchImgInfo ( )
inline

Get the image info of the last batch, return a list of array {image width, image height, resize width, resize height}

◆ SetDetImageShape()

void fastdeploy::vision::ocr::DBDetectorPreprocessor::SetDetImageShape ( const std::vector< int > &  det_image_shape)
inline

Set det_image_shape for the detection preprocess. This api is usually used when you retrain the model. Generally, you do not need to use it.

◆ SetNormalize()

void fastdeploy::vision::ocr::DBDetectorPreprocessor::SetNormalize ( const std::vector< float > &  mean,
const std::vector< float > &  std,
bool  is_scale 
)
inline

Set preprocess normalize parameters, please call this API to customize the normalize parameters, otherwise it will use the default normalize parameters.

◆ SetStaticShapeInfer()

void fastdeploy::vision::ocr::DBDetectorPreprocessor::SetStaticShapeInfer ( bool  static_shape_infer)
inline

Set static_shape_infer is true or not. When deploy PP-OCR on hardware which can not support dynamic input shape very well, like Huawei Ascned, static_shape_infer needs to to be true.


The documentation for this class was generated from the following files: