Skip to content

Commit

Permalink
first
Browse files Browse the repository at this point in the history
  • Loading branch information
geo-tp committed Jun 1, 2023
0 parents commit 03110c8
Show file tree
Hide file tree
Showing 12 changed files with 1,649 additions and 0 deletions.
17 changes: 17 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
WoW Screenshot OCR
==============

Deep learning OCR models to read text from WoW screenshots. Based on a detector that spots text frames from screenshots, and a recognizer that reads text from detected frames.

- Chat
- Combat log
- Nameplates
- UI frames
- Map

Usage
----

Models will use pre trained weights, you don't have to train anything

```
import wow_ocr
# Init pipeline, detector and recognizer models with pre trained weights
pipeline = wow_ocr.pipeline.Pipeline()
# Screenshots example
images = [
wow_ocr.tools.read(url)
for url in [
"https://image_url.com/1.jpg",
"https://image_url.com/2.jpg",
]
]
# Results - Image to Text
prediction_groups = pipeline.recognize(images)
# # Each list of predictions in prediction_groups is a list of
# # (word, box) tuples.
```

![](p1.webp)
![](p2.webp)

Binary file added p1.webp
Binary file not shown.
Binary file added p2.webp
Binary file not shown.
36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "wow-ocr"
version = "0.0.0"
description = "A packaged OCR model to read texts into WoW screenshots"
readme = "README.md"
authors = [{ name = "Geo", email = "[email protected]" }]
license = { file = "LICENSE" }
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
keywords = ["ocr", "wow", "screenshot"]
dependencies = [
"validators",
"essential_generators",
"tqdm",
"imgaug",
"fonttools",
"editdistance",
"pyclipper",
"shapely",
"efficientnet",
"tensorflow",
]
requires-python = ">=3.9"

[project.optional-dependencies]
dev = ["black", "pip-tools", "pytest", "types-requests", "types-pkg-resources"]

[project.urls]
Homepage = "https://github.com/geo-tp/wow-ocr"
9 changes: 9 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# Config for projects that do not yet support pyproject.toml (PEP-518)
# https://www.python.org/dev/peps/pep-0518/

# mypy: https://github.com/python/mypy/issues/5205
[mypy]
ignore_missing_imports = True
check_untyped_defs = True
ha
3 changes: 3 additions & 0 deletions wow_ocr/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import detector, recognizer, tools, pipeline

__version__ = "0.0.0"
Loading

0 comments on commit 03110c8

Please sign in to comment.