-
Notifications
You must be signed in to change notification settings - Fork 661
Add PaddleOCR-DBDetector Model Support #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| int gpu_id = 0; | ||
|
|
||
| bool delete_pass = false; | ||
| std::string delete_pass_name = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
将delete_pass_name改为std::vector<std::string> delete_pass_names
然后不用添加bool delete_pass这个参数了,默认就是会遍历delete_pass_names,挨个删除
|
|
||
| void RuntimeOption::DisablePaddleMKLDNN() { pd_enable_mkldnn = false; } | ||
|
|
||
| void RuntimeOption::EnablePaddleDeletePass(std::string pass_name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里同理,就将函数改为RuntimeOption::DeletePaddlePass(const std::string& pass_name) 这个函数每调用一次,就往delete_pass_names里面push_back一次
| pd_option.use_gpu = (option.device == Device::GPU) ? true : false; | ||
| pd_option.gpu_id = option.device_id; | ||
| pd_option.delete_pass = option.pd_delete_pass; | ||
| pd_option.delete_pass_name = option.pd_delete_pass_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PaddleBackendOption同样也增加delete_pass_names这个参数,这里就直接赋过去即可
| // disable mkldnn while use paddle inference in CPU | ||
| void DisablePaddleMKLDNN(); | ||
| // Enable delete in pass | ||
| void EnablePaddleDeletePass(std::string delete_pass_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
见上面comment
| std::string Str(); | ||
| }; | ||
|
|
||
| struct FASTDEPLOY_DECL OCRPredictResult : public BaseResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改为OcrResult,不加Predict了,跟type里面里面的那个OCR也对应了
|
|
||
| const Frontend& det_model_format, const Frontend& cls_model_format, | ||
| const Frontend& rec_model_format) { | ||
| if (use_det) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format都删除
| namespace vision { | ||
| namespace ppocr { | ||
|
|
||
| PPocrsys::PPocrsys( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
system放在application下面。 fastdeploy::application::OCRSystem
examples/vision/ppocrv2_sys.cc
Outdated
| "../resources/models/ch_PP-OCRv2_rec_infer/inference.pdmodel"; | ||
| std::string rec_params_file = | ||
| "../resources/models/ch_PP-OCRv2_rec_infer/inference.pdiparams"; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
application::PPOCRSystemv2()
application::PPOCRSystemv3()
在这里去做32/48的切换
新增PaddleOCR的检测模型