[Model] change ocr pre and post (#568)

* change ocr pre and post

* add pybind

* change ocr

* fix bug

* fix bug

* fix bug

* fix bug

* fix bug

* fix bug

* fix copy bug

* fix code style

* fix bug

* add new function

* fix windows ci bug
This commit is contained in:
Thomas Young
2022-11-18 13:17:42 +08:00
committed by GitHub
parent 1609ce1bab
commit 143506b654
31 changed files with 1402 additions and 569 deletions

10
fastdeploy/vision/ocr/ppocr/utils/ocr_postprocess_op.cc Normal file → Executable file
View File

@@ -318,10 +318,12 @@ std::vector<std::vector<std::vector<int>>> PostProcessor::BoxesFromBitmap(
}
std::vector<std::vector<std::vector<int>>> PostProcessor::FilterTagDetRes(
std::vector<std::vector<std::vector<int>>> boxes, float ratio_h,
float ratio_w, const std::map<std::string, std::array<float, 2>> &im_info) {
int oriimg_h = im_info.at("input_shape")[0];
int oriimg_w = im_info.at("input_shape")[1];
std::vector<std::vector<std::vector<int>>> boxes,
const std::array<int,4>& det_img_info) {
int oriimg_w = det_img_info[0];
int oriimg_h = det_img_info[1];
float ratio_w = float(det_img_info[2])/float(oriimg_w);
float ratio_h = float(det_img_info[3])/float(oriimg_h);
std::vector<std::vector<std::vector<int>>> root_points;
for (int n = 0; n < boxes.size(); n++) {