Skip to content

Conversation

@yunyaoXYY
Copy link
Collaborator

新增PaddleOCR的检测模型

@CLAassistant
Copy link

CLAassistant commented Jul 28, 2022

CLA assistant check
All committers have signed the CLA.

int gpu_id = 0;

bool delete_pass = false;
std::string delete_pass_name = "";
Copy link
Collaborator

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) {
Copy link
Collaborator

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;
Copy link
Collaborator

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);
Copy link
Collaborator

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 {
Copy link
Collaborator

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) {
Copy link
Collaborator

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(
Copy link
Collaborator

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

"../resources/models/ch_PP-OCRv2_rec_infer/inference.pdmodel";
std::string rec_params_file =
"../resources/models/ch_PP-OCRv2_rec_infer/inference.pdiparams";

Copy link
Collaborator

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的切换

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants