I cloned the project and after the following steps tried the ocr-node example and got the error:
❯ node index.js text-detection.rten text-recognition.rten ../../../ocrs/examples/rust-book.jpg
wasm://wasm/ocrs.wasm-0048fb06:1
RuntimeError: unreachable
at ocrs.wasm.__rust_start_panic (wasm://wasm/ocrs.wasm-0048fb06:wasm-function[1845]:0xf1583)
at ocrs.wasm.rust_panic (wasm://wasm/ocrs.wasm-0048fb06:wasm-function[1711]:0xf0f9d)
at ocrs.wasm.std::panicking::rust_panic_with_hook::h6731baa78621a747 (wasm://wasm/ocrs.wasm-0048fb06:wasm-function[955]:0xde7c4)
at ocrs.wasm.std::panicking::begin_panic_handler::{{closure}}::hb6cd8464ed39ae71 (wasm://wasm/ocrs.wasm-0048fb06:wasm-function[1123]:0xe6b81)
at ocrs.wasm.std::sys_common::backtrace::__rust_end_short_backtrace::hbdf3ddeb21a1e747 (wasm://wasm/ocrs.wasm-0048fb06:wasm-function[1808]:0xf149f)
at ocrs.wasm.rust_begin_unwind (wasm://wasm/ocrs.wasm-0048fb06:wasm-function[1381]:0xedfe6)
at ocrs.wasm.core::panicking::panic_fmt::h5c7ce52813e94bcd (wasm://wasm/ocrs.wasm-0048fb06:wasm-function[1410]:0xee6dd)
at ocrs.wasm.std::time::Instant::now::ha67cff2d60f49302 (wasm://wasm/ocrs.wasm-0048fb06:wasm-function[1439]:0xeed82)
at ocrs.wasm.rten::graph::Graph::run_plan::hb41e2a985b803f13 (wasm://wasm/ocrs.wasm-0048fb06:wasm-function[10]:0x12dcc)
at ocrs.wasm.rten::threading::ThreadPool::run::ha413ceca52feeedc (wasm://wasm/ocrs.wasm-0048fb06:wasm-function[823]:0xd5d10)
Node.js v20.2.0
I looked through the commit log and found that I can get a working wasm build with commit: 7e00182983b571fefd8302e10823dc4a09754140
git checkout 7e00182983b571fefd8302e10823dc4a09754140
Thanks for the report. This is indeed a bug in rten v0.11.0. I have updated the dependency to a patch release which resolves the issue. Please let me know if you still encounter issues running the example.
I cloned the project and after the following steps tried the ocr-node example and got the error:
(slightly pedantic) Steps for reproduction:
git checkout main
cargo install wasm-bindgen-cli --version 0.2.89
cargo install wasm-opt
rustup target add wasm32-unknown-unknown
make wasm
cd ocrs/examples
sh ./download-models.sh
cp text-detection.rten ../../js/examples/ocr-node
cp text-recognition.rten ../../js/examples/ocr-node
node index.js text-detection.rten text-recognition.rten ../../../ocrs/examples/rust-book.jpg
I looked through the commit log and found that I can get a working wasm build with commit: 7e00182983b571fefd8302e10823dc4a09754140
git checkout 7e00182983b571fefd8302e10823dc4a09754140