-
Notifications
You must be signed in to change notification settings - Fork 74
docs(plugin): add comprehensive README for wasmedge_ocr #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,287 @@ | ||||||
| # wasmedge_ocr Plugin | ||||||
|
||||||
|
|
||||||
| The `wasmedge_ocr` plugin provides Optical Character Recognition (OCR) capabilities to WasmEdge applications by integrating with the Tesseract OCR engine. It allows WebAssembly modules to extract text and layout information from images located on the host filesystem. | ||||||
|
||||||
|
|
||||||
| ## Overview | ||||||
|
|
||||||
| This plugin exposes host functions that enable Wasm modules to: | ||||||
| 1. Trigger OCR processing on a specified image file. | ||||||
| 2. Retrieve the results in TSV (Tab-Separated Values) format, which includes recognized text, confidence scores, and bounding box coordinates. | ||||||
|
|
||||||
| ### Quick Start | ||||||
|
|
||||||
| Get the plugin running immediately with these steps. | ||||||
|
|
||||||
| 1. **Install Dependencies** | ||||||
| - **Linux (Ubuntu/Debian)**: | ||||||
| ```bash | ||||||
| sudo apt-get install libtesseract-dev libleptonica-dev tesseract-ocr-eng | ||||||
| ``` | ||||||
| - **macOS**: | ||||||
| ```bash | ||||||
| brew install tesseract leptonica | ||||||
| ``` | ||||||
|
|
||||||
| 2. **Build Plugin** | ||||||
|
||||||
| ```bash | ||||||
| # From WasmEdge root | ||||||
| cmake -DWASMEDGE_PLUGIN_WASMEDGE_OCR:BOOL=TRUE -B ./build -G "Unix Makefiles" | ||||||
| cmake --build ./build | ||||||
| ``` | ||||||
|
|
||||||
| 3. **Set Plugin Path** | ||||||
| ```bash | ||||||
| export WASMEDGE_PLUGIN_PATH=$(pwd)/build/plugins/wasmedge_ocr/ | ||||||
| ``` | ||||||
|
|
||||||
| 4. **Run** | ||||||
| ```bash | ||||||
| wasmedge app.wasm | ||||||
| ``` | ||||||
|
|
||||||
| ### Intended Use Cases | ||||||
| - Extracting text from artifacts (scanned documents, photos). | ||||||
| - Getting bounding box coordinates for text in images (layout analysis). | ||||||
| - processing images where the file resides on the host system. | ||||||
|
||||||
| - processing images where the file resides on the host system. | |
| - Processing images where the file resides on the host system. |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent admonition syntax. This documentation uses Docusaurus, which has a different syntax for admonitions. The GitHub-style alert syntax (> [!WARNING]) should be changed to Docusaurus-style admonition syntax for consistency with other documentation files.
The correct format should be:
:::warning
**Security Notice**: This plug-in accesses files on the **Host Filesystem** using direct paths provided by the Wasm module. This explicitly **bypasses the WASI sandbox** isolation. Only use this plug-in with properly reviewed and trusted Wasm modules, as they can probe for files on your host system.
:::
References:
- docs/contribute/source/plugin/wasi_logging.md:10-13
- docs/contribute/source/plugin/process.md:26-28
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filename "README.md" is inconsistent with other plugin documentation files in this directory. All other plugin documentation files follow the pattern of using a descriptive name (e.g., "ebpf.md", "process.md", "rusttls.md", "wasi_logging.md"). This file should be renamed to "wasmedge_ocr.md" to follow the established convention in the codebase.
References: