# BallonTranslator
[简体中文](README.md) | English | [Русский](README_RU.md) | [日本語](README_JA.md) | [Indonesia](README_ID.md)
Yet another computer-aided comic/manga translation tool powered by deep learning.
preview
# Features * Fully automated translation - Support automatic text-detection, recognition, removal, and translation, overall performance is dependent upon these modules. - lettering is based on the formatting estimation of the original text. - Works decently with manga and comics. - Improved manga->English, English->Chinese typesetting (based on the extraction of balloon regions.). * Image editing - Support mask editing & inpainting (something like spot healing brush tool in PS) - Adapted to images with extreme aspect ratio such as webtoons * Text editing - Support rich text formatting and text style presets, translated texts can be edited interactively. - Support search & replace - Support export/import to/from word documents # Usage Windows users can download Ballonstranslator-x.x.x-core.7z from [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) or [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing)(note: you also need to download latest Ballonstranslator-1.3.xx from GitHub release and extract it to overwrite **Ballontranslator-1.3.0-core** or older installation to get the app updated.) ## Run the source code ```bash # Clone this repo $ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator # install requirements_macOS.txt on macOS $ pip install -r requirements.txt ``` Install pytorch-cuda to enable GPU acceleration if you have a NVIDIA GPU. ```bash pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu116 ``` Download the **data** folder from [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) or [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) and move it into BallonsTranslator/ballontranslator, finally run ```bash # For Linux or MacOS users, see [this script](https://github.com/dmMaze/BallonsTranslator/blob/master/ballontranslator/scripts/download_models.sh) and run to download ALL models python ballontranslator ``` ### Apple Silicon Mac native build .app application ``` ### install python 3.9.13 virtual environment brew install pyenv mecab env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.9.13 pyenv global 3.9.13 python3 -m venv ballonstranslator source ballonstranslator/bin/activate # Clone the repository git clone https://github.com/dmMaze/BallonsTranslator.git cd BallonsTranslator # Install the dependencies pip3 install -r requirements_macOS.txt # Package the application cd ballontranslator sudo pyinstaller __main__.spec # The packaged `BallonsTranslator.app` is in the `dist` folder # Note that the app is not functional yet, you need to go to [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) or [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing), download `data` and overwrite it to `BallonsTranslator.app/Contents/Resources/data`. # When overwriting select "``Merge``, after the overwrite is done, the application is finally packaged and complete, out of the box, just drag the application to the macOS application folder, no need to configure the Python environment again. # Or see [this script](https://github.com/dmMaze/BallonsTranslator/blob/master/ballontranslator/scripts/download_models.sh) ``` To use Sugoi translator(Japanese-English only), download [offline model](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm), move "sugoi_translator" into the BallonsTranslator/ballontranslator/data/models. ## Fully automated translation **It is recommended to run the program in a terminal in case it crashed and left no information, see the following gif.**, Please select the desired translator and set the source and target languages the first time you run the application. Open a folder containing images that need translation, click the "Run" button and wait for the process to complete.Image editing mode, inpainting tool
### rect toolrect tool
To 'erase' unwanted inpainted results, use the inpainting tool or rect tool with your **right button** pressed. The result depends on how accurately the algorithm ("method 1" and "method 2" in the gif) extracts the text mask. It could perform worse on complex text & background. ## Text editingText editing mode
batch text formatting & auto layout
ocr & translate selected area
## Shortcuts * ```A```/```D``` or ```pageUp```/```Down``` to turn the page * ```Ctrl+Z```, ```Ctrl+Shift+Z``` to undo/redo most operations. (note the undo stack will be cleared after you turn the page) * ```T``` to text-editting mode (or the "T" button on the bottom toolbar). * ```W``` to activate text block creating mode, then drag the mouse on the canvas with the right button clicked to add a new text block. (see the text editing gif) * ```P``` to image-editting mode. * In the image editing mode, use the slider on the right bottom to control the original image transparency. * The "OCR" and "A" button in the bottom toolbar controls whether to enable OCR and translation, if you disable them, the program will only do the text detection and removal. * Set parameters of automatic modules in the config panel. * ```Ctrl++```/```Ctrl+-``` to resize image * ```Ctrl+G```/```Ctrl+F``` to search globally/in current page.