[Bug Fix] add ocr new feature and fix codestyle (#764)

* fix ocr bug and add new feature

* fix bug

* fix bug

* fix bug

* fix bug

* fix bug

* fix bug

* add property

* add test

* fix code style

* fix bug

* fix bug

* fix bug

* fix port

* fix ocr

* fix_ocr

* fix ocr

* fix ocr

* fix ocr

* fix ocr

* Update paddle2onnx.cmake

* Update paddle2onnx.cmake

* Update paddle2onnx.cmake

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: Jason <928090362@qq.com>
This commit is contained in:
Thomas Young
2022-12-07 19:31:54 +08:00
committed by GitHub
parent e6af8f2334
commit 5df62485c3
33 changed files with 1222 additions and 376 deletions

View File

@@ -24,11 +24,6 @@ namespace ocr {
*/
class FASTDEPLOY_DECL ClassifierPreprocessor {
public:
/** \brief Create a preprocessor instance for Classifier serials model
*
*/
ClassifierPreprocessor();
/** \brief Process the input image and prepare input tensors for runtime
*
* \param[in] images The input image data list, all the elements are returned by cv::imread()
@@ -36,14 +31,13 @@ class FASTDEPLOY_DECL ClassifierPreprocessor {
* \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,
size_t start_index, size_t end_index);
std::vector<float> mean_ = {0.5f, 0.5f, 0.5f};
std::vector<float> scale_ = {0.5f, 0.5f, 0.5f};
bool is_scale_ = true;
std::vector<int> cls_image_shape_ = {3, 48, 192};
private:
bool initialized_ = false;
};
} // namespace ocr