This commit is contained in:
Maciej Budyś
2022-01-18 00:44:46 +01:00
parent 17dd2f665e
commit 3a88953989
9 changed files with 65 additions and 3 deletions

1
MANIFEST.in Normal file
View File

@@ -0,0 +1 @@
include manga_ocr/assets/*.jpg

View File

@@ -1,3 +1,18 @@
OCR for Japanese manga
# Installation
You need Python 3.6+.
If you want to run with GPU, install PyTorch as described [here](https://pytorch.org/get-started/locally/#start-locally),
otherwise this step can be skipped.
Run:
```
pip install manga-ocr
```
# Usage # Usage
```python ```python

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -1 +1,3 @@
__version__ = '0.1.1'
from manga_ocr.ocr import MangaOcr from manga_ocr.ocr import MangaOcr

View File

@@ -92,5 +92,9 @@ def run(
time.sleep(delay_secs) time.sleep(delay_secs)
if __name__ == '__main__': def main():
fire.Fire(run) fire.Fire(run)
if __name__ == '__main__':
main()

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -21,7 +21,7 @@ class MangaOcr:
else: else:
logger.info('Using CPU') logger.info('Using CPU')
self(Path(__file__).parent.parent / 'assets/crop.png') self(Path(__file__).parent / 'assets/example.jpg')
logger.info('OCR ready') logger.info('OCR ready')

View File

@@ -1,8 +1,10 @@
fire fire
fugashi
jaconv jaconv
loguru loguru
numpy numpy
Pillow Pillow
pyperclip pyperclip
torch torch>=1.0
transformers>=4.12.5 transformers>=4.12.5
unidic_lite

38
setup.py Normal file
View File

@@ -0,0 +1,38 @@
from pathlib import Path
from setuptools import setup
long_description = (Path(__file__).parent / "README.md").read_text().split('# Installation')[0]
setup(
name="manga-ocr",
version='0.1.1',
description="OCR for Japanese manga",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/kha-white/manga_ocr",
author="Maciej Budyś",
author_email="kha-white@mail.com",
license="Apache License 2.0",
classifiers=[
"Programming Language :: Python :: 3",
],
packages=['manga_ocr'],
include_package_data=True,
install_requires=[
"fire",
"fugashi",
"jaconv",
"loguru",
"numpy",
"Pillow",
"pyperclip",
"torch>=1.0",
"transformers>=4.12.5",
"unidic_lite",
],
entry_points={
"console_scripts": [
"manga_ocr=manga_ocr.__main__:main",
]
},
)