Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Optical character recognition for Japanese text, with the main focus being Japanese manga. It uses a custom end-to-end model built with Transformers' Vision Encoder Decoder framework.
Manga OCR can be used as a general purpose printed Japanese OCR, but its main goal was to provide a high quality text recognition, robust against various scenarios specific to manga:
Unlike many OCR models, Manga OCR supports recognizing multi-line text in a single forward pass, so that text bubbles found in manga can be processed at once, without splitting them into lines.
See also:
You need Python 3.6 or newer. Please note, that the newest Python release might not be supported due to a PyTorch dependency, which often breaks with new Python releases and needs some time to catch up. Refer to PyTorch website for a list of supported Python versions.
Some users have reported problems with Python installed from Microsoft Store. If you see an error:
ImportError: DLL load failed while importing fugashi: The specified module could not be found.
,
try installing Python from the official site.
If you want to run with GPU, install PyTorch as described here, otherwise this step can be skipped.
ImportError: DLL load failed while importing fugashi: The specified module could not be found.
- might be because of Python installed from Microsoft Store, try installing Python from the official sitemecab-python3
on ARM architecture - try this workaroundfrom manga_ocr import MangaOcr
mocr = MangaOcr()
text = mocr('/path/to/img')
or
import PIL.Image
from manga_ocr import MangaOcr
mocr = MangaOcr()
img = PIL.Image.open('/path/to/img')
text = mocr(img)
Manga OCR can run in the background and process new images as they appear.
You might use a tool like ShareX or Flameshot to manually capture a region of the screen and let the OCR read it either from the system clipboard, or a specified directory. By default, Manga OCR will write recognized text to clipboard, from which it can be read by a dictionary like Yomichan.
Clipboard mode on Linux requires wl-copy
for Wayland sessions or xclip
for X11 sessions. You can find out which one your system needs by running echo $XDG_SESSION_TYPE
in the terminal.
Your full setup for reading manga in Japanese with a dictionary might look like this:
capture region with ShareX -> write image to clipboard -> Manga OCR -> write text to clipboard -> Yomichan
manga_ocr
manga_ocr "/path/to/sharex/screenshot/folder"
Note that when running in the clipboard scanning mode, any image that you copy to clipboard will be processed by OCR and replaced by recognized text. If you want to be able to copy and paste images as usual, you should use the folder scanning mode instead and define a separate task in ShareX just for OCR, which saves screenshots to some folder without copying them to clipboard.
When running for the first time, downloading the model (~400 MB) might take a few minutes.
The OCR is ready to use after OCR ready
message appears in the logs.
manga_ocr --help
If manga_ocr
doesn't work, you might also try replacing it with python -m manga_ocr
.
Here are some cherry-picked examples showing the capability of the model.
image | Manga OCR result |
---|---|
素直にあやまるしか | |
立川で見た〝穴〟の下の巨大な眼は: | |
実戦剣術も一流です | |
第30話重苦しい闇の奥で静かに呼吸づきながら | |
よかったじゃないわよ!何逃げてるのよ!!早くあいつを退治してよ! | |
ぎゃっ | |
ピンポーーン | |
LINK!私達7人の力でガノンの塔の結界をやぶります | |
ファイアパンチ | |
少し黙っている | |
わかるかな〜? | |
警察にも先生にも町中の人達に!! |
For any inquiries, please feel free to contact me at kha-white@mail.com
This project was done with the usage of:
FAQs
OCR for Japanese manga
We found that manga-ocr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.