Skip to content

how to use another model #25

@younes-zeboudj

Description

@younes-zeboudj

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions