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.0.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.0.tar.gz.
File metadata
- Download URL: manuscript_ocr-0.1.0.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 |
a35fa31fde7cfac284bbff7ae7fa612bedd1df39d80072147401ff30f7c628ba
|
|
| MD5 |
6b042d805746b8a0b0b47d2cd6245584
|
|
| BLAKE2b-256 |
67f2e7b8973fd6e8240917293565ec774de98e9364c1e509a1134e5129cfa197
|
File details
Details for the file manuscript_ocr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: manuscript_ocr-0.1.0-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 |
e7d20c4ccb81e963e54845035e28e16a45630439d2285c54684d68ef6fd2f6a9
|
|
| MD5 |
94814485d4ec8abac5d801f8f80acf7e
|
|
| BLAKE2b-256 |
514f648eb7ebbc8ee95acf70da66f73022e0f871f74d7817f40b44089ee69d31
|