You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project utilizes optical character recognition (OCR) and translation to translate text within images from one language to another. It performs the following steps:
4
-
5
-
1.**OCR Processing:** The project extracts text and its bounding boxes from input images using the EasyOCR library.
6
-
2.**Translation:** It translates the extracted text using the Google Translator API.
7
-
3.**Text Replacement:** The translated text is then overlaid onto the image, replacing the original text while maintaining its position and style.
8
-
4.**Output:** Finally, the modified image with translated text is saved to an output folder.
9
-
10
-
## Setup
11
-
12
-
### Installation
1
+
## Usage
13
2
14
-
1. Clone this repository to your local machine.
15
-
2. Install the required Python dependencies using `pip install pipenv && pipenv install`.
3
+
1. Place your input images in the `input` folder.
4
+
2. Run the script `main.py`.
5
+
3. Translated images will be saved in the `output` folder.
16
6
17
-
or
7
+
## New Features
18
8
19
-
```
20
-
py -3.10 -m venv venv
21
-
venv\Scripts\activate
22
-
pip install -r requirements.txt
23
-
```
9
+
### SyncVideoToAudio.py
10
+
This script syncs audio to a video file using advanced checks and features. It performs the following steps:
11
+
-**Duration Check:** Ensures that the video and audio durations are within a specified tolerance.
12
+
-**Audio Extraction:** Extracts audio from the video if available, or generates silent audio if not.
13
+
-**Audio Alignment:** Aligns the audio using cross-correlation to calculate the offset.
14
+
-**Synchronization:** Syncs the audio to the video using FFmpeg and saves the output.
24
15
25
-
If you like to use torch with cuda:
16
+
### MultipleImageProcessing.py
17
+
This script processes multiple images by performing OCR to extract text, translating the text, and replacing the original text in the images with the translated text. It includes:
18
+
-**Batch Processing:** Allows processing images one by one or multiple images simultaneously using multithreading.
19
+
-**Error Handling:** Handles translation errors and missing translations gracefully.
20
+
-**Customization:** Supports custom source and target languages for OCR and translation.
This script extracts frames from a video file and saves them as individual images. It features:
24
+
-**Frame Extraction:** Reads and saves each frame of the video as a separate image.
25
+
-**Output Management:** Ensures the output folder exists and manages the file naming for the frames.
31
26
32
-
## Usage
27
+
### imageToVideo.py
28
+
This script converts a series of images into a video file. It includes:
29
+
-**Image-to-Video Conversion:** Reads images from a folder and combines them into a video file.
30
+
-**Frame Rate Customization:** Allows setting the frame rate for the output video.
31
+
-**Error Handling:** Uses a placeholder frame for any invalid or unreadable images.
33
32
34
-
1. Place your input images in the `input` folder.
35
-
2. Run the script `main.py`.
36
-
3. Translated images will be saved in the `output` folder.
33
+
## The goal of this update is to be able to translate video to video with the combination of [OpenTranslator](https://github.com/overcrash66/OpenTranslator).
0 commit comments