Document bring-your-own-OCR support (0.7.0)
Browse files
README.md
CHANGED
|
@@ -29,9 +29,9 @@ in your browser.
|
|
| 29 |
pip install eka-pii-redaction
|
| 30 |
```
|
| 31 |
|
| 32 |
-
System dependency: **Tesseract OCR** —
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
| 36 |
```bash
|
| 37 |
# Debian/Ubuntu
|
|
@@ -62,6 +62,11 @@ entities = redactor.detect("page.jpg") # list[PIIEntity] — the core call
|
|
| 62 |
for e in entities:
|
| 63 |
print(e.kind, e.category, e.bbox, e.text, e.score)
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
# One detection, three possible outputs:
|
| 66 |
redactor.redact("page.jpg", entities).save("redacted.png")
|
| 67 |
redactor.anonymize("page.jpg", entities).save("anonymized.png")
|
|
|
|
| 29 |
pip install eka-pii-redaction
|
| 30 |
```
|
| 31 |
|
| 32 |
+
System dependency: **Tesseract OCR** — used by the **image** modality's
|
| 33 |
+
built-in OCR step. Not needed for the text-only modality, nor if you bring
|
| 34 |
+
your own OCR (`detect(..., words=..., boxes=...)`).
|
| 35 |
|
| 36 |
```bash
|
| 37 |
# Debian/Ubuntu
|
|
|
|
| 62 |
for e in entities:
|
| 63 |
print(e.kind, e.category, e.bbox, e.text, e.score)
|
| 64 |
|
| 65 |
+
# Bring your own OCR (skips the built-in Tesseract step; your pixel-space
|
| 66 |
+
# word boxes pass through to the emitted entities):
|
| 67 |
+
entities = redactor.detect("page.jpg", words=["John", "Doe"],
|
| 68 |
+
boxes=[[100, 20, 140, 40], [145, 20, 180, 40]])
|
| 69 |
+
|
| 70 |
# One detection, three possible outputs:
|
| 71 |
redactor.redact("page.jpg", entities).save("redacted.png")
|
| 72 |
redactor.anonymize("page.jpg", entities).save("anonymized.png")
|