Tesseract is one of the largest Open Source OCR (Optical Character Recognition) projects. There is already a Go library for using Tesseract from Go with CGo, called Gosseract.<p>However if you are interested in OCR from Go without C complicating building and cross-compiling, there aren't any other options.<p>Wazero is a Go WASM runtime that doesn't have any CGo dependencies. With Emscripten Tesseract has been compiled to WASM and ran within Wazero.<p>Gogosseract provides a simple API on top of this. This project has been an interesting delve into the world of WASM.
I wrote a short blog post[1] on this method a while ago. I do think running WASM in embedded runtimes is a pretty good option, but overhead remains high, and WASI remains somewhat fragmented between compilers and runtimes.<p>I think this method really shines in Go as not having CGo simplifies a lot of things, and as a decently performant JITed runtime exists in the form of wazero.<p>[1]: <a href="https://yklcs.com/blog/universal-libs-with-wasm" rel="nofollow noreferrer">https://yklcs.com/blog/universal-libs-with-wasm</a>
This is awesome and one of the things I’m really excited about with WASM, and specifically Wazero. The Wazero team is top notch. Now someone just needs to do this with zstd and make it fast…
Another really interesting way to approach this problem would be to adapt wasm2c to emit Go output. It should result in better performance than wazero.
Thanks for sharing!<p>Since OCR is a somewhat slow process, how does the WASM approach compare to running libtesseract in a subprocess and use some IPC layer to talk to Go? It would require a separate C++ compiler, but not CGo.<p>> one of the largest Open Source OCR<p>Tangential, but are there others as large as Tesseract? It seems to pop up anywhere I look.
Is Tesseract currently the best open source OCR library? Best in terms of accuracy.<p>How much difference is there between Tesseract and the best proprietary solutions?