[Model] Update PPOCR code style (#1160)

* 更新代码风格

* 更新代码风格

* 更新代码风格

* 更新代码风格
This commit is contained in:
Zheng-Bicheng
2023-01-17 19:51:06 +08:00
committed by GitHub
parent 5f8d9d2626
commit db5e90f285
9 changed files with 85 additions and 70 deletions

View File

@@ -31,8 +31,7 @@ class FASTDEPLOY_DECL DBDetectorPreprocessor {
* \param[in] batch_det_img_info_ptr The output of preprocess
* \return true if the preprocess successed, otherwise false
*/
bool Run(std::vector<FDMat>* images,
std::vector<FDTensor>* outputs,
bool Run(std::vector<FDMat>* images, std::vector<FDTensor>* outputs,
std::vector<std::array<int, 4>>* batch_det_img_info_ptr);
/// Set max_side_len for the detection preprocess, default is 960
@@ -41,12 +40,12 @@ class FASTDEPLOY_DECL DBDetectorPreprocessor {
int GetMaxSideLen() const { return max_side_len_; }
/// Set mean value for the image normalization in detection preprocess
void SetMean(std::vector<float> mean) { mean_ = mean; }
void SetMean(const std::vector<float>& mean) { mean_ = mean; }
/// Get mean value of the image normalization in detection preprocess
std::vector<float> GetMean() const { return mean_; }
/// Set scale value for the image normalization in detection preprocess
void SetScale(std::vector<float> scale) { scale_ = scale; }
void SetScale(const std::vector<float>& scale) { scale_ = scale; }
/// Get scale value of the image normalization in detection preprocess
std::vector<float> GetScale() const { return scale_; }
@@ -55,6 +54,7 @@ class FASTDEPLOY_DECL DBDetectorPreprocessor {
/// Get is_scale of the image normalization in detection preprocess
bool GetIsScale() const { return is_scale_; }
private:
int max_side_len_ = 960;
std::vector<float> mean_ = {0.485f, 0.456f, 0.406f};
std::vector<float> scale_ = {0.229f, 0.224f, 0.225f};