Live data from Hacker News

Rolling your own serverless OCR in 40 lines of code

christopherkrapu.com

11–20 of 69 posts

Re: Rolling your own serverless OCR in 40 lines of code

#11

Wouldn't "Serverless OCR" mean something like running tesseract locally on your computer, rather than creating an AI framework and running it on a server?

Thanks for noting this - for a moment I was excited.

When people mentions the number of lines of code, I've started to become suspicious. More often than not it's X number of lines, calling a massive library loading a large model, either locally or remote. We're just waiting for spinning up your entire company infrastructure in two lines of code, and then just being presented a Terraform shell script wrapper.

I do agree with the use of serverless though. I feel like we agree long ago that serverless just means that you're not spinning up a physical or virtual server, but simply ask some cloud infrastructure to run your code, without having to care about how it's run.

Re: Rolling your own serverless OCR in 40 lines of code

#12

Deepseek OCR is no longer state of the art. There are much better open source OCR models available now. ocrarena.ai maintains a leaderboard, and a number of other open source options like dots [1] or olmOCR [2] rank higher. [1] https://www.ocrarena.ai/compare/dots-ocr/deepseek-ocr [2] https://www.ocrarena.ai/compare/olmocr-2/deepseek-ocr

The article mentions choosing the model for its ability to parse math well.

Re: Rolling your own serverless OCR in 40 lines of code

#13

Deepseek OCR is no longer state of the art. There are much better open source OCR models available now. ocrarena.ai maintains a leaderboard, and a number of other open source options like dots [1] or olmOCR [2] rank higher. [1] https://www.ocrarena.ai/compare/dots-ocr/deepseek-ocr [2] https://www.ocrarena.ai/compare/olmocr-2/deepseek-ocr

I wasn't aware of dots when I wrote the blog post. This is really good to know!! I would like to try again with some newer models.

Re: Rolling your own serverless OCR in 40 lines of code

#14

Deepseek OCR is no longer state of the art. There are much better open source OCR models available now. ocrarena.ai maintains a leaderboard, and a number of other open source options like dots [1] or olmOCR [2] rank higher. [1] https://www.ocrarena.ai/compare/dots-ocr/deepseek-ocr [2] https://www.ocrarena.ai/compare/olmocr-2/deepseek-ocr

you are comparing to DeepSeek's old OCR, there's DeepSeek-OCR2 which btw is amazing from my experimentations. https://huggingface.co/deepseek-ai/DeepSeek-OCR-2

Re: Rolling your own serverless OCR in 40 lines of code

#16
I am working on a client project, originally built using Google Vision APIs, and then I realized Tesseract is so good. Like really good. Also, if PDF text is available, then pdftotext tools are awesome.

My client's usecase was specific to scanning medical reports but since there are thousands of labs in India which have slightly different formats, I built an LLM agent which works only after the pdf/image to text process - to double check the medical terminology. That too, only if our code cannot already process each text line through simple string/regex matches.

There are perhaps extremely efficient tools to do many of the work where we throw the problem at LLMs.

Re: Rolling your own serverless OCR in 40 lines of code

#19
post #8

Question for the crowd -- with autoscaling, when a new pod is created it will still download the model right from huggingface? I like to push everything into the image as much as I can. So in the image modal, I would run a command to trigger downloading the model. Then in the app just point to the locally downloaded model. So bigger image, but do not need to redownload on start up.

[flagged]

Re: Rolling your own serverless OCR in 40 lines of code

#20

Wouldn't "Serverless OCR" mean something like running tesseract locally on your computer, rather than creating an AI framework and running it on a server?

Running it locally would typically be called “client(-)side”.

But this caught me for a bit as well. :-)

Post reply on HN