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

Model very sensitive on PNG input #336

Open
junyizhao04 opened this issue Mar 6, 2023 · 3 comments
Open

Model very sensitive on PNG input #336

junyizhao04 opened this issue Mar 6, 2023 · 3 comments

Comments

@junyizhao04
Copy link

I tried multiple size and source (photo from screen, paper, screenshot etc) and attempted to run it in Calamari OCR using the given model. However, the model is very sensitive towards input and only around 5% works. What is the expected PNG input size?

@andbue
Copy link
Member

andbue commented Mar 6, 2023

I don't think the input size matters that much. Please note that calamari is line based, it does not include code or models for segmentation tasks. As long as your images is cropped nicely around a single line or you provide coordinates via PAGE XML, it should work.

@junyizhao04
Copy link
Author

I don't think the input size matters that much. Please note that calamari is line based, it does not include code or models for segmentation tasks. As long as your images is cropped nicely around a single line or you provide coordinates via PAGE XML, it should work.

then I believe image like this may work, but it does not.

11

@andbue
Copy link
Member

andbue commented Mar 6, 2023

The uw3 dataset the model uw3-modern-english was trained on contains only binarised data, therefore the model struggles with colour or grayscale images. If you convert your image to monochrome, e.g. via convert online.png -monochrome online.bin.png, it's recognised perfectly.

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

No branches or pull requests

2 participants