OCR application for reading manga in Japanese, made for AJATTers🇯🇵
Lancet is an OCR application for reading manga in Japanese. It uses PyTorch models to recognize Japanese text in images. Lancet works best with Goldendict-ng or Rikaitan.
output.mp4
Prerequisites:
- Goldendict for looking up words in Japanese dictionaries.
- nsxiv for reading manga.
Launch Goldendict, then open a manga folder in nsxiv.
Start Lancet and wait for the OCR model to load.
Press the OCR shortcut (default Alt+O) to show the snipping window,
then drag and hold the mouse to perform OCR.
Lancet adds an icon to the system tray. Right‑click the icon to access actions, including Preferences, where you can change the OCR shortcut.
pipx install ajt-lancetThe lancet executable will be available in your $PATH.
Note
On Windows-like systems,
you may need to add the folder containing the lancet executable to your $PATH manually.
Note
If you don't have the required python version, install it first with hatch.
hatch python install 3.13
pipx install ajt-lancet --python ~/.local/share/hatch/pythons/3.13/python/bin/python
Lancet depends on large Python libraries.
pipx installs everything in an isolated location (~/.local/share/pipx)
so you can cleanly uninstall with pipx uninstall later.
The PyTorch models are downloaded from HuggingFace and saved to ~/.cache/huggingface.
- Disk space: ~8 GiB (PyTorch and dependencies)
- RAM: at least 2 GiB
Running pipx upgrade upgrades lancet to the latest version.
pipx upgrade ajt-lancet
Running pipx upgrade-all
upgrades all packages installed with pipx.
pipx upgrade-all
Since Ajatt-Tools is a distributed effort, we highly welcome new contributors!
Install the project in development mode to easily test and commit your changes using hatch.
-
Clone the repo.
-
Install hatch:
pipx install hatch pipx upgrade hatch -
CD into the repo and run:
hatch shell -
Inside the hatch shell run:
pip install -e . -
To run the app, run:
hatch run lancet
Try these libre code editors with python support:
Add the lancet command to your autostart so Lancet launches at login.
Here's an example for i3wm:
exec --no-startup-id lancet