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.5.tar.gz
(48.8 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.5.tar.gz.
File metadata
- Download URL: manuscript_ocr-0.1.5.tar.gz
- Upload date:
- Size: 48.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a477d97c2cd185b718c6bc68215bbbcb9f48daa2da30cbe4ef32d2e566be5dd
|
|
| MD5 |
223a214cd352c210e67b21a97da55855
|
|
| BLAKE2b-256 |
2eae6760804b112ab838b0e857fe21263025a07b64b2d36fe038fc8dd7e5a0d6
|
File details
Details for the file manuscript_ocr-0.1.5-py3-none-any.whl.
File metadata
- Download URL: manuscript_ocr-0.1.5-py3-none-any.whl
- Upload date:
- Size: 49.6 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 |
26504a346004d07fb9273218cc6db6db667e6b5515c1caf371cf8e443ba995b1
|
|
| MD5 |
b7f016db3df18a3ff01d5d073742c987
|
|
| BLAKE2b-256 |
6989f5f73c256d9c9698bb1a274aa128419fc5dd2a956f8cf8c721eab96b42fe
|