QQOcr
A package used for simple OCR.
-
Contact the author: jugking6688@gmail.com
-
Our bilibili: https://space.bilibili.com/3493127383943735
Examples are as follows:
For learn:
from qqocr import QQOcr
# You must provide a method to binarize the characters in the picture
# and import the external library in the function.
def binary(image):
import numpy as np
import cv2
low_range = np.array([0, 0, 0][::-1])
high_range = np.array([100, 100, 100][::-1])
return cv2.inRange(image, low_range, high_range)
qq = QQOcr()
# Dataset folder consists of many pictures and a 'label.txt'.
# For 'label.txt', the format of each line is "[filename]\t[text]".
# For example, it can be: "1.png 12345".
qq.load_dataset('./dataset')
qq.set_binary(binary)
qq.learn()
# The suffix must be '.qmodel'.
qq.save_model('./1.qmodel')
For predict:
from qqocr import QQOcr
import cv2
qq = QQOcr()
qq.load_model('./1.qmodel')
text = qq.predict(cv2.imread('test.png'))
print(text)
Release files for qqocr 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qqocr-0.3.2.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qqocr-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 kB
Release files / qqocr-0.3.2.tar.gz
| Download URL | qqocr-0.3.2.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da3a613e43d310e553bb655da785dada7e444a4428a0bd0b72a200eb61624314
|
|
BLAKE2b-256 checksum How to use checksums |
9bea442856d4db65dedd64c76e6e0b2777f31ab6046aae1560bf5ebd8326da0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.8
|
Release files / qqocr-0.3.2-py3-none-any.whl
| Download URL | qqocr-0.3.2-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a16868fee7654bfb436f492cbb83a6decbd582e944ca6e2b95c4d5d419d99dab
|
|
BLAKE2b-256 checksum How to use checksums |
b29b2aaf5ca59b8187af7d21162c6407e044cc207e74502ee93911806c0d0302
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.8
|