This project is a Rust-based microservice designed for extracting text from scanned documents using Optical Character Recognition (OCR) technology. The microservice provides a simple and efficient way to upload scanned documents and retrieve the extracted text.
- Text Extraction: Utilize OCR capabilities to extract text from uploaded scanned documents.
-
Ensure you have Rust installed on your system.
-
Clone the repository:
git clone https://github.com/openchatai/rust_ocr
-
Navigate to the project directory:
cd rust_ocr
-
Build the project:
cargo build --release
-
Run the microservice:
./target/release/rust_ocr
The microservice will be running on
http://localhost:8000
.Docker Image:
The latest build will appear for arm by default whenever code is pushed to the GitHub repo. For other architectures, use the edge build tag or build from source. Contributions are welcome.
Prebuilt Docker images for the Rust OCR Microservice are available on Docker Hub. You can choose the appropriate image for your architecture from the following link:
Once you have pulled the Docker image, you can run the Rust OCR Microservice using the following command:
docker run -p 8000:8000 codebanesr/rust_ocr:your_tag
Replace your_tag
with the specific tag of the Docker image you want to use.
version: '3'
services:
rust_ocr:
image: codebanesr/rust_ocr:edge
ports:
- "8000:8000"
Retrieve the extracted text using the following curl
command:
curl --location 'http://localhost:8000/api/file/ocr' \
--form 'file=@"/Users/shanurrahman/Downloads/sample_scannable.png"'
Replace sample_scannable.png
with your file path.
This project is licensed under the MIT License - see the LICENSE file for details.