YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Configuration File Description
This model is converted from Paddle's open-source model to ONNX for integration with the Spire.OCR product. Underlying model source: PP-OCR-v6. ocr.xml is used to configure the model path, dependent libraries, and recognition languages.
lite Platform Configuration
When platform is lite, the ocr.xml configuration is as follows:
<?xml version="1.0"?>
<ocr>
<platform>lite</platform>
<version>1.0</version>
<configs>
<modelPath>model</modelPath>
<useClsModel>0</useClsModel>
</configs>
</ocr>
When <platform>lite</platform>, there is no need to configure the dependent library path (libPath) or the language types to be recognized (lang).
Supported Languages
The lite recognition model supports 50 languages, and the tiny tier supports 49 languages (excluding Japanese).
Core Languages (4)
Simplified Chinese, Traditional Chinese, English, Japanese.
Latin Language Family (46)
French, German, Italian, Spanish, Portuguese, Dutch, Polish, Romanian, Czech, Swedish, Norwegian, Danish, Finnish, Hungarian, Turkish, Vietnamese, Indonesian, Malay, Azerbaijani, Afrikaans, Bosnian, Croatian, Welsh, Estonian, Irish, Icelandic, Kurdish, Lithuanian, Latvian, Maltese, Maori, Occitan, Slovak, Slovenian, Albanian, Swahili, Tagalog, Uzbek, Latin, Serbian (Latin), Catalan, Basque, Galician, Luxembourgish, Romansh, Quechua.
If you need to recognize languages not in the above list (such as Korean, Russian, or Arabic), please use the full (non-lite) platform and configure the corresponding language pack or custom language model via the lang field.
Configuration Parameters
modelPath (Model Path)
- Function: Specifies the storage location of the language model data used by the OCR engine.
- Type: Relative path (relative to the
ocr.xmlfile) or absolute path of the model directory. - Default Value:
"model", which refers to the directory where theocr.xmlfile is located. - Modification Notes: You can modify this path to point to another directory storing model data. Ensure the new path is correct and the model data is compatible with the OCR engine.
libPath (Library Path)
- Function: Specifies the storage path of the dependent libraries required by the OCR engine.
- Type: Relative path (relative to the
ocr.xmlfile) or absolute path of the dependent library directory. - Default Value:
"lib", which refers to the directory where theocr.xmlfile is located. - Modification Notes: If your dependent libraries are stored in other locations, you can modify this path. Verify the accuracy of the path and ensure all necessary dependent libraries are present.
lang (Language Type)
Function: Sets the languages to be recognized by the OCR engine, supporting system preset language packs and user-defined language models.
Format: The folder name of the corresponding language pack (or custom model) under the model directory.
Default Value:
"english".Modification Notes: Simply modify this value to the folder name of the required language pack/custom model. Ensure that a folder with the same name exists in the directory specified by
modelPath, and the folder contains complete model data.Language Pack Changes and Automatic Matching Rules Across Versions: Early versions supported language packs including
Chinese,Chinesetraditional,English,French,German,Japan, andKorean. The current version only retains core language packs:ch,english,korean, andlatin. To ensure compatibility, the program has added an automatic matching logic:- If early-version language pack names (e.g.,
Chinese,Chinesetraditional,Japan) are set in thelangfield, the program will first check whether the corresponding folders exist in the model directory. If not, it will automatically match thechlanguage pack for recognition (sincechsupports mixed recognition of Chinese, English, and Japanese, covering the needs of the above languages). - If
FrenchorGermanare set, the program will first check the corresponding folders. If not found, it will automatically match thelatinlanguage pack (which supports recognition of multiple languages such as English, French, and German).
- If early-version language pack names (e.g.,
Preset Language Recognition Packs and Capabilities Supported in Current Version:
ch: Supports mixed recognition of Chinese, English, and Japanese, covering Simplified Chinese, Chinese Pinyin, Traditional Chinese, English, and Japanese.english: Only supports English recognition.korean: Only supports Korean recognition.latin: Supports multi-language recognition, covering English, French, German, and Latin.
Custom Language Recognition Model Notes: The platform supports user-defined language recognition models. To use a custom model, there is no need to modify complex configurations. You only need to create a dedicated folder (the folder name can be customized, e.g.,
"custom-lang") under the model directory specified bymodelPath, and place the complete data of the custom model in the folder. Then fill in the name of this custom folder in thelangfield to complete the configuration and use of the custom model.
Important Notes
- Modification Restrictions: Do not modify any fields other than
modelPath,libPath, andlang. Modifying other parameters such asplatformandversionmay cause the OCR engine to run abnormally or result in incorrect recognition results. - Path Flexibility: Both
modelPathandlibPathsupport relative and absolute paths, facilitating flexible management of OCR-related resources. - Model/Language Pack Availability: Before modifying the
langfield, confirm that the corresponding preset language pack or custom model folder exists in the directory specified bymodelPath, and the folder contains complete model data (preset packs need to ensure the integrity of the language pack, and custom models need to comply with engine compatibility specifications). For example, when settinglang="ch", ensure that a language pack folder named"ch"exists in the model directory; when setting a custom model, ensure that the value oflangis exactly the same as the name of the custom folder. - Target Platforms for Dependent Libraries: Supported target platforms include Windows X64, macOS 10.15, and Linux Ubuntu 18.04 LTS. When using, ensure that the version of the dependent libraries used is not lower than the requirements of the above target platforms.
- Mixed Language Recognition Notes: When using the
chorlatinpreset language packs, the OCR engine will automatically recognize all languages within the corresponding scope without separate switching, making it suitable for text recognition scenarios containing multiple languages. - Custom Model Compatibility: Custom models must be compatible with the current version of the Spire.OCR engine. It is recommended to develop based on the official model templates to avoid recognition failures caused by incompatible model formats.