-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
trOCR run example #451
Comments
@wolfshow would be great if you can fix my notebook to run inference with TrOCR on one particular image: https://colab.research.google.com/drive/1BHkOBUGHr1xlVQ9pLVLZPA0VvAxF4Zo_?usp=sharing |
@Dod-o will help providing an inference example on that. |
@NielsRogge The inference example has been uploaded, please see details in pic_inference.py |
@Dod-o when running pic_inference.py, I get the following error: urllib.error.HTTPError: HTTP Error 404: Not Found Any help please, thank you!! |
@SeifeddineGharbi I figured it out (I had to create a custom fork of Fairseq in order to make it work). Expect TrOCR to be added to Transformers soon ;) |
@NielsRogge Thank you so much for replying but can you explain a bit further, please? |
We found the fairseq model cannot be easily converted into the hf format. So we need to take more time to re-train the models with the hf library. |
Hugging face has uploaded the trocr model in their models. You can look into it. |
@nithinreddyy haha I wrote that page 😅 |
Yaaa 😬😬. I gone through the 3 notebooks, but you haven't written code for testing the image and extracting the text (For fine tuning model with IAM dataset). In the 2nd notebook you trained the model with IAM dataset, in 3rd notebook you just checked the test evaluation scores. But how to take one image from test data and extract the text? |
My inference notebook does exactly what you want. |
But you are directly loading the model from hugging face. What if we have our own dataset and want to train the model with data? In 2nd notebook You've trained the custom model with IAM dataset and you haven't written code how to extract text from one of the test images. I'm looking for that. |
Sorry, I thought you were talking about recognizing text, but you mean extracting text. The IAM dataset only contains single-line text images, hence one doesn't need to perform any text extraction anymore. However, if you want to apply TrOCR on an entire PDF document, then you first need a text extraction algorithm. You can for example take a look at this one: https://github.com/qurator-spk/eynollah |
Many thanks for trOCR!! I couldn't run trOCR on text. How to run it, can you give an exaample pls.
Model I am using trOCR.
The text was updated successfully, but these errors were encountered: