Giter VIP home page Giter VIP logo

arcaea-offline-ocr's Introduction

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

arcaea-offline-ocr's People

Contributors

283375 avatar lzhyrifx avatar

Stargazers

Vladislav Kashirin avatar NeNoOD avatar  avatar  avatar

Watchers

 avatar

Forkers

lzhyrifx

arcaea-offline-ocr's Issues

机器人 B30 图片识别

考虑到杠a比30还没完全爆金币,可以实现识别杠a比30生成的图片快速获取 B30 的功能。
544349f5b56042c0

High failure rate on 5.x screenshots, DeviceOcr errors on Far count

Might be an issue with the OCR model you've provided to me by Email, but after some thorough testing I've found out OCR fails on most 5.0+ screenshots while processing Far count. Though, in some (rarer) cases, it does go through, but it is guaranteed to be with incorrect Far count in the score details (mostly x2 saved as 2, but a few times it is being set to 0).
Can provide 300+ screenshots either by Email or DMs, if required

Relevant log:
arcaea-offline-pyside-ui-20240605-152627_debug.log

cv2.Mat typing

cv2.Mat 不是 opencv-python 自带的类型注解,会导致 nuitka 打包错误。

本质是 Mat = np.ndarray[int, np.dtype[np.generic]],需要更改。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.