57 lines
2.8 KiB
Plaintext
57 lines
2.8 KiB
Plaintext
@version 1
|
|
# OCR models. Each [model NAME] names the files it needs from this folder (fetch_models.jai
|
|
# downloads them) and how it is run; ocr_create takes the NAME. Changes apply to engines created
|
|
# after the file is saved.
|
|
#
|
|
# title shown to people
|
|
# detector, recognizer, dictionary file names, quoted
|
|
# textline_ori optional: a text line orientation classifier's file name, quoted; lines it
|
|
# finds upside down are read both ways and the more confident reading kept
|
|
# det_max_side wider images are scaled down to this width for detection (px)
|
|
# det_tile_height taller images are detected in overlapping strips this high (px, after scaling)
|
|
# det_threshold a pixel is text when its probability is above this
|
|
# box_threshold a text region is kept when its mean probability is at least this
|
|
# unclip_ratio how far each region is grown, as DB detection networks expect
|
|
# rec_height each text line is scaled to this height for recognition (px)
|
|
# rec_batch_gpu text lines recognized together in one run, on the GPU
|
|
# rec_batch_cpu the same on the CPU, where one at a time is fastest: a batch is padded to its
|
|
# widest line, and the padding costs time and changes what is read a little
|
|
# detector_coreml, recognizer_coreml
|
|
# macOS: the detector and recognizer as Core ML packages, quoted, run on the GPU
|
|
# (tools/export_ppocr_coreml.py makes them); without both, onnxruntime runs OCR
|
|
# coreml_det_height_step, coreml_det_width_step, coreml_rec_batch, coreml_rec_width_step
|
|
# the sizes those packages take, as the script made them (the defaults: 128, 256,
|
|
# 16, 64): detection strips are padded up to the steps, lines to 16 at the step
|
|
|
|
[model ppocr-v5-mobile]
|
|
title: "PP-OCRv5 mobile (light)"
|
|
detector: "ch_PP-OCRv5_det_mobile.onnx"
|
|
recognizer: "ch_PP-OCRv5_rec_mobile.onnx"
|
|
dictionary: "ppocrv5_dict.txt"
|
|
textline_ori: "ch_PP-LCNet_x0_25_textline_ori_cls_mobile.onnx"
|
|
det_max_side: 2560
|
|
det_tile_height: 1536
|
|
det_threshold: 0.3
|
|
box_threshold: 0.6
|
|
unclip_ratio: 1.5
|
|
rec_height: 48
|
|
rec_batch_gpu: 16
|
|
rec_batch_cpu: 1
|
|
detector_coreml: "ch_PP-OCRv5_det_mobile.mlpackage"
|
|
recognizer_coreml: "ch_PP-OCRv5_rec_mobile.mlpackage"
|
|
|
|
[model ppocr-v5-server]
|
|
title: "PP-OCRv5 server (heavy)"
|
|
detector: "ch_PP-OCRv5_det_server.onnx"
|
|
recognizer: "ch_PP-OCRv5_rec_server.onnx"
|
|
dictionary: "ppocrv5_dict.txt"
|
|
textline_ori: "ch_PP-LCNet_x0_25_textline_ori_cls_mobile.onnx"
|
|
det_max_side: 2560
|
|
det_tile_height: 1536
|
|
det_threshold: 0.3
|
|
box_threshold: 0.6
|
|
unclip_ratio: 1.5
|
|
rec_height: 48
|
|
rec_batch_gpu: 8
|
|
rec_batch_cpu: 1
|