Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Alternative AI OCR "surya" as opposed to EasyOCR, Just found it today and it dominated the accuracy and speed of Tesseract & EasyOCR #1330

Open
abclution opened this issue Jun 11, 2024 · 4 comments
Assignees

Comments

@abclution
Copy link

abclution commented Jun 11, 2024

Describe the proposed feature

@jbarlow83 First off, thanks for this excellent software.

I wanted to share this amazing AI OCR I came across today, surya
https://github.com/VikParuchuri/surya

Its accuracy and speed were miles ahead of both Tesseract and EasyOCR.

I tried to use the EasyOCR plugin, but I had similar issues as reported on the plugin issues page as other users and was in the end unable to use it as part of the OCRmyPDF integrated workflow. This may be due to non Nvidia hardware, but I was able to use EasyOCR outside of OCRmyPDF.

First off, surya has the same problem as EasyOCR, no hOCR output built in for easy plug in play alignment of detected text. It does however export some clearly and simply defined json that I believe a surya json output to hOCR converter would be enough.

Installation of surya is painless enough. As well as it includes a streamlit demo gui to test it quickly.
I will put some images here that I was unable to get Tesseract to find any text (red text on pink background, lol) even after pre-processing.

Scaled version of the image sent to surya
image

Detected text overlay as image
image

Surya Detected Reading Order
image

With EasyOCR I encountered errors in the first line of text detected

([[531, 46], [1359, 46], [1359, 90], [531, 90]], 'GENERAL INEQRMATION EQR TAXPAYERS (cont )', 0.4053220359982469)

and the rest of the output continued similarly.

Due to how surya detects the text correctly and the reading order correctly text can indexed for search and in databases more correctly.

Anyways, just thought I would share what I found.

@hcoona
Copy link

hcoona commented Jun 27, 2024

Watching. Marker has adopt Surya-OCR and do have a better result.

@hcoona
Copy link

hcoona commented Jun 27, 2024

It would be better if we can make the OCR engine pluggable and maybe we can add Azure OCR etc.

@hcoona
Copy link

hcoona commented Jun 27, 2024

I submit an issue to Surya to see if they can support hOCR format.

VikParuchuri/surya#139

@iiLaurens
Copy link

As much as this could be great for performance, I would heed the license of Surya. GPL 3.0 is a strong copyleft license which will require OCRmyPDF to change license too. This in turn will restrict commercial usage of OCRmyPDF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants