News for hackers. Stuff that matters.
Re:EasyOCR: Ready-to-use OCR with 40 languages by polote on Wednesday July 08, 2020 @08:29AM (#23769197)
What would be the advantage compared to something like Tesseract ?
Re:EasyOCR: Ready-to-use OCR with 40 languages by jonatron on Wednesday July 08, 2020 @08:31AM (#23769212)
Tesseract isn't very accurate, especially with text in photos. It works OK for scanned documents, but that's about it.
Re:EasyOCR: Ready-to-use OCR with 40 languages by sireat on Wednesday July 08, 2020 @10:36AM (#23770274)
Tesseract can be very accurate (>99%), especially when you train it for your particular data set.

This does involve creating your own labeled data.

I got this 99% accuracy by performing incremental training using latest Manheim model as a base. I added about 20k lines which is not really that much. https://github.com/tesseract-ocr/tesseract/wiki

The hard part was crowd sourcing those 20k lines :)

Tesseract might not be best for photos as you said but I did not have major problems.

Of course some documents the source is so bad that a human can't achieve 99%.

Tesseract used to be quite average before they moved onto LTSM models a few years ago.

Re:EasyOCR: Ready-to-use OCR with 40 languages by dclusin on Wednesday July 08, 2020 @10:54AM (#23770451)
Care to share resources/lessons learned for training tesseract with custom data? I'm using it for a side project and would love to hear about your insights.
Re:EasyOCR: Ready-to-use OCR with 40 languages by sireat on Wednesday July 08, 2020 @11:20AM (#23770756)
I followed the resources here: https://github.com/tesseract-ocr/tessdoc/blob/master/Trainin...

Also this: https://github.com/UB-Mannheim/tesseract/wiki

The original data was here: https://github.com/tesseract-ocr/langdata_lstm

I did use another data source from Manheim but can't locate it right now.

Using vanilla Ubuntu 18.04

I looked at the example training files and made a small script to convert my own labeled data to fit the format that tesseract requires.

I did do a bit of pre-processing adjusting contrast.

All the data munging was done on Python (Pillow for image processing, Flask for collecting data into a simple SQLite DB before converting back to format that Tesseract requires).

Python was not necessary just something that felt most comfortable to me. I am sure someone could do it using bash scripts or node.js or anything else.

EDIT: To make life easier for my curators I did run Tesseract first to generate prelabeled data for my training set. It was about 90% accurate to start with.

So the process was: Tesseract OCR on some documents to be trained -> hand curation (2 months)-> train (took about 12 hours) -> 99% (on completely separate test set)

Re:EasyOCR: Ready-to-use OCR with 40 languages by dewhelmed on Wednesday July 08, 2020 @01:41PM (#23772223)
If you don't mind disclosing, what was your particular use-case (the labeled dataset you trained on)?
Re:EasyOCR: Ready-to-use OCR with 40 languages by sireat on Wednesday July 08, 2020 @04:56PM (#23774142)
It was for digitizing 19th century books written in a font and language not supported in a vanilla Tesseract.
Re:EasyOCR: Ready-to-use OCR with 40 languages by yorwba on Wednesday July 08, 2020 @08:39AM (#23769259)
I didn't see any accuracy comparison in the EasyOCR repo.
Re:EasyOCR: Ready-to-use OCR with 40 languages by albertzeyer on Wednesday July 08, 2020 @08:48AM (#23769319)
This depends on the model you use, right? As far as I know, Tesseract supports a couple of models, and you could also use a more powerful neural network in there. And if you have trained it well, it should be fine.
Re:EasyOCR: Ready-to-use OCR with 40 languages by vmarius on Wednesday July 08, 2020 @09:31AM (#23769692)
AFAIK Tesseract is trained to recognize characters and uses a bunch of steps to prepare image for recognition. Steps like removing noise, fixing contrast and resizing.

It means that it performs not-so-good when for example image contains black text and white text on green background since this is not "normalized" through image preparation steps and it cannot detect white text on green background (but you can do it yourself)

Re:EasyOCR: Ready-to-use OCR with 40 languages by rexreed on Wednesday July 08, 2020 @09:34AM (#23769711)
Are there any OCR benchmarks?