This example demonstrates an approach to recognize handwritten Japanese and simplified Chinese text lines using OpenVINO™. For Japanese, this demo supports all the characters in datasets Kondate and Nakayosi. For simplified Chinese, it supports the characters in SCUT-EPT.
The demo workflow is the following:
The demo first reads an image and performs the preprocessing such as resize and padding. Then after loading model to the plugin, the inference will start. After decoding the returned indexes into characters, the demo will display the predicted text.
The list of models supported by the demo is in
<omz_dir>/demos/handwritten_text_recognition_demo/python/models.lst file. This file can be used as a parameter for Model Downloader and Converter to download and, if necessary, convert models to OpenVINO Inference Engine format (*.xml + *.bin).
An example of using the Model Downloader:
An example of using the Model Converter:
The demo depends on:
To install all the required Python modules you can use:
Running the application with the
-h option yields the following usage message:
The decoding char list files provided within Open Model Zoo and for Japanese it is the
<omz_dir>/data/dataset_classes/kondate_nakayosi.txtfile, while for Simplified Chinese it is the
<omz_dir>/data/dataset_classes/scut_ept.txt file. For example, to do inference on a CPU with the OpenVINO™ toolkit pre-trained
handwritten-japanese-recognition-0001 model, run the following command:
designated_characters argument is provided, if the output character is not included in the designated characters, the script will check Top k steps in looking up the decoded character, until a designated one is found. By doing so, the output character will be restricted to a designated region. K is set to 20 by default.
For example, if you want to restrict the output characters to only digits and hyphens, you need to provide the path to the designated character file, for example
digit_hyphen.txt. Then the script will perform a post-filtering processing on the output characters, but please note that it is possible that other characters are still allowed if none of designated characters are in the first K chosen elements. The mentioned characters text file located in the
data subfolder of this demo.
The example command line for use pre-trained
handwritten-simplified-chinese-recognition-0001 model and
The application uses the terminal to show resulting recognition text and inference performance.