This is fork of the mokuro repo. All my changes are on the fork
branch.
Assuming your have both pip and git, you can install this project with the following command:
pip install git+https://github.com/bbonenfant/mokuro
- Moved comic_text_detector into mokuro package
- (will probably clean up further)
- Added support for AVIF images.
- Now outputs .mbz.zip files which bundles images and ocr output into a single file.
- These should seemlessly work as .cbz files as well.
- Add some manual character substitutions in the OCR code.
Read Japanese manga with selectable text inside a browser.
See demo: https://kha-white.github.io/manga-demo
mokuro_demo.mp4
Demo contains excerpt from Manga109-s dataset. うちの猫’ず日記 © がぁさん
mokuro is aimed towards Japanese learners, who want to read manga in Japanese with a pop-up dictionary like Yomichan. It works like this:
- Perform text detection and OCR for each page.
- After processing a whole volume, generate a HTML file, which you can open in a browser.
- All processing is done offline (before reading). You can transfer the resulting HTML file together with manga images to another device (e.g. your mobile phone) and read there.
mokuro uses comic-text-detector for text detection and manga-ocr for OCR.
Try running on your manga in Colab:
See also:
- Mokuro2Pdf, cli Ruby script to generate pdf files with selectable text from Mokuro's html overlay
- Xelieu's guide, a comprehensive guide on setting up a reading and mining workflow with manga-ocr/mokuro (and many other useful tips)
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.
Run in command line:
pip3 install mokuro
mokuro /path/to/manga/vol1
This will generate /path/to/manga/vol1.html
file, which you can open in a browser.
If your path contains spaces, enclose it in double quotes, like this:
mokuro "/path/to/manga/volume 1"
mokuro /path/to/manga/vol1 /path/to/manga/vol2 /path/to/manga/vol3
For each volume, a separate HTML file will be generated.
If your directory structure looks somewhat like this:
manga_title/
├─vol1/
├─vol2/
├─vol3/
└─vol4/
You can process all volumes by running:
mokuro --parent_dir manga_title/
--force_cpu - disable GPU
--as_one_file - generate separate css and js files instead of embedding everything in html
--disable_confirmation - run without asking for confirmation
For any inquiries, please feel free to contact me at [email protected]