Skip to main content

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:

OCR Inference Result

Project details


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.6.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

manuscript_ocr-0.1.6-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file manuscript-ocr-0.1.6.tar.gz.

File metadata

  • Download URL: manuscript-ocr-0.1.6.tar.gz
  • Upload date:
  • Size: 48.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.0

File hashes

Hashes for manuscript-ocr-0.1.6.tar.gz
Algorithm Hash digest
SHA256 110ee1df15038462b7057c3e12472a1221d85b65debb54edb5c8a55d393c1462
MD5 469c32dae609d553658d24773e53bddf
BLAKE2b-256 0cc3814a35170f738c17747a95bde75dceee6aab40daa78412efa6c780805d11

See more details on using hashes here.

File details

Details for the file manuscript_ocr-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: manuscript_ocr-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 49.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.0

File hashes

Hashes for manuscript_ocr-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3df7a77513605e14f449a251aac6258e46b0aa780a2dc0ffee263dee86c9bbfd
MD5 b785c938c84ce5a2459a5beae0731b6e
BLAKE2b-256 a04d579ea5509750ec77acf6da648ed53661bc34d7f9e5eb81e589295593d7bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page