Coder Social home page Coder Social logo

boysugi20 / python-image-translator Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 179 KB

Image Translator: OCR-based tool for translating text within images using Google Translate. Effortlessly extract, translate, and overlay text onto images.

Python 100.00%

python-image-translator's Introduction

Image Translator

This project utilizes optical character recognition (OCR) and translation to translate text within images from one language to another. It performs the following steps:

  1. OCR Processing: The project extracts text and its bounding boxes from input images using the EasyOCR library.
  2. Translation: It translates the extracted text using the Google Translator API.
  3. Text Replacement: The translated text is then overlaid onto the image, replacing the original text while maintaining its position and style.
  4. Output: Finally, the modified image with translated text is saved to an output folder.

Setup

Installation

  1. Clone this repository to your local machine.
  2. Install the required Python dependencies using pip install pipenv && pipenv install.

Usage

  1. Place your input images in the input folder.
  2. Run the script image_translator.py.
  3. Translated images will be saved in the output folder.

Notes

  • Supported languages for OCR can be seen here
  • Supported languages for Google Translate can be obtained using the following code:
    from deep_translator.constants import GOOGLE_LANGUAGES_TO_CODES
    print(GOOGLE_LANGUAGES_TO_CODES)
  • Adjustments to text languages, recognition thresholds, translation services, or image processing parameters can be made within the script.

Examples

image-1 image-1-translated

Acknowledgments

python-image-translator's People

Contributors

boysugi20 avatar

Stargazers

 avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.