36 lines
501 B
Markdown
36 lines
501 B
Markdown
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
|
|
|
|
```python
|
|
from manga_ocr import MangaOcr
|
|
|
|
mocr = MangaOcr()
|
|
text = mocr('/path/to/img')
|
|
```
|
|
|
|
or
|
|
|
|
```python
|
|
import PIL.Image
|
|
|
|
from manga_ocr import MangaOcr
|
|
|
|
mocr = MangaOcr()
|
|
img = PIL.Image.open('/path/to/img')
|
|
text = mocr(img)
|
|
```
|