Skip to content

vanya-robot/U-Net_OCR

Repository files navigation

Russian language OCR built with U-Net models and CRNN (plus additional Faster-RCNN for russian passport recognition task).

Use by running pipeline_general.py (for general text recognition purposes)

or pipeline_passport.py (for Russian Federation passport recognition)

Recognition model that is presented here were trained on these fonts (cyrillic): Arial, Courier New, OCR B.

General system pipeline:

  1. U-Net trained to segment lines of text from image (pic. 1).
  2. U-Net trained to segment words from lines of text (pic. 2).
  3. CRNN trained to recognize words (fonts, on which it was trained are located in ./data_generator/fonts/).

alt text

pic. 1 (Mask of lines in the image)

pic. 2 (Mask of words in line)

pic. 3 (Recognition of words by CRNN)

For better performance

You should re-train CRNN with fonts that it will be recognizing in your task (add your fonts to data_generator/fonts/ and proceed to Russian_OCR_part_1.ipynb).

For Russian passport recognition

Faster-RCNN were added to detect area of image with First name, Last name and Patronymic (pic. 4).

pic. 4 (Passport recognition)

Then General pipeline is used to recognize this as regular image.