[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

@@ -42,20 +42,23 @@ class FASTDEPLOY_DECL DBDetectorPostprocessor {
double GetDetDBThresh() const { return det_db_thresh_; }
/// Set det_db_box_thresh for the detection postprocess, default is 0.6
void SetDetDBBoxThresh(double det_db_box_thresh)
{ det_db_box_thresh_ = det_db_box_thresh; }
void SetDetDBBoxThresh(double det_db_box_thresh) {
det_db_box_thresh_ = det_db_box_thresh;
}
/// Get det_db_box_thresh of the detection postprocess
double GetDetDBBoxThresh() const { return det_db_box_thresh_; }
/// Set det_db_unclip_ratio for the detection postprocess, default is 1.5
void SetDetDBUnclipRatio(double det_db_unclip_ratio)
{ det_db_unclip_ratio_ = det_db_unclip_ratio; }
void SetDetDBUnclipRatio(double det_db_unclip_ratio) {
det_db_unclip_ratio_ = det_db_unclip_ratio;
}
/// Get det_db_unclip_ratio_ of the detection postprocess
double GetDetDBUnclipRatio() const { return det_db_unclip_ratio_; }
/// Set det_db_score_mode for the detection postprocess, default is 'slow'
void SetDetDBScoreMode(std::string det_db_score_mode)
{ det_db_score_mode_ = det_db_score_mode; }
void SetDetDBScoreMode(const std::string& det_db_score_mode) {
det_db_score_mode_ = det_db_score_mode;
}
/// Get det_db_score_mode_ of the detection postprocess
std::string GetDetDBScoreMode() const { return det_db_score_mode_; }
@@ -64,17 +67,15 @@ class FASTDEPLOY_DECL DBDetectorPostprocessor {
/// Get use_dilation of the detection postprocess
int GetUseDilation() const { return use_dilation_; }
private:
double det_db_thresh_ = 0.3;
double det_db_box_thresh_ = 0.6;
double det_db_unclip_ratio_ = 1.5;
std::string det_db_score_mode_ = "slow";
bool use_dilation_ = false;
private:
PostProcessor util_post_processor_;
bool SingleBatchPostprocessor(const float* out_data,
int n2,
int n3,
bool SingleBatchPostprocessor(const float* out_data, int n2, int n3,
const std::array<int, 4>& det_img_info,
std::vector<std::array<int, 8>>* boxes_result);
};