Fanyi (翻译) is a simple, optical screen reading (OCR) application that is meant to aid in translating Mandarin content on the screen into English.
It uses the CEDICT dictionary to provide definitions for Chinese phrases and words.
Note: This has been developed and tested primarily on Windows systems
The application takes a screenshot and passes it into EasyOCR. The text is read, then passed into pkuseg for Chinese word segmentation. The system then tries to map it to the parsed CEDICT and produces the result.
- Reads text on your screen and helps to translate between Simplified and Traditional Chinese into English
- Dictionary features that provide translations and pinyin
- Presets can be set up to easily capture the same region of the screen
- User interface for looking through information captured from the image provided
- User preferences for easy reuse on the next startup
- Ensure you have Python (>=3.12 preferrably) installed on your system
- Install the required packages with
python -m pip install -r requirements.txt
- Launch the application
- Select a valid CEDICT dictionary on your system
- Select a preferred language
- Set up a preset to define the boundaries of the screen capture
- Screenshot, and let the system run :)
Note: By default, the installation will install a version of PyTorch that uses the CPU to carry out the screen reading. If you have an NVIDIA GPU, you might want to consider installing a version that supports CUDA. See the PyTorch - Get Started page for more information.