Skip to main content

ComicsOCR is a Python package created for easily distributing OCR models trained for golden age of comics.

Project description

to build locally after cloning

pip install comics-ocr[cuda] -f https://download.pytorch.org/whl/torch_stable.html

or 

pip install comics-ocr[cpu]

You can get the necessary model checkpoints and configs from COMICS TEXT+ repository.

Usage

# Import library
from comics_ocr import ComicsOCR

# initalize the model
e2e_ocr_model = ComicsOCR(
    ocr_detector_config="fcenet_r50dcnv2_fpn_1500e_ctw1500_custom/fcenet_r50dcnv2_fpn_1500e_ctw1500_custom.py",
    ocr_detector_checkpoint='fcenet_r50dcnv2_fpn_1500e_ctw1500_custom/best_0_hmean-iou:hmean_epoch_5.pth',
    recog_config='master_custom_dataset.py',
    ocr_recognition_checkpoint='best_0_1-N.E.D_epoch_4.pth',
    det='FCE_CTW_DCNv2',
    recog='MASTER')

# Run the model
img_path = "speech_bubble/0/3/9.jpg"
text, preprocessed_text, sanitized_text = e2e_ocr_model.extract_text(img_path)

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

comics_ocr-0.1.2.tar.gz (204.2 kB view details)

Uploaded Source

Built Distribution

comics_ocr-0.1.2-py3-none-any.whl (931.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: comics_ocr-0.1.2.tar.gz
  • Upload date:
  • Size: 204.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for comics_ocr-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d99d301fb2e8d2c50caff2c0f24113bbff1110b8ad7d214a556c6357ca9fc6eb
MD5 94513c0ad86fba4c969e15c34f240552
BLAKE2b-256 844d45f6fa91a5bf69f7f6101a753d87935cf75b32502106ea4dedd89c27be1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: comics_ocr-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 931.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for comics_ocr-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cfd8c1a931265a4b69199de7f25b803608ee015f1259656a1c09331626c1987a
MD5 9cbdbf6106e8b0dab2a01067d94d815b
BLAKE2b-256 feb4e1ef2299e295941d903a1cfbd3fb0a5f6a40d96daed22d8cec0f51af2ac6

See more details on using hashes here.

Supported by

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