Skip to content
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

how to use another model #25

Open
younes-zeboudj opened this issue Dec 20, 2024 · 0 comments
Open

how to use another model #25

younes-zeboudj opened this issue Dec 20, 2024 · 0 comments

Comments

@younes-zeboudj
Copy link

I tried to get the models from

https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.7/doc/doc_ch/models_list.md

(the "high" accurancy models)

and converted them to 'onnx' format using 'paddle2onnx'

paddle2onnx --model_dir model_dir \
            --model_filename inference.pdmodel \
            --params_filename inference.pdiparams \
            --save_file model.onnx

And used them as:

ocr = await Ocr.create({
    models:{
      detectionPath: path.resolve(__dirname,'assets', 'ch_PP-OCRv4_det_server_infer.onnx'),
      recognitionPath: path.resolve(__dirname,'assets', 'ch_PP-OCRv4_rec_server_infer.onnx'),
      dictionaryPath:  path.resolve(__dirname,'assets', 'chars.txt'),
    }
  });

But the recognition is not working. If I remove them and use the defaults, it works again.

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

No branches or pull requests

1 participant