Skip to main content

This package is compatible with akaOCR & PaddleOCR for ocr pipeline program (Text Detection & Text Recognition), using ONNX format model (CPU speed can be x2 times faster)

Project description

akaOCR

License Python 3.7 ONNX Compatible

Description

This package is compatible with akaOCR for ocr pipeline program (Text Detection & Text Recognition), using ONNX format model (CPU speed can be x2 times faster). This code is referenced from this awesome repo.

Installation

You can install the package using pip:

pip install akaocr

Usage

Step 1: Use in your code: Text Detection.

from akaocr import BoxEngine
import cv2

img_path = "path/to/image.jpg"
image = cv2.imread(img_path)

# side_len: minimum inference image size
box_engine = BoxEngine(model_path: Any | None = None,
                        side_len: int = 736,
                        conf_thres: float = 0.5)

# inference for one image
bboxs = box_engine(image) # [[4 points],...]

Step 2: Use in your code: Text Recognition.

from akaocr import TextEngine
import cv2

img_path = "path/to/cropped_image.jpg"
cropped_image = cv2.imread(img_path)

text_engine = TextEngine(model_path: Any | None = None,
                        vocab_path: Any | None = None,
                        use_space_char: bool = True)

# inference for one or more images
texts = text_engine(cropped_image) # [(text, conf),...]

License

This project is licensed under the Apache License 2.0

"I hope this package will be useful for your projects". Nguyễn Trường Lâu (from akaOCR Team).

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

akaocr-2.0.1.tar.gz (10.4 MB view hashes)

Uploaded Source

Built Distribution

akaocr-2.0.1-py3-none-any.whl (10.4 MB 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