Skip to content

Repository files navigation

OCR Translator

Convert captured images into text and then translate that text.

Downloadspython 3.9


With this app, you can select your preferred OCR and translation services. After clicking on START or using the keyboard shortcut Alt+Win+T, the program will launch and you can choose the area of the screen to scan for text using OCR. If you have selected a translation service, the text will then be automatically translated.

preview:

show.preview.OCR.Translator.mp4

🔥 Features

  • Desktop application with a user-friendly graphical user interface (GUI) provided by customtkinter.
  • Ability to select preferred OCR and translation services.
  • Option to run the program using either the START button or the keyboard shortcut (Alt+Win+T or bound from options).
  • Capability to choose the area of the screen to scan for text using OCR and save the position (for example, when watching a movie and the subtitles always appear in one spot, so you don't have to select the text area again).
  • Automatic translation of the captured text if a translation service has been selected.
  • Ability to capture subtitles from movies or games by selecting the corresponding area of the screen and displaying the translated text next to them.
  • Chat with chatGPT or edgeGPT.
  • Ability to translate from the clipboard or manually entered text (similar to a typical translation app).
  • Save all selected options and settings to a file and load them when the program is launched.

Desktop App

Download the desktop app here Tested only on Windows 10.


Dependency

  1. Python 3.9. (If you want run from source)
  2. (optional) Capture2Text.
  3. (optional) Tesseract.
  4. (optional) Google api generate a service_account_creds.json. Then, put file into the ocrTranslate/configs directory.

5. (optional) ChatGPT

Configuration

  1. Create account on OpenAI's ChatGPT
  2. Save your email and password

Authentication method: (Choose 1 and paste to app settings)

- Email/Password

Currently broken for free users. Do export PUID="..." if you have a plus account. The PUID is a cookie named _puid Not supported for Google/Microsoft accounts.

- Access token

https://chat.openai.com/api/auth/session

6. (optional) EdgeGPT

Checking access (Required)

  • Install the latest version of Microsoft Edge
  • Alternatively, you can use any browser and set the user-agent to look like you're using Edge (e.g., Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51). You can do this easily with an extension like "User-Agent Switcher and Manager" for Chrome and Firefox.
  • Open bing.com/chat
  • If you see a chat feature, you are good to go

Getting authentication (Required)

  • Install the cookie editor extension for Chrome or Firefox
  • Go to bing.com
  • Open the extension
  • Click "Export" on the bottom right, then "Export as JSON" (This saves your cookies to clipboard)
  • Paste your cookies into a file cookies.json
  • Paste your file cookies.json to ocrTranslate/configs/

📊 Tables with information

Supported OCR Services

IDOCRInternet/LocalStatus
1Google Vision ApiInternetstable
2Google Vision Free DemoInternetstable
3Baidu ApiInternetstable
4Windows OCRLocalstable
5Capture2TextLocalstable
6TesseractLocalstable
7RapidOCRLocalstable

Supported Translation Services

IDTranslatorNumber of Supported LanguagesAdvantageServiceStatus
1Niutrans302support the most languages in the worldNortheastern University / Niutrans, China/
2Alibaba221support most languages, support professional fieldAlibaba, Chinastable
3Baidu201support most languages, support professional field, support Classical ChineseBaidu, Chinastable
4Iciba187support the most languages in the worldKingsoft / Xiaomi, Chinastable
5MyMemory151support the most languages in the world, good at Creole English, Creole FrenchTranslated, Italystable
6Iflytek140support the most languages in the worldIflytek, China/
7Google134support more languages in the worldGoogle, Americastable(offline in China inland)
8VolcEngine122support more languages in the world, support professional fieldByteDance, China/
9Lingvanex112support translation of different regions but the same languageLingvanex, Cyprusstable
10Bing110support more languages in the worldMicrosoft, Americastable
11Yandex102support more languages in the world, support word to emojiYandex, Russia/
12Itranslate101support translation of different regions but the same language, such as en-US, en-UK, en-AUItranslate, Austriastable
13Sogou61support more languages in the worldTencent, Chinastable
14ModernMt56open-source, support more languages in the worldModernmt / Translated, Italystable
15SysTran52support more languages in the worldSysTran, Francestable
16Apertium45open-sourceApertiumstable
17Reverso42popular on Mac and IphoneReverso, Francestable
18CloudYi28support main languagesXiamen University / CloudTranslation, Chinastable
19Deepl27high quality to translate but response slowlyDeepl, Germanystable
20QQTranSmart22support main languagesTencent, Chinastable
21TranslateCom21good at English translationTranslateCom, Americastable
22Tilde21good at lv, de, fr translationTilde, Latvia/
23QQFanyi17support main languagesTencent, Chinastable
24Argos17open-sourceArgos / Libre, Americastable
25TranslateMe16good at English translationTranslateMe / Neosus, Lithuaniastable
26Youdao15support main languages, high qualityNetease, Chinastable
27Papago15good at Korean translationNaver, South Koreastable
28Marai15good at Japanese translationMaraiTranslate, Japan/
29Iflyrec12good at Chinese translationIflytek, Chinastable
30Yeekit10support main languagesCTC, Chinastable
31LanguageWire8good at English translationLanguageWire, Denmarkstable
32Caiyun7high quality to translate but response slowly, support professional fieldColorfulClouds, Chinastable
33Elia6good at Basque translationElhuyar, Spainstable
34Judic4good at European translationCrossLang, Belgiumstable
35Mglip3good at Mongolia translationInner Mongolia University, Chinastable
36Utibet2good at Tibet translationTibet University, Chinastable

About

Convert captured images to text using BaiduOCR, GoogleOCR, WindowsOCR, tesseractOCR, RapidOCR or Capture2Text, and translate the resulting text using Google, Chatgpt, Edgegpt, DeepL or many more. Desktop application with a nice GUI provided by customtkinter.

Topics

Resources

Stars

94 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages