Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / ocr / AGENTS.md
| 1 | # AGENTS.md — library/ocr/ (':library:ocr') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/ocr/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | <!-- last-reviewed: 2026-10-16 --> |
| 6 | - Gradle: :library:ocr / dir: library/ocr/ |
| 7 | - Package roots present: (on-device OCR — one package) |
| 8 | - Entry files: OcrEngine.kt (no MainActivity/Route — library) |
| 9 | - Deps: :library:ml (both permission-free; the OCR pipeline runs on the ml runtime, #884) |
| 10 | - Metadata: metadata_data/library-ocr.md (absent — libraries have none by design) |
| 11 | - Rust: no / screenshotTest: no |
| 12 | |
| 13 | ## Overview |
| 14 | **Purpose:** On-device OCR engine over `:library:ml` runtimes. Used by translate (camera overlay) and any image-text extraction. |
| 15 | **How to use:** `OcrEngine` in, text + boxes out; post-processing via `:library:ml` `OcrPost`/`TextRecognizer`. |
| 16 | **Entry points:** `OcrEngine.kt`. |
| 17 | **Gotchas:** Model files are large — first-run gating via `:library:downloadservice`, never block the camera path on a missing model. |
| 18 | |
| 19 | ## Key files |
| 20 | - com/vayunmathur/library/ocr/OcrEngine.kt |
| 21 | |
| 22 | ## Verify (this module only) |
| 23 | ``` |
| 24 | ./gradlew :library:ocr:compileDevKotlin |
| 25 | ./gradlew :library:ocr:lint |
| 26 | ``` |