manuscript-ocr
Project description
Installation
pip install manuscript-ocr
Usage Example
from PIL import Image
from manuscript.detectors import EASTInfer
# Инициализация
det = EASTInfer(score_thresh=0.9)
# Инфер с визуализацией
page, vis_image = det.infer(r"example\ocr_example_image.jpg", vis=True)
print(page)
# Покажет картинку с наложенными боксами
Image.fromarray(vis_image).show()
# Или сохранить результат на диск:
Image.fromarray(vis_image).save(r"example\ocr_example_image_infer.png")
Результат
Текстовые блоки будут выведены в консоль, например:
Page(blocks=[Block(words=[Word(polygon=[(874.1005, 909.1005), (966.8995, 909.1005), (966.8995, 956.8995), (874.1005, 956.8995)]),
Word(polygon=[(849.1234, 810.5678), … ])])])
А визуализация сохранится в файл example/ocr_example_image_infer.png:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
manuscript_ocr-0.1.1.tar.gz
(44.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file manuscript_ocr-0.1.1.tar.gz.
File metadata
- Download URL: manuscript_ocr-0.1.1.tar.gz
- Upload date:
- Size: 44.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3400f3983d08027d86cefacedb2839a3bdc1a4bcaa381c8f9f7543ff4b1c5a6
|
|
| MD5 |
2fd78425c66bf9137741be519a2687ab
|
|
| BLAKE2b-256 |
a270d35ae1bf77ce7e453f78cd6ed033b903fe57020aa388612a9645280c9596
|
File details
Details for the file manuscript_ocr-0.1.1-py3-none-any.whl.
File metadata
- Download URL: manuscript_ocr-0.1.1-py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88fa6d05fbe8ce4058a1183b67b3dcff56d66ba1b04bc2b137ff36215b1d1e5e
|
|
| MD5 |
20c091d996f1a1220c5ebddfd1665d41
|
|
| BLAKE2b-256 |
c4fd1783a63b7cac2d5409d53461c7ae172c87df9c4429c033d203ded8beda67
|