perf.更换飞桨OCR det模型,提高干员名识别率

This commit is contained in:
MistEO
2022-01-30 01:29:18 +08:00
parent a68ebe0f8d
commit b931343d35
2 changed files with 9 additions and 2 deletions

View File

@@ -1 +1 @@
ch_ppocr_mobile_v2.0_det_prune_infer
ch_PP-OCRv2_det_slim_quant_infer

View File

@@ -61,6 +61,11 @@ std::vector<asst::TextRect> asst::OcrPack::recognize(const cv::Mat image, const
std::vector<TextRect> result;
std::string log_str_raw;
std::string log_str_proc;
#ifdef ASST_DEBUG
cv::Mat draw = image.clone();
#endif
for (size_t i = 0; i != size; ++i) {
// the box rect like ↓
// 0 - 1
@@ -80,7 +85,9 @@ std::vector<asst::TextRect> asst::OcrPack::recognize(const cv::Mat image, const
float score = *(scores + i);
TextRect tr{ score, rect, text };
#ifdef ASST_DEBUG
cv::rectangle(draw, utils::make_rect<cv::Rect>(rect), cv::Scalar(0, 0, 255), 2);
#endif
log_str_raw += tr.to_string() + ", ";
if (!pred || pred(tr)) {
log_str_proc += tr.to_string() + ", ";