Primary Math Screen Handwriting OCR (pmsh-ocr) is a Python package for recognizing primary mathematical expressions handwritten on screen.
Project description
pmsh-ocr
Primary Math Screen Handwriting OCR (pmsh-ocr) is a Python package for recognizing primary school mathematical expressions handwritten on screen.
Features
- Recognize primary mathematical expressions handwritten on screen
- Vocabulary:
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '-', '<', '=', '>', '\frac', '{', '}'] - Support recognizing expression with input reference text, e.g. answer
- Model trained with max token length 40
Installation
pip install pmsh-ocr
Usage
import cv2
from pmsh import PMSHOCR
ocr = PMSHOCR()
image = cv2.imread('path_to_image')
ref_text = 'some reference txt'
result = ocr.inference(image, ref_text)
print(result)
example of result:
{
"box": [0, 0, 384, 288], # [x1, y1, x2, y2]
"ctc_text": "-15", # text not referring the input ref_text
"ctc_prob": 0.999,
# if the input ref_text is None, the following keys will not output
"ar_text": "-15", # text referring the input ref_text
"ar_prob": 0.92
}
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pmsh_ocr-0.0.1.tar.gz.
File metadata
- Download URL: pmsh_ocr-0.0.1.tar.gz
- Upload date:
- Size: 21.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c61537deea73bd095cbb73b455ca401f1397ca3317975a8ed79b74effd83a2a7
|
|
| MD5 |
1134a7f00e73e2074eb54f83b44ada1e
|
|
| BLAKE2b-256 |
1ba66fb304dfb4337f0320078dc4d470a2d691a8963daf6599e6e7c9720bfb16
|
File details
Details for the file pmsh_ocr-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pmsh_ocr-0.0.1-py3-none-any.whl
- Upload date:
- Size: 21.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cd30e9be86115f58175e593f6c743164f42e12a900a2d26e70e0c91ddd405ad
|
|
| MD5 |
8165ce8acebad41191ecbc1c19979603
|
|
| BLAKE2b-256 |
9f8d6f03df09b8ece7df143273592371a143602884db718891648d3b9e83bd69
|