Skip to content

Conversation

@jw098
Copy link
Collaborator

@jw098 jw098 commented Jan 14, 2026

No description provided.

@Gin890
Copy link
Collaborator

Gin890 commented Jan 14, 2026

Thanks for adding PaddleOCR!
Some nitpick: can you change new function names to be "lower_case_with_underscore()"? This is the default function naming style for C++

std::unique_ptr<ML::PaddleOCRPipeline> paddle_ocr;
if (use_paddle_ocr) {
// Initialize only if the setting is enabled
paddle_ocr = std::make_unique<ML::PaddleOCRPipeline>(language);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How expensive is this constructor? Is it okay to reinitialize it on every OCR call? Or should we cache like Tesseract?

PaddleOCRPipeline::PaddleOCRPipeline(Language language, std::string rec_path, std::string dict_path)
: m_env{create_ORT_env()}
// , det_session(env, std::wstring(det_path.begin(), det_path.end()).c_str(), Ort::SessionOptions{})
, m_rec_session(create_session(m_env, Ort::SessionOptions{}, rec_path, ML_MODEL_CACHE_PATH() + "PaddleOCRPipeline/"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this definitely looks expensive.

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