[package]
edition = "2024"
name = "ocr"
version = "0.1.2"
authors = ["Ying Kit WONG"]
build = false
exclude = [
"examples/images/*",
"target/*",
".git/*",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A pure Rust CLI OCR tool for printed text extraction"
homepage = "https://github.com/yingkitw/ocr"
documentation = "https://docs.rs/ocr"
readme = "README.md"
keywords = [
"ocr",
"text-recognition",
"computer-vision",
"tesseract",
"cli",
]
categories = [
"command-line-utilities",
"multimedia::images",
"text-processing",
]
license = "Apache-2.0"
repository = "https://github.com/yingkitw/ocr"
[features]
cuda = ["dep:cudarc"]
default = ["simd"]
onnx = ["dep:onnx-rs"]
opencl = ["dep:ocl"]
opencv = []
pdf = ["dep:pdf"]
pdf-output = ["dep:printpdf"]
simd = []
web-api = [
"dep:axum",
"dep:tower",
"dep:tower-http",
"dep:multer",
"dep:reqwest",
]
[lib]
name = "ocr"
path = "src/lib.rs"
[[bin]]
name = "ocr"
path = "src/main.rs"
[[example]]
name = "create_test_images"
path = "examples/create_test_images.rs"
[[example]]
name = "font_sizes"
path = "examples/font_sizes.rs"
[[example]]
name = "font_styles"
path = "examples/font_styles.rs"
[[example]]
name = "generate_test_images"
path = "examples/generate_test_images.rs"
[[example]]
name = "ocr_demo"
path = "examples/ocr_demo.rs"
[[example]]
name = "simple_ocr_test"
path = "examples/simple_ocr_test.rs"
[[example]]
name = "system_font"
path = "examples/system_font.rs"
[[example]]
name = "test_ocr"
path = "examples/test_ocr.rs"
[[test]]
name = "basic_tests"
path = "tests/basic_tests.rs"
[[test]]
name = "cli_tests"
path = "tests/cli_tests.rs"
[[test]]
name = "integration_tests"
path = "tests/integration_tests.rs"
[[test]]
name = "ocr_test"
path = "tests/ocr_test.rs"
[[test]]
name = "round_trip_test"
path = "tests/round_trip_test.rs"
[[test]]
name = "snapshot_tests"
path = "tests/snapshot_tests.rs"
[[test]]
name = "test_images_benchmark"
path = "tests/test_images_benchmark.rs"
[[test]]
name = "test_images_test"
path = "tests/test_images_test.rs"
[[test]]
name = "test_web_api"
path = "tests/test_web_api.rs"
[dependencies.anyhow]
version = "1.0"
[dependencies.axum]
version = "0.7"
features = ["multipart"]
optional = true
[dependencies.chrono]
version = "0.4"
features = [
"clock",
"std",
"serde",
]
default-features = false
[dependencies.clap]
version = "4"
features = ["derive"]
[dependencies.cudarc]
version = "0.12"
features = ["cuda-12040"]
optional = true
[dependencies.image]
version = "0.24"
features = [
"png",
"jpeg",
"gif",
"bmp",
"tiff",
"webp",
]
default-features = false
[dependencies.imageproc]
version = "0.23"
[dependencies.multer]
version = "3"
optional = true
[dependencies.ndarray]
version = "0.15"
[dependencies.ocl]
version = "0.19"
optional = true
[dependencies.onnx-rs]
version = "0.1"
optional = true
[dependencies.pdf]
version = "0.9"
optional = true
default-features = false
[dependencies.printpdf]
version = "0.9.1"
features = ["images"]
optional = true
[dependencies.rand]
version = "0.8"
[dependencies.rayon]
version = "1.8"
[dependencies.reqwest]
version = "0.12"
features = [
"multipart",
"json",
]
optional = true
[dependencies.rusttype]
version = "0.9"
[dependencies.serde]
version = "1.0"
features = ["derive"]
[dependencies.serde_json]
version = "1.0"
[dependencies.thiserror]
version = "1.0"
[dependencies.tokio]
version = "1.0"
features = [
"rt-multi-thread",
"macros",
"fs",
"sync",
"net",
"io-util",
]
[dependencies.tower]
version = "0.4"
optional = true
[dependencies.tower-http]
version = "0.5"
features = [
"cors",
"limit",
]
optional = true
[dependencies.tracing]
version = "0.1"
[dependencies.tracing-subscriber]
version = "0.3"
features = [
"env-filter",
"fmt",
"std",
"ansi",
]
default-features = false
[dev-dependencies.assert_cmd]
version = "2.0"
[dev-dependencies.insta]
version = "1.0"
[dev-dependencies.predicates]
version = "3.0"
[dev-dependencies.tempfile]
version = "3.8"
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
panic = "abort"
strip = true