Live data from Hacker News

Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

github.com

21–30 of 62 posts

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#22
post #2

This is a wrapper around a c++ codebase compiled with emscripten, so "pure" in the title doesn't really make sense.

> so "pure" in the title doesn't really make sense. I can see where you're coming from, but I've never used or heard anyone in the web world use "pure" to mean only "written entirely in Javascript without transpilation or other tools." If it hits the parts of "pure JS" that most people care about: - it's running entirely in Javascript. - it has no native dependencies. - it can run entirely clientside. - it can be emb…

Can emscripten compile to JS? I thought it could only compile to WASM.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#23
post #22

Earlier quoted context omitted.

> so "pure" in the title doesn't really make sense. I can see where you're coming from, but I've never used or heard anyone in the web world use "pure" to mean only "written entirely in Javascript without transpilation or other tools." If it hits the parts of "pure JS" that most people care about: - it's running entirely in Javascript. - it has no native dependencies. - it can run entirely clientside. - it can be emb…

Can emscripten compile to JS? I thought it could only compile to WASM.

Emscripten started as an asm.js compiler iirc ? Or even "plain" js

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#24
post #22

Earlier quoted context omitted.

> so "pure" in the title doesn't really make sense. I can see where you're coming from, but I've never used or heard anyone in the web world use "pure" to mean only "written entirely in Javascript without transpilation or other tools." If it hits the parts of "pure JS" that most people care about: - it's running entirely in Javascript. - it has no native dependencies. - it can run entirely clientside. - it can be emb…

Can emscripten compile to JS? I thought it could only compile to WASM.

IIRC emscripten was around before Browser support for WASM was really a thing.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#25

Tesseract is the most ideal OCRA SDK for reading simple bw documents. If you aim to read “text In the wild” or scene text then Firebase offers a much better alternative. I had a lot of hope for Tesseract 4.0 which is supposed to be based on NNs but it’s so far performed just marginally better than 3.0

For “text In the wild” or scene text, the last time I checked, EasyOCR and PaddleOCR were both good.

I expected these to still be pretty low quality, but surprisingly some quick tests shows that EasyOCR seems to be doing relatively decently at pulling text out of smartphone pics of documents.

Thanks for sharing these -- it's maybe just my very bad searching skills but I had been trying to set some stuff up with Tesseract and had come to the conclusion that I just couldn't use it for document photos and would either need to abandon that effort and buy a faster scanner, or hook into some proprietary service like Google/Apple.

Both of these look really promising, so now I'm excited again about the potential of setting up a fast Open Source way to digitize my documents.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#26
post #22

Earlier quoted context omitted.

> so "pure" in the title doesn't really make sense. I can see where you're coming from, but I've never used or heard anyone in the web world use "pure" to mean only "written entirely in Javascript without transpilation or other tools." If it hits the parts of "pure JS" that most people care about: - it's running entirely in Javascript. - it has no native dependencies. - it can run entirely clientside. - it can be emb…

Can emscripten compile to JS? I thought it could only compile to WASM.

I'm not sure which they're targeting, but early emscripten targeted asm.js, it predated WASM. I would consider asm.js to still be Javascript, it's just an optimized subset of the language.

I'll concede though that if they're targeting WASM it's not technically pure Javascript, but it still feels a bit to me like splitting hairs since it's always been explained to me that WASM and the Javascript runtime under the hood have a lot of overlap.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#27
post #3

Can it be considered "pure" when the project uses WASM ?

In my experience "pure JS" is normally used to differentiate projects from those using NodeJS FFI - the important part is the target / executing runtime (which would be the JS runtime for WASM), rather than the project source.

For my own purposes, the priority for me when reading "pure" is that the core runtime I'm using (the JS runtime) is the only runtime dependency - I'm not depending on external binaries and execution environments like an FFI implementation would.

It also opens up codebases to browser compat, where FFI would typically not be available.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#29

Tesseract is the most ideal OCRA SDK for reading simple bw documents. If you aim to read “text In the wild” or scene text then Firebase offers a much better alternative. I had a lot of hope for Tesseract 4.0 which is supposed to be based on NNs but it’s so far performed just marginally better than 3.0

And what are you supposed to use if you're not doing it on android and can therefore use firebase?

It's part of the Cloud Vision API which supports (g)RPC and REST. Used it in a trading bot to detect if a tweet image (from Elon Musk) contained any mention of the text Doge or Dogecoin, or even a real dog.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#30
post #3

Can it be considered "pure" when the project uses WASM ?

In my experience "pure JS" is normally used to differentiate projects from those using NodeJS FFI - the important part is the target / executing runtime (which would be the JS runtime for WASM), rather than the project source. For my own purposes, the priority for me when reading "pure" is that the core runtime I'm using (the JS runtime) is the only runtime dependency - I'm not depending on external binaries and exec…

WASM is a form of FFI.
Post reply on HN