16 #include "fastdeploy/vision/common/processors/manager.h" 17 #include "fastdeploy/vision/common/processors/resize.h" 18 #include "fastdeploy/vision/common/processors/pad.h" 19 #include "fastdeploy/vision/common/processors/normalize_and_permute.h" 20 #include "fastdeploy/vision/common/result.h" 38 virtual bool Apply(
FDMatBatch* image_batch, std::vector<FDTensor>* outputs);
50 const std::vector<float>&
std,
52 normalize_permute_op_ =
53 std::make_shared<NormalizeAndPermute>(mean, std, is_scale);
59 return &batch_det_img_info_;
71 det_image_shape_ = det_image_shape;
80 static_shape_infer_ = static_shape_infer;
86 bool ResizeImage(
FDMat* img,
int resize_w,
int resize_h,
int max_resize_w,
89 bool disable_permute_ =
false;
91 bool disable_normalize_ =
false;
92 int max_side_len_ = 960;
93 std::vector<std::array<int, 4>> batch_det_img_info_;
94 std::shared_ptr<Resize> resize_op_;
95 std::shared_ptr<Pad> pad_op_;
96 std::shared_ptr<NormalizeAndPermute> normalize_permute_op_;
97 std::vector<int> det_image_shape_ = {3, 960, 960};
98 bool static_shape_infer_ =
false;
99 std::array<int, 4> OcrDetectorGetInfo(
FDMat* img,
int max_size_len);
void SetNormalize(const std::vector< float > &mean, const std::vector< float > &std, bool is_scale)
Definition: det_preprocessor.h:49
const std::vector< std::array< int, 4 > > * GetBatchImgInfo()
Definition: det_preprocessor.h:58
Definition: float16.h:572
void SetDetImageShape(const std::vector< int > &det_image_shape)
Definition: det_preprocessor.h:70
void SetStaticShapeInfer(bool static_shape_infer)
Definition: det_preprocessor.h:79
Preprocessor object for DBDetector serials model.
Definition: det_preprocessor.h:28
bool GetStaticShapeInfer() const
Get static_shape_infer of the recognition preprocess.
Definition: det_preprocessor.h:83
FDMat is a structure for replace cv::Mat.
Definition: mat.h:34
void SetMaxSideLen(int max_side_len)
Set max_side_len for the detection preprocess, default is 960.
Definition: det_preprocessor.h:41
int GetMaxSideLen() const
Get max_side_len of the detection preprocess.
Definition: det_preprocessor.h:44
std::vector< int > GetDetImageShape() const
Get cls_image_shape for the classification preprocess.
Definition: det_preprocessor.h:74
FDMatBatch contains batch data for preprocess.
Definition: mat_batch.h:28
void DisablePermute()
This function will disable hwc2chw in preprocessing step.
Definition: det_preprocessor.h:65
ProcessorManager for Preprocess.
Definition: manager.h:27
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16
void DisableNormalize()
This function will disable normalize in preprocessing step.
Definition: det_preprocessor.h:63