[v1.3.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.0) released
1. Fix deepl translator, thanks to [@Snowad14](https://github.com/Snowad14)
2. Fix font size & stroke bug which makes text unreadable
3. Support **global font format** (determine the font format settings used by auto-translation mode): in config panel->Lettering, change the corresponding option from "decide by the program" to "use global setting" to enable. Note global settings are those formats shown by the right font format panel when you are not editing any textblock in the scene.
4. Add **new inpainting model**: lama-mpe and set it as default.
5. Support multiple textblocks selection & formatting.
6. Improved manga->English, English->Chinese typesetting (**Auto-layout** in Config panel->Lettering, enabled by default), it can also be applied to selected text blocks use the option in the right-click menu.
- 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)
* Text editing
Support rich text formatting.
Support rich text formatting, translated texts can be edited interactively.
# Usage
## 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.
<imgsrc="doc/src/run.gif">
Windows users can download Ballonstranslator-x.x.x-core.7z from [腾讯云](https://share.weiyun.com/xoRhz9i4) or [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) and extract it to a folder named BallonTranslator, also download Ballonstranslator-x.x.x-patch.7z if there is any and extract it to the same folder.
## Run the source code
```bash
# First, you need to have Python(<=3.9 ) installed on your system.
$ python --version
### Previews of fully automated translation results
Download the **data** folder from https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing and move it into BallonsTranslator/ballontranslator, finally run
```bash
python ballontranslator/__main__.py
```
## 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.
<imgsrc="doc/src/run.gif">
The font formats such as font size, color are determined by the program automatically in this process, you can predetermine those formats by change corresponding options from "decide by program" to "use global setting" in the config panel->Lettering.(global settings are those formats shown by the right font format panel when you are not editing any textblock in the scene)
## Image editing
@@ -65,6 +79,11 @@ The result depends on how accurately the algorithm ("method 1" and "method 2" in
* Ctrl+Z, Ctrl+Y to undo/redo most operations, note the undo stack will be cleared after you turn the page.
@@ -77,37 +96,41 @@ Text editing mode
<imgsrc="doc/src/configpanel.png">
## Automation modules
# Automation modules
This project is heavily dependent upon [manga-image-translator](https://github.com/zyddnys/manga-image-translator), online service and model training is not cheap, please consider to donate the project:
- Ko-fi: <https://ko-fi.com/voilelabs>
- Patreon: <https://www.patreon.com/voilelabs>
- 爱发电: <https://afdian.net/@voilelabs>
### Text detection
## Text detection
Support English and Japanese text detection, training code and more details can be found at [comic-text-detector](https://github.com/dmMaze/comic-text-detector)
### OCR
## OCR
* mit_32px text recognition model is from manga-image-translator, support English and Japanese recognition and text color extraction.
* mit_48px text recognition model is from manga-image-translator, support English, Japanese and Korean recognition and text color extraction.
*[manga_ocr](https://github.com/kha-white/manga-ocr) is from [kha-white](https://github.com/kha-white),
### Inpainting
## Inpainting
* AOT is from manga-image-translator
* patchmatch is a non-dl algrithom from [PyPatchMatch](https://github.com/vacancy/PyPatchMatch), this program use a [modified version](https://github.com/dmMaze/PyPatchMatchInpaint) by me.
### Translators
## Translators
* Please change the goolge translator url from *.cn to *.com if you are not blocked by GFW.
* Caiyun translator need to require a [token](https://dashboard.caiyunapp.com/)
* papago
To add a new translator, please reference [加别的翻译器](doc/加别的翻译器.md), it is simple as subclass a BaseClass and implementing two interfaces, then you can use it in the application, you are welcome to contribute to the project.
## Misc
* The release package contains PyTorch and cuda. For future updates, if no changes are made to the dependencies, only the new exe and models will be released, copy them to the program folder to get the grogram updated.
* If your computer has an Nvidia GPU, the program will enable cuda acceleration for all models by default, which requires around 6G GPU memory, you can turn down the inpaint_size in the config panel to avoid OOM.
# TODO
- Optimize for cpu
- New models to support more languages
- ...
## Previews of fully automated translation results
| Original | Translated (CHS) | Translated (ENG) |