Skip to main content

Arcaea Offline OCR

Example

import cv2
from arcaea_offline_ocr.device.ocr import DeviceOcr
from arcaea_offline_ocr.device.rois.definition import DeviceRoisAutoT2
from arcaea_offline_ocr.device.rois.extractor import DeviceRoisExtractor
from arcaea_offline_ocr.device.rois.masker import DeviceRoisMaskerAutoT2
from arcaea_offline_ocr.phash_db import ImagePhashDatabase

img_path = "/path/to/opencv/supported/image/formats.jpg"
img = cv2.imread(img_path, cv2.IMREAD_COLOR)

rois = DeviceRoisAutoT2(img.shape[1], img.shape[0])
extractor = DeviceRoisExtractor(img, rois)
masker = DeviceRoisMaskerAutoT2()

knn_model = cv2.ml.KNearest.load("/path/to/trained/knn/model.dat")
phash_db = ImagePhashDatabase("/path/to/image/phash/database.db")

ocr = DeviceOcr(extractor, masker, knn_model, phash_db)
print(ocr.ocr())
$ python example.py
DeviceOcrResult(rating_class=2, pure=1135, far=11, lost=0, score=9953016, max_recall=1146, song_id='ringedgenesis', song_id_possibility=0.953125, clear_status=2, partner_id='45', partner_id_possibility=0.8046875)

License

This file is part of arcaea-offline-ocr, as called "This program" below.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Credits

283375/image-phash-database

Metadata

Release files for arcaea-offline-ocr 0.0.99

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arcaea-offline-ocr 0.0.99
File Size Uploaded
arcaea_offline_ocr-0.0.99.tar.gz 27.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arcaea-offline-ocr 0.0.99
File Interpreter ABI Platform
arcaea_offline_ocr-0.0.99-py3-none-any.whl Python 3 none any Details

Total release size: 59.7 kB

Release files / arcaea_offline_ocr-0.0.99.tar.gz

Download URL arcaea_offline_ocr-0.0.99.tar.gz
Size 27.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9a3ab918de8e275e5190f27c7b4d5e6516ad355e3ebca79735ebd8ae95559126
BLAKE2b-256 checksum
How to use checksums
907ce5f89ee4a1e2221e5fa1d6b769d41c388d2470f3a29a628d30e7a65082da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.8

Release files / arcaea_offline_ocr-0.0.99-py3-none-any.whl

Download URL arcaea_offline_ocr-0.0.99-py3-none-any.whl
Size 32.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f875da1a7e3f183fef3cfe3885635c40f3b4a9e3f9292dcffcdc008cad849fe3
BLAKE2b-256 checksum
How to use checksums
0f490f11fb00e7a75208fbfac799a5a77a4ace0ae2a8e5ffef791ca70ab6f262
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.8
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page