diff --git a/Cargo.toml b/Cargo.toml index c0afd48..c13cf27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,6 @@ members = [ ] [workspace.dependencies] -rten = { version = "0.24.0", default-features = false, features = ["rten_format"] } +rten = { version = "0.24.0", default-features = false } rten-imageproc = { version = "0.24.0" } rten-tensor = { version = "0.24.0" } diff --git a/ocrs-cli/Cargo.toml b/ocrs-cli/Cargo.toml index aed4f19..c268966 100644 --- a/ocrs-cli/Cargo.toml +++ b/ocrs-cli/Cargo.toml @@ -15,7 +15,7 @@ serde_json = "1.0.149" rten = { workspace = true } rten-imageproc = { workspace = true } rten-tensor = { workspace = true } -ocrs = { path = "../ocrs", version = "0.12.2" } +ocrs = { path = "../ocrs", version = "0.12.2", features = ["rten"] } lexopt = "0.3.2" url = "2.5.4" anyhow = "1.0.102" diff --git a/ocrs/Cargo.toml b/ocrs/Cargo.toml index 5490859..15af684 100644 --- a/ocrs/Cargo.toml +++ b/ocrs/Cargo.toml @@ -28,8 +28,13 @@ lexopt = "0.3.2" rten = { workspace = true } [features] +default = ["export-wasm", "rten"] +# Enables wasm API (i.e. exposes ocrs API to JS) +export-wasm = [] # Enables loading custom models in ONNX format onnx = ["rten/onnx_format"] +# Enables loading custom models in rten format +rten = ["rten/rten_format"] [lib] crate-type = ["lib", "cdylib"] diff --git a/ocrs/src/lib.rs b/ocrs/src/lib.rs index af8d502..95b02e5 100644 --- a/ocrs/src/lib.rs +++ b/ocrs/src/lib.rs @@ -17,7 +17,7 @@ mod test_util; mod text_items; -#[cfg(target_arch = "wasm32")] +#[cfg(all(feature = "export-wasm", target_arch = "wasm32"))] mod wasm_api; use detection::{TextDetector, TextDetectorParams};