FastDeploy
latest
Fast & Easy to Deploy!
|
Preprocessor object for Classifier serials model. More...
#include <cls_preprocessor.h>
Public Member Functions | |
bool | Run (std::vector< FDMat > *images, std::vector< FDTensor > *outputs, size_t start_index, size_t end_index) |
Process the input image and prepare input tensors for runtime. More... | |
virtual bool | Apply (FDMatBatch *image_batch, std::vector< FDTensor > *outputs) |
Implement the virtual function of ProcessorManager, Apply() is the body of Run(). Apply() contains the main logic of preprocessing, Run() is called by users to execute preprocessing. More... | |
void | SetNormalize (const std::vector< float > &mean, const std::vector< float > &std, bool is_scale) |
void | SetClsImageShape (const std::vector< int > &cls_image_shape) |
Set cls_image_shape for the classification preprocess. | |
std::vector< int > | GetClsImageShape () const |
Get cls_image_shape for the classification preprocess. | |
void | DisableNormalize () |
This function will disable normalize in preprocessing step. | |
void | DisablePermute () |
This function will disable hwc2chw in preprocessing step. | |
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... | |
Preprocessor object for Classifier serials model.
|
virtual |
Implement the virtual function of ProcessorManager, Apply() is the body of Run(). Apply() contains the main logic of preprocessing, Run() is called by users to execute preprocessing.
[in] | image_batch | The input image batch |
[in] | outputs | The output tensors which will feed in runtime |
Implements fastdeploy::vision::ProcessorManager.
bool fastdeploy::vision::ocr::ClassifierPreprocessor::Run | ( | std::vector< FDMat > * | images, |
std::vector< FDTensor > * | outputs, | ||
size_t | start_index, | ||
size_t | end_index | ||
) |
Process the input image and prepare input tensors for runtime.
[in] | images | The input data list, all the elements are FDMat |
[in] | outputs | The output tensors which will be fed into runtime |
|
inline |
Set preprocess normalize parameters, please call this API to customize the normalize parameters, otherwise it will use the default normalize parameters.