[CVCUDA] PP-OCR Cls & Rec preprocessor support CV-CUDA (#1470)

* ppocr cls preprocessor use manager

* hwc2chw cvcuda

* ppocr rec preproc use manager

* ocr rec preproc cvcuda

* fix rec preproc bug

* ppocr cls&rec preproc set normalize

* fix pybind

* address comment
This commit is contained in:
Wang Xinyu
2023-03-02 10:50:44 +08:00
committed by GitHub
parent fe2882a1ef
commit 044ab993d2
19 changed files with 424 additions and 306 deletions

View File

@@ -55,11 +55,9 @@ DBDetectorPreprocessor::DBDetectorPreprocessor() {
std::vector<float> value = {0, 0, 0};
pad_op_ = std::make_shared<Pad>(0, 0, 0, 0, value);
std::vector<float> mean = {0.485f, 0.456f, 0.406f};
std::vector<float> std = {0.229f, 0.224f, 0.225f};
bool is_scale = true;
normalize_permute_op_ =
std::make_shared<NormalizeAndPermute>(mean, std, is_scale);
normalize_permute_op_ = std::make_shared<NormalizeAndPermute>(
std::vector<float>({0.485f, 0.456f, 0.406f}),
std::vector<float>({0.229f, 0.224f, 0.225f}), true);
}
bool DBDetectorPreprocessor::ResizeImage(FDMat* img, int resize_w, int resize_h,