Giter VIP home page Giter VIP logo

ocr_generate_text_data's Introduction

OCR diversified text data generation project

Introduction

The project code is mainly used to generate OCR related text training data. The project contains a large number of font files, corpus files, near-shaped characters, etc., of which there are more than 20 fonts, corpus data up to 2G, including company corpus Address corpus, novel corpus to meet various needs.

Features

The data generated by the project is used for the training of multiple identification models such as ID cards, business cards, and bills. Comprehensive Synthetic Chinese String Dataset extraction code: fh6h, training recognition The accuracy of the model can reach more than 99%. The text generated by the project is very similar to the 360w data, so it can supplement the insufficient data in the 360w data. The project contains functions such as image rotation, perspective transformation, enhancement, etc. It is powerful, flexible and diverse! Because the corpus files and background images are too large, corpus data network disk address extraction code: awfn

Run

The selected background picture is stored in the back_ground folder in the project. The background picture processing can use the text.py file in the back_ground to enhance the background to meet the needs of recognizing the scene.

The font_file /font_all/ directory in the project stores font files. New fonts need to run the check_font.py file to extract font fonts. If the corresponding file in font_in_all is blank, the font may have errors in use. Results in a blank.

The text_file folder in the project stores corpus data, and the newly added corpus text can be placed in this directory.

Imagaug_image.py in the project can be added in various forms. For details, please refer to the imagaug library

Configure the path in the main.py file, run the main.py file to generate it, and modify the word.py to increase the text sequence of the required scene.

Picture example

Image text

Image text

Image text

Image text

ocr_generate_text_data's People

Contributors

codeachievedream avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

ocr_generate_text_data's Issues

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0

when I replace the fonts with different fonts I have got an error. why could this possibly be? can remove fanti from the code?

Traceback (most recent call last):
File "main.py", line 184, in
local_font = LocalFont()
File "//localfont.py", line 14, in init
self.all_font = self.get_all_font(self.path)
File "/localfont.py", line 29, in get_all_font
font_txt = open(os.path.join(path, font), 'r').read()
File "/Users//opt/anaconda3/lib/python3.8/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 11: invalid start byte

fanti_similar.txt

What does this fanti_similar.txt represent? Can explain it? Thank you for your time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.