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.2.tar.gz (17.1 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.2-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file manuscript_ocr-0.1.2.tar.gz.

File metadata

  • Download URL: manuscript_ocr-0.1.2.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for manuscript_ocr-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f000b7440228a529f28e4aa454d3e0ce430398a2f481a6e67d60029f4c63b017
MD5 e5fca98b4a86b7357dda7b52997eab01
BLAKE2b-256 d2ebd8402fb78204da2f76a2af2fbb36e596175f3a350a092b19e3191cc3f0b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: manuscript_ocr-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for manuscript_ocr-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d03f090ff7b273f971b91376dbcbed53b67c4f9e9d6bd02bd7c59794594b20bf
MD5 d268094d145a365f12634faa6c9b8aa8
BLAKE2b-256 71dbc22ea9910a6c5a6de1b89704a3571c5976f4f4eb75aaefef934ee48642a5

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