Rolling your own serverless OCR in 40 lines of code
21–30 of 69 posts
Re: Rolling your own serverless OCR in 40 lines of code
#22Re: Rolling your own serverless OCR in 40 lines of code
#23Slight tangent: i was wondering why DeepSeek would develop something like this. In the linked paper it says > In production, DeepSeek-OCR can generate training data for LLMs/VLMs at a scale of 200k+ pages per day (a single A100-40G). That... doesn't sound legal
Re: Rolling your own serverless OCR in 40 lines of code
#24Wouldn'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.
https://github.com/zai-org/GLM-OCR
(Shameless plug: I also maintain a simplified version of GLM-OCR without dependency on the transformers library, which makes it much easier to install: https://github.com/99991/Simple-GLM-OCR/)
Re: Rolling your own serverless OCR in 40 lines of code
#25That book is freely available from its author in pdf format already… but I guess it’s about the journey?
Re: Rolling your own serverless OCR in 40 lines of code
#26 #!/usr/bin/env bash
# requires: tesseract-ocr imagemagick maim xsel
IMG=$(mktemp)
trap "rm $IMG*" EXIT
# --nodrag means click 2x
maim -s --nodrag --quality=10 $IMG.png
# should increase detection rate
mogrify -modulate 100,0 -resize 400% $IMG.png
tesseract $IMG.png $IMG &>/dev/null
cat $IMG.txt | xsel -bi
notify-send "Text copied" "$(cat $IMG.txt)"
exitRe: Rolling your own serverless OCR in 40 lines of code
#27Re: Rolling your own serverless OCR in 40 lines of code
#28So I'm trying to OCR 1000s of pages of old french dictionaries from the 1700s, has anything popped up that doesn't cost an arm and a leg, and works pretty decently?
Re: Rolling your own serverless OCR in 40 lines of code
#29Re: Rolling your own serverless OCR in 40 lines of code
#30That book is freely available from its author in pdf format already… but I guess it’s about the journey?