OCR snipping tool for reading manga.
Project description
OCR application for reading manga in Japanese, made for AJATTers🇯🇵
Lancet
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.
https://github.com/user-attachments/assets/8859adac-1bd8-435a-9c81-945f875dc205
User Guide
Prerequisites:
- Goldendict for looking up words in Japanese dictionaries.
- nsxiv for reading manga.
- Recommended: i3wm, dwm, or any X11-based WM or DE (i.e. not Wayland).
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.
Installation
All operating systems
pipx install ajt-lancet
The lancet executable will be available in your $PATH.
[!NOTE] On Windows-like systems, you may need to add the folder containing the
lancetexecutable to your$PATHmanually.
[!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
Windows-like operating systems
Download Lancet.exe.
System Requirements
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
Wayland support
Wayland support has been tested on Sway 1.11. Wayland support is incomplete. It works best on Hyprland and Sway, but on other compositors you may face issues if you have multiple monitors. 🙏 Please suggest improvements via pull requests on GitHub.
Upgrading
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
Development Setup
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:
Autostart
Add the lancet command to your autostart so Lancet launches at login.
Here's an example for i3wm:
exec --no-startup-id lancet
Announcements
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ajt_lancet-26.4.21.0.tar.gz.
File metadata
- Download URL: ajt_lancet-26.4.21.0.tar.gz
- Upload date:
- Size: 634.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e428f188530c47aaf3bcd974b22ba4a23084beb80dbfb1e041c99668874db9c8
|
|
| MD5 |
9017427071948f88d59c270e3b202bd4
|
|
| BLAKE2b-256 |
1a766b8369350350d15637dbdda7d7103756bee9b748eb5cd56bc3dea32bef27
|
Provenance
The following attestation bundles were made for ajt_lancet-26.4.21.0.tar.gz:
Publisher:
release.yml on Ajatt-Tools/lancet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ajt_lancet-26.4.21.0.tar.gz -
Subject digest:
e428f188530c47aaf3bcd974b22ba4a23084beb80dbfb1e041c99668874db9c8 - Sigstore transparency entry: 1346220919
- Sigstore integration time:
-
Permalink:
Ajatt-Tools/lancet@3713482add35a7e98abbc7366c12b688ce77fd45 -
Branch / Tag:
refs/tags/v26.4.21.0 - Owner: https://github.com/Ajatt-Tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3713482add35a7e98abbc7366c12b688ce77fd45 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ajt_lancet-26.4.21.0-py3-none-any.whl.
File metadata
- Download URL: ajt_lancet-26.4.21.0-py3-none-any.whl
- Upload date:
- Size: 638.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d194117fbdc07b4a46da242dd3ec96a7fa419c2230817394e8d193a61f810ce
|
|
| MD5 |
9e7ea506aa894b175a1dd762d9c48d30
|
|
| BLAKE2b-256 |
42da2233213e5ba4c2fca5ffa8051ecfc0f52b777ad850bdf8e3368c1d71642c
|
Provenance
The following attestation bundles were made for ajt_lancet-26.4.21.0-py3-none-any.whl:
Publisher:
release.yml on Ajatt-Tools/lancet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ajt_lancet-26.4.21.0-py3-none-any.whl -
Subject digest:
4d194117fbdc07b4a46da242dd3ec96a7fa419c2230817394e8d193a61f810ce - Sigstore transparency entry: 1346221021
- Sigstore integration time:
-
Permalink:
Ajatt-Tools/lancet@3713482add35a7e98abbc7366c12b688ce77fd45 -
Branch / Tag:
refs/tags/v26.4.21.0 - Owner: https://github.com/Ajatt-Tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3713482add35a7e98abbc7366c12b688ce77fd45 -
Trigger Event:
push
-
Statement type: