Skip to main content

Multiprocessing library for OCR with WinRT

Project description

Multiprocessing library for OCR with WinRT

pip install winrtocr

Tested against Windows 10 / Python 3.10 / Anaconda

The results are not as good as the ones from Tesseract or EasyOCR, but it is way faster.

from winrtocr import WinRTocr

from time import perf_counter

from a_cv_imwrite_imread_plus import open_image_in_cv







winrto = WinRTocr(cpus=5, language="en-US")

picslinks = [

    r"https://github.com/hansalemaos/screenshots/raw/main/pandsnesteddicthtml.png",

    r"https://github.com/hansalemaos/screenshots/raw/main/cv2_putTrueTypeText_000000.png",

    r"https://github.com/hansalemaos/screenshots/raw/main/cv2_putTrueTypeText_000008.png",

    r"https://github.com/hansalemaos/screenshots/raw/main/cv2_putTrueTypeText_000017.png",

]



picsunique = [open_image_in_cv(x, channels_in_output=4) for x in picslinks]

pics = []

for _ in range(100):

    pics.extend(picsunique)



start = perf_counter()

dfa = winrto.get_ocr_df(pics)

print(f"Multi: {perf_counter()-start}")



dfa2 = winrto.get_ocr_df_and_pics(pics)

Project details


Release history Release notifications | RSS feed

This version

0.10

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

winrtocr-0.10.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

winrtocr-0.10-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

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