16 #include "fastdeploy/vision/common/processors/transform.h" 17 #include "fastdeploy/vision/common/processors/manager.h" 18 #include "fastdeploy/vision/common/result.h" 36 bool Run(std::vector<FDMat>* images, std::vector<FDTensor>* outputs,
37 size_t start_index,
size_t end_index);
47 virtual bool Apply(
FDMatBatch* image_batch, std::vector<FDTensor>* outputs);
53 const std::vector<float>&
std,
55 normalize_op_ = std::make_shared<Normalize>(mean, std, is_scale);
60 cls_image_shape_ = cls_image_shape;
71 void OcrClassifierResizeImage(
FDMat* mat,
72 const std::vector<int>& cls_image_shape);
74 bool disable_permute_ =
false;
76 bool disable_normalize_ =
false;
77 std::vector<int> cls_image_shape_ = {3, 48, 192};
79 std::shared_ptr<Resize> resize_op_;
80 std::shared_ptr<Pad> pad_op_;
81 std::shared_ptr<Normalize> normalize_op_;
82 std::shared_ptr<HWC2CHW> hwc2chw_op_;
void DisablePermute()
This function will disable hwc2chw in preprocessing step.
Definition: cls_preprocessor.h:68
bool Run(std::vector< FDMat > *images, std::vector< FDTensor > *outputs)
Process the input images and prepare input tensors for runtime.
Definition: manager.cc:91
Definition: float16.h:572
void SetNormalize(const std::vector< float > &mean, const std::vector< float > &std, bool is_scale)
Definition: cls_preprocessor.h:52
FDMat is a structure for replace cv::Mat.
Definition: mat.h:34
Preprocessor object for Classifier serials model.
Definition: cls_preprocessor.h:26
FDMatBatch contains batch data for preprocess.
Definition: mat_batch.h:28
void SetClsImageShape(const std::vector< int > &cls_image_shape)
Set cls_image_shape for the classification preprocess.
Definition: cls_preprocessor.h:59
ProcessorManager for Preprocess.
Definition: manager.h:27
void DisableNormalize()
This function will disable normalize in preprocessing step.
Definition: cls_preprocessor.h:66
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16
std::vector< int > GetClsImageShape() const
Get cls_image_shape for the classification preprocess.
Definition: cls_preprocessor.h:63