Skip to main content

Japanese OCR

Project description

OwOCR

Command line client for several Japanese OCR providers derived from Manga OCR.

Installation

This has been tested with Python 3.11. Newer/older versions might work. It can be installed with pip install owocr

Supported providers

Local providers

  • Manga OCR: refer to the readme for installation ("m" key)
  • EasyOCR: refer to the readme for installation ("e" key)
  • PaddleOCR: refer to the wiki for installation ("o" key)
  • Apple Vision framework: this will work on macOS Ventura or later if pyobjc (pip install pyobjc) is installed. In my experience, the best of the local providers for horizontal text ("a" key)
  • WinRT OCR: this will work on Windows 10 or later if winocr (pip install winocr) is installed. It can also be used by installing winocr on a Windows virtual machine and running the server (winocr_serve), installing requests (pip install requests) and specifying the IP address of the Windows VM/machine in the config file (see below) ("w" key)

Cloud providers

  • Google Lens: Google Vision in disguise (no need for API keys!), however it needs to download a couple megabytes of data for each request. You need to install pyjson5 and requests (pip install pyjson5 requests) ("l" key)
  • Google Vision: you need a service account .json file named google_vision.json in user directory/.config/ and installing google-cloud-vision (pip install google-cloud-vision) ("g" key)
  • Azure Computer Vision: you need to specify an api key and an endpoint in the config file (see below) and to install azure-cognitiveservices-vision-computervision (pip install azure-cognitiveservices-vision-computervision) ("v" key)

Usage

It mostly functions like Manga OCR: https://github.com/kha-white/manga-ocr?tab=readme-ov-file#running-in-the-background However:

  • it supports reading images and/or writing text to a websocket when the -r=websocket and/or -w=websocket parameters are specified (port 7331 by default, configurable in the config file)
  • you can pause/unpause the image processing by pressing "p" or terminate the script with "t" or "q"
  • you can switch OCR provider with its corresponding keyboard key (refer to the list above). You can also start the script paused with the -p option or with a specific provider with the -e option (refer to owocr -h for the list)
  • holding ctrl or cmd at any time will pause image processing temporarily
  • for systems where text can be copied to the clipboard at the same time as images, if *ocr_ignore* is copied with an image, the image will be ignored
  • optionally, notifications can be enabled in the config file to show the text with a native OS notification
  • optionally, idle resource usage on macOS and Windows when reading from the clipboard can be eliminated by making owocr use native OS polling. This requires installing pyobjc on macOS (pip install pyobjc) and pywin32 on Windows (pip install pywin32)
  • a config file (to be created in user directory/.config/owocr_config.ini, on Windows user directory is the C:\Users\yourusername folder) can be used to limit providers (to reduce clutter/memory usage) as well as specifying provider settings such as api keys etc. A sample config file is provided here

Acknowledgments

This uses code from/references these projects:

Thanks to viola for working on the Google Lens implementation!

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

owocr-1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

owocr-1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file owocr-1.0.tar.gz.

File metadata

  • Download URL: owocr-1.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for owocr-1.0.tar.gz
Algorithm Hash digest
SHA256 713cc0e9c65630d77c4987d8c7cb7aabc8fa3cd272757884b80e23b77508af56
MD5 f5a81041130ec64dcc23b9ffc8590633
BLAKE2b-256 d0d496180b268cae374d8e32e49e05f0ec87caf4b5318f6af7745be8f0e0bcda

See more details on using hashes here.

File details

Details for the file owocr-1.0-py3-none-any.whl.

File metadata

  • Download URL: owocr-1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for owocr-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48acb8fd7e3ea71d876a7e0d5ff259b66ad4d954f65370d7bcc2291546bb0105
MD5 bc0261d7b297ad190ec703650ea0d6c3
BLAKE2b-256 5f5a2cd63ce0fd73062545dc088d0dc7f362ec6a8e4b42aef9547e15835a7921

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page