Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dadangdut33/screen-translate
A Screen Translator/OCR Translator made by using Python and Tesseract, the user interface are made using Tkinter. All code written in python.
https://github.com/dadangdut33/screen-translate
ocr opencv-python python tesseract-ocr tkinter translate
Last synced: 3 months ago
JSON representation
A Screen Translator/OCR Translator made by using Python and Tesseract, the user interface are made using Tkinter. All code written in python.
- Host: GitHub
- URL: https://github.com/dadangdut33/screen-translate
- Owner: Dadangdut33
- License: mit
- Created: 2021-08-28T15:35:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-19T08:01:40.000Z (11 months ago)
- Last Synced: 2024-10-10T19:25:54.422Z (4 months ago)
- Topics: ocr, opencv-python, python, tesseract-ocr, tkinter, translate
- Language: Python
- Homepage:
- Size: 91.3 MB
- Stars: 111
- Watchers: 2
- Forks: 15
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
Screen Translate - An Easy to Use OCR Translator
STL a.k.a Screen Translate is an OCR translator tool made by utilizing Tesseract and opencv-python. The code is then compiled to .exe by using pyinstaller.
Inspired by software such as Visual Novel Reader (VNR), [Visual Novel OCR](https://github.com/leminhyen2/Visual-Novel-OCR), and [QTranslate](https://quest-app.appspot.com/). Also available to download at [sourceforge](https://sourceforge.net/projects/screen-translate/).Jump to
- [Features](#features)
- [User Requirements](#user-requirements)
- [Downloads](#downloads)
- [Installation and Setup](#installation-and-setup)
- [How To Uninstall](#how-to-uninstall)
- [Development](#--development--)
- [Setup](#setup)
- [Building](#building)
- [Packaging](#packaging)
- [Contributing](#contributing)
- [Attribution](#attribution)
- [Other](#other)---
# Features
- Translation (Google translate, LibreTranslate, Mymemorytranslator, Deepl, Pons)
- OCR Detection (Using tesseract OCR)
- Snip and translate
Example
- Capture and translate
Example
# User Requirements
- **[tesseract](https://github.com/UB-Mannheim/tesseract/wiki)**, needed for the ocr. **Install it with all the language pack**. (Tested version is v5.0.0-alpha2021081, higher version should also work)
- **[LibreTranslate](https://github.com/LibreTranslate/LibreTranslate)** for offline translation **(Optional)**.
- Internet connection for translation if not using LibreTranslate.# Downloads
- [The application (ScreenTranslate/STL)](https://github.com/Dadangdut33/Screen-Translate/releases/latest)
- [Tesseract](https://github.com/UB-Mannheim/tesseract/wiki) (v5.0.0-alpha2021081 or higher)
- [LibreTranslate](https://github.com/LibreTranslate/LibreTranslate) **(Optional)**# Installation and Setup
1. Download the latest [release](https://github.com/Dadangdut33/Screen-Translate/releases/latest) of this program
2. Install [tesseract](https://github.com/UB-Mannheim/tesseract/wiki), **make sure to select install all language pack when prompted**. Optionally you can found the language pack tessdata in [teserract repository](https://github.com/tesseract-ocr) such as [this](https://github.com/tesseract-ocr/tessdata_best)
3. Open the app and adjust setting to your liking
4. **(Recommended)** Set monitor scaling to 100% so that image is captured accurately (If scaling is not set to 100% you will need to set offset in setting)
5. **(Optional)** Set offset if on multiple monitors.
6. Try capturing image and see if it works or not, if it doesn't, go check the image captured in img_captured folder to see wether it capture the stuff that you want or not. If not, try to change the offset.
7. Now that you have set everything, the app should be ready. Feel free to submit new issue on the github repository if you encounter any bugs.# How To Uninstall
If you use the installer version, you can run the uninstaller inside the app folder or uninstall it from control panel. For the portable (rar) version, you can just delete them.
---
- Development -
## Setup
> **Note** \
> It is recommended to create a virtual environment, but it is not required.1. Clone the repo or download the source code of the latest release
2. Create your virtual environment by running `python -m venv venv`
3. Activate your virtual environment
4. Install all the dependencies needed by running `pip install -r requirements.txt`
5. Get to root directory and Run the script by typing `python Main.py`## Building
> **Warning** \
> As of now cx_Freeze setup is not working properly for DeepL scraper so use the pyinstaller script instead if you want to compile the app by yourself.Before building, we gotta make sure that the dependencies and playwright driver is installed. For **playwright** (used for deepl scraper), we need to install the browser driver first, which is explained in the [playwright documentation](https://playwright.dev/python/docs/library#pyinstaller). **It is stated there that if we want to bundle our code we need to run the following code first**:
```bash
# bash
PLAYWRIGHT_BROWSERS_PATH=0 playwright install chromium# powershell
$env:PLAYWRIGHT_BROWSERS_PATH="0"
playwright install chromium# batch
set PLAYWRIGHT_BROWSERS_PATH=0
playwright install chromium
```After dependencies are installed, we can start building the app. There are 2 options that i have provided for building, using pyinstaller or cx_freeze. The command used are:
**For pyinstaller:**
```bash
# On Source Code Directory
python build_pyinstaller.py
# you will be prompted to build with console or not
```This will create a folder called `dist` in the source code directory. Inside the folder there will be a folder called `ScreenTranslate ` which contains the executable file.
**For cx_freeze:**
```bash
# On Source Code Directory
python build_cx.py build
# you will be prompted to build with console or not
```This will create a folder called `build` in the source code directory. Inside the folder there will be a folder called `exe.-` which contains the executable file.
## Packaging
I use innosetup to package the app. You can download it [here](https://jrsoftware.org/isdl.php). After installing it, you can setup the path and AppId in `ScreenTranslate.iss` file and run the .iss script.
## Contributing
If you encounter any bugs with the program, please report them by opening an issue on the github repository. You can also request a feature by opening an issue or posting in discussion.
# Attribution
- Translate Icon in the logo is taken from [Icons8](https://icons8.com/)
- [Sunvalley TTK Theme](https://github.com/rdbende/Sun-Valley-ttk-theme/) (used for app theme although i modified it a bit)# Other
Check out my other similar project called [Speech Translate](https://github.com/Dadangdut33/Speech-Translate/) a real time speech transcription and translation app made possible using whisper model from openAI.