EAST-based OCR detector API
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.4.tar.gz
(46.6 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.4.tar.gz.
File metadata
- Download URL: manuscript_ocr-0.1.4.tar.gz
- Upload date:
- Size: 46.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffd1cb79f8ae434a4d22139d4c953943dcb9b85c005f36dccc232bfb41758d9f
|
|
| MD5 |
63f83196c9d64b266b9abbe75b2ad15a
|
|
| BLAKE2b-256 |
97767a78b143e42d06832dfe5a0e6d57b18fcc8fe2f416d61aa9d310b7e902ea
|
File details
Details for the file manuscript_ocr-0.1.4-py3-none-any.whl.
File metadata
- Download URL: manuscript_ocr-0.1.4-py3-none-any.whl
- Upload date:
- Size: 47.5 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 |
b76c88eb5e31fb8392fb194bb67a14dce7aa21522cc7c42a4c0b4f1b8fdfabec
|
|
| MD5 |
9b69555ab6685d42e9762049d625ec00
|
|
| BLAKE2b-256 |
734c30bedc7773f6fc1d4213e58c4f2604b45def69e49a35a271574d75b8e01d
|