OCR on embedded images

#44
by tobeornottobesoiguesstobe - opened

Huge thank you for the model! I'm trying to do OCR on documents but some of them has images that contains text. The model can return the text if the image is cropped but since coordinates are not provided, it becomes impossible to extract the related region. What can I do about this? Can fine-tune work?

I have also tried bbox models but the coordinates seem off. Maybe you can provide a demo script? I might be doing something wrong? It works mostly fine for .pdf files but .png files are mostly off.

I added an example below, from your blog actually. Here I can not extract the texts in the image.
mPhnU3GiEO4vvlWdPd4HR

LightOn AI org

Thanks for the feedback! Using the bbox model variant should normally give you normalized coordinates(0-1000). You’ll need to rescale them back to the original image dimensions for the boxes to align correctly.
You can check our Hugging Face Space demo, the code there includes the coordinate conversion and should help.

Sign up or log in to comment