Command line client for several Japanese OCR providers derived from Manga OCR.
This has been tested with Python 3.11 and 3.12. Newer/older versions might work. It can be installed with pip install owocr
Basic usage is comparable to Manga OCR as in, owocr
keeps scanning for images and performing text recognition on them. Similarly, by default it will read images from the clipboard and write text back to the clipboard (or optionally, read images from a folder and/or write text to a .txt file if you specify -r=<folder path>
or -w=<txt file path>
).
Additionally:
-r=websocket
and/or -w=websocket
parameters (the port is 7331 by default, and is configurable in the config file)/tmp/owocr.sock
) on macOS and Linux with -r=unixsocket
-r=screencapture
. By default it will read from the entire main screen every 3 seconds, but you can change it to screenshot a different screen or a portion of a screen (with a set of screen coordinates x,y,width,height
) or just a specific window (with the window title). You can also change the delay between screenshots or specify a keyboard combo if you don't want screenshots to be taken periodically. Refer to the config file or to owocr --help
for more details about the screen capture settings-p
option or with a specific provider with the -e
option (refer to owocr -h
for the list)owocr -h
)-a=seconds
option if you're not using screen capture. 0 (the default) disables it.-n
to show the text with a native OS notification. Important for macOS users: if you use Python from brew, you need to enter this command in your terminal before the first notification: codesign -f -s - $(brew --cellar python)/3.*/Frameworks/Python.framework
(works on Ventura/Sonoma). Older macOS versions might require Python to be installed from the official website. Nothing can be done about this unfortunately.pip install fpng-py
(requires setting up a developer environment on most operating systems/Python versions)pip install transformers sentencepiece
user directory/.config/owocr_config.ini
, on Windows user directory
is the C:\Users\yourusername
folder) can be used to configure the script, as an example to limit providers (to reduce clutter/memory usage) as well as specifying provider settings such as api keys etc. A sample config file is also provided here*ocr_ignore*
is copied with an image, the image will be ignored (mostly useful for devs making their own sender tool)pip install winocr
) is installed. It can also be used by installing winocr on a Windows virtual machine and running the server there (winocr_serve
), and installing requests (pip install requests
) and specifying the IP address of the Windows VM/machine in the config file ("w" key)pip install pyjson5 requests
) ("l" key)user directory/.config/
and installing google-cloud-vision (pip install google-cloud-vision
) ("g" key)pip install azure-ai-vision-imageanalysis
) ("v" key)This uses code from/references these projects: