Unverified Commit edb3b386 authored by dmMaze's avatar dmMaze Committed by GitHub
Browse files

Merge pull request #132 from tak2hu/krita-wip

update readme and add Indonesian readme
parents c17419bf e8e31a26
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
# BallonTranslator
简体中文 | [English](README_EN.md) | [Русский](README_RU.md) | [日本語](README_JA.md)
简体中文 | [English](README_EN.md) | [Русский](README_RU.md) | [日本語](README_JA.md) | [Indonesia](README_ID.md)

深度学习辅助漫画翻译工具, 支持一键机翻和简单的图像/文本编辑  

@@ -35,9 +35,6 @@ Windows用户可从[MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw
### 运行源码

```bash
# 确保python<=3.9
$ python --version

# 克隆仓库
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator

+39 −15
Original line number Diff line number Diff line
# BallonTranslator
[简体中文](README.md) | English | [Русский](README_RU.md) | [日本語](README_JA.md)
[简体中文](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.

@@ -17,15 +17,14 @@ preview
  - 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) 
  - 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

* Adapted to images with extreme aspect ratio such as webtoons

# 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.)
@@ -33,8 +32,6 @@ Windows users can download Ballonstranslator-x.x.x-core.7z from [MEGA](https://m
## Run the source code

```bash
# First, you need to have Python(<=3.9 ) installed on your system.
$ python --version

# Clone this repo
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
@@ -51,9 +48,35 @@ pip install torch torchvision torchaudio --extra-index-url https://download.pyto

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.  

@@ -61,7 +84,7 @@ To use Sugoi translator(Japanese-English only), download [offline model](https:/
**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.  
<img src="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)
The font formats such as font size and 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

@@ -98,8 +121,9 @@ ocr & translate selected area

## Shortcuts
* ```A```/```D``` or ```pageUp```/```Down``` to turn the page
* ```Ctrl+Z```, ```Ctrl+Y``` 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) press 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)
* ```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.  
@@ -124,19 +148,19 @@ Support English and Japanese text detection, training code and more details can
## 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), 
 * [manga_ocr](https://github.com/kha-white/manga-ocr) is from [kha-white](https://github.com/kha-white), text recognition for Japanese, with the main focus being Japanese manga.

## 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.
  * AOT is from manga-image-translator.
  * PatchMatch is an algorithm from [PyPatchMatch](https://github.com/vacancy/PyPatchMatch), this program use a [modified version](https://github.com/dmMaze/PyPatchMatchInpaint) by me. (Adobe uses this algorithm)
  

## Translators

 * <s> Please change the goolge translator url from *.cn to *.com if you are not blocked by GFW. </s> Google shuts down translate service in China, please set corresponding 'url' in config panel to *.com.
 * Caiyun translator need to require a [token](https://dashboard.caiyunapp.com/)
 * papago  
 * DeepL & Sugoi translator(and it's CT2 Translation conversion) thanks to [Snowad14](https://github.com/Snowad14)  
 * Caiyun translator need to require a [token](https://dashboard.caiyunapp.com/).
 * Papago.
 * DeepL & Sugoi translator(and it's CT2 Translation conversion) thanks to [Snowad14](https://github.com/Snowad14).

 To add a new translator, please reference [how_to_add_new_translator](doc/how_to_add_new_translator.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.  

README_ID.md

0 → 100644
+152 −0
Original line number Diff line number Diff line
# BallonTranslator
[简体中文](README.md) | [English](README_EN.md) | [Русский](README_RU.md) | [日本語](README_JA.md) | Indonesia

Sebuah aplikasi penerjemahan komik/manga yang dibantu oleh deep learning.

<img src="doc/src/ui0.jpg" div align=center>

<p align=center>
pratinjau
</p>

# Fitur
* Terjemahan otomatis  
  - Mendukung pendeteksian, pengenalan, penghapusan, dan penerjemahan teks secara otomatis, performa keseluruhan bergantung pada modul-modul ini.
  - Peletakkan kata-kata berdasarkan perkiraan letak teks aslinya.
  - Mendukung format manga dan komik.
  - Typesetting optimal untuk manga->bahasa Inggris, bahasa Inggris->Mandarin (berdasarkan ekstraksi daerah balon.).
  
* Pengeditan gambar  
  - Mendukung pengeditan mask & inpainting (seperti alat content aware fill di PS) 
  - Mendukung gambar dengan rasio aspek ekstrim seperti webtoon
  
* Pengeditan teks  
  - Mendukung format rich text dan style teks, teks yang diterjemahkan dapat diedit secara langsung.
  - Mendukung pencarian & penggantian kata
  - Mendukung ekspor/impor ke/dari dokumen word

# Usage

Pengguna Windows dapat unduh Ballonstranslator-x.x.x-core.7z di [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) atau [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing)(catatan: Anda juga perlu mengunduh Ballonstranslator-1.3.xx terbaru di rilis GitHub mengekstraknya untuk menimpa **Ballontranslator-1.3.0-core** atau instalasi yang lebih lama agar aplikasi dapat diperbarui.)

## Jalankan kode sumber

```bash
# Clone repo ini
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator

# instal requirements_macOS.txt di macOS
$ pip install -r requirements.txt
```

Instal pytorch-cuda untuk dapat akselerasi GPU jika Anda memiliki GPU NVIDIA.

```bash
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
```

Unduhlah folder **data** dari [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) atau [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) dan pindahkan ke dalam BallonsTranslator/ballontranslator, akhirnya jalankan
```bash
# Untuk pengguna Linux atau MacOS, lihat [skrip ini] (https://github.com/dmMaze/BallonsTranslator/blob/master/ballontranslator/scripts/download_models.sh) dan jalankan untuk mengunduh SEMUA model
python ballontranslator
```

Untuk menggunakan Sugoi translator (hanya bahasa Jepang-Inggris), unduh [offline model](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm), pindahkan "sugoi_translator" ke dalam BallonsTranslator/ballontranslator/data/models.

## Penerjemahan sepenuhnya otomatis
**Disarankan untuk menjalankan program di terminal jika program ini mendadak berhenti dan tidak meninggalkan informasi, lihat gif berikut ini**, Pilih penerjemah yang diinginkan dan atur bahasa sumber dan target saat pertama kali menjalankan aplikasi. Buka folder yang berisi gambar-gambar yang mau diterjemahkan, klik tombol "Run" dan tunggu hingga proses selesai.  
<img src="doc/src/run.gif">  

Format font seperti ukuran font dan warna ditentukan oleh program secara otomatis dalam proses ini, Anda dapat menentukan format tersebut sebelum memulai proses dengan mengubah opsi yang sesuai dari "decide by program" menjadi "use global setting" di panel konfigurasi->Lettering. (pengaturan global adalah format yang ditampilkan oleh panel format font yang tepat ketika Anda tidak mengedit blok teks apa pun di adegan)

## Image editing

### inpaint tool
<img src="doc/src/imgedit_inpaint.gif">
<p align = "center">
Mode pengeditan gambar, alat inpainting
</p>

### rect tool
<img src="doc/src/rect_tool.gif">
<p align = "center">
Alat rect
</p>

Untuk 'menghapus' hasil inpainting yang tidak diinginkan, gunakan alat inpainting atau alat rect dengan menekan **tombol kanan**.  
Hasilnya tergantung pada seberapa akurat algoritme ("metode 1" dan "metode 2" dalam gif) mengekstrak mask dari teks. Ini berjalan lebih buruk pada teks & latar belakang yang kompleks.

## Pengeditan teks
<img src="doc/src/textedit.gif">
<p align = "center">
Mode Pengeditan teks
</p>

<img src="doc/src/multisel_autolayout.gif" div align=center>
<p align=center>
pemformatan kumpulan tata letak teks secara otomatis
</p>

<img src="doc/src/ocrselected.gif" div align=center>
<p align=center>
pengenalan kata & menerjemahkan area yang dipilih
</p>

## Shortcuts
* ```A```/```D``` atau ```pageUp```/```Down``` untuk pindah halaman.
* ```Ctrl+Z```, ```Ctrl+Shift+Z``` untuk undo/redo.(catatan: sejarah undo akan dihapus setelah pindah halaman)
* ```T``` untuk masuk mode text-editting (atau tombol "T" di toolbar bagian bawah).
*```W``` untuk masuk mode pembuatan text block, lalu seret mouse dengan diklik tombol kanan pada kanvas untuk menambahkan blok teks baru. (lihat gif pengeditan teks)
* ```P``` untuk mode edit gambar.  
* Di mode edit gambar, gunakan penggeser di bagian kanan bawah untuk mengontrol transparansi gambar asli.
* Tombol "OCR" dan "A" di toolbar bagian bawah dapat mengaktifkan OCR dan penerjemahan, jika Anda menonaktifkannya, program hanya akan melakukan deteksi dan penghapusan teks.
* Mengatur parameter modul otomatis di panel konfigurasi.  
* ```Ctrl++```/```Ctrl+-``` untuk mengubah ukuran gambar
* ```Ctrl+G```/```Ctrl+F``` untuk mencari secara global/dalam halaman saat ini.

<img src="doc/src/configpanel.png">  


# Modul otomasi
Proyek ini sangat bergantung pada [manga-image-translator](https://github.com/zyddnys/manga-image-translator), layanan online dan pelatihan model tidaklah murah, mohon pertimbangkan untuk menyumbangkan proyek ini:  
- Ko-fi: <https://ko-fi.com/voilelabs>
- Patreon: <https://www.patreon.com/voilelabs>
- 爱发电: <https://afdian.net/@voilelabs>  

Sugoi translator dibuat oleh [mingshiba](https://www.patreon.com/mingshiba).
  
## Deteksi teks
Deteksi teks bahasa Inggris dan Jepang, kode pelatihan, dan rincian lebih lanjut dapat ditemukan di [comic-text-detector](https://github.com/dmMaze/comic-text-detector)

## OCR
* Model pengenalan teks mit_32px berasal dari manga-image-translator, mendukung pengenalan teks bahasa Inggris dan Jepang dan warna teks.
 * Model pengenalan teks mit_48px berasal dari manga-image-translator, mendukung pengenalan teks bahasa Inggris, Jepang, dan Korea serta warna teks.
 * [manga_ocr] (https://github.com/kha-white/manga-ocr) berasal dari [kha-white] (https://github.com/kha-white),  pengenalan untuk teks bahasa Jepang, dengan fokus utama manga Jepang.

## Inpainting
  * AOT berasal dari manga-image-translator.
  * patchmatch adalah sebuah algoritma dari [PyPatchMatch](https://github.com/vacancy/PyPatchMatch), program ini menggunakan [versi dimodifikasi](https://github.com/dmMaze/PyPatchMatchInpaint) dari saya.
  

## Penerjemah

 * <s> Harap ubah url penerjemah goolge dari *.cn ke *.com jika Anda tidak diblokir oleh GFW. </s> Google mematikan layanan terjemahan di Cina, harap setel 'url' yang sesuai di panel konfigurasi ke *.com.
 * Penerjemah Caiyun perlu memerlukan [token] (https://dashboard.caiyunapp.com/).
 * Papago.
 * DeepL & Sugoi translator (dan konversi CT2 Translation-nya), terima kasih kepada [Snowad14](https://github.com/Snowad14).

Untuk menambahkan penerjemah baru, silakan lihat [how_to_add_new_translator](doc/how_to_add_new_translator.md), caranya mudah, cukup dengan membuat subclass dari BaseClass dan mengimplementasikan dua interface, kemudian Anda bisa menggunakannya di dalam aplikasi, Anda dipersilakan untuk berkontribusi pada proyek ini.  


## Hal lain
* Jika komputer Anda memiliki GPU Nvidia, program ini akan mengaktifkan akselerasi cuda untuk semua model secara default dan membutuhkan sekitar 6G memori GPU, Anda dapat menurunkan inpaint_size pada panel konfigurasi untuk menghindari OOM. 
* Terima kasih kepada [bropines] (https://github.com/bropines) untuk lokalisasi bahasa Rusia.  
* Menambahkan [saladict](https://saladict.crimx.com) (*Kamus pop-up dan penerjemah halaman profesional lengkap*) di menu mini ketika pilih teks. [Panduan instalasi](doc/saladict.md)

## Pratinjau hasil terjemahan otomatis penuh
|            Asli            |         Terjemahan (CHS)         |         Terjemahan (ENG)         |
| :-----------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------: |
|![Original](ballontranslator/data/testpacks/manga/original2.jpg 'https://twitter.com/mmd_96yuki/status/1320122899005460481')| ![Translated (CHS)](doc/src/result2.png) | ![Translated (ENG)](doc/src/original2_eng.png) |
|![Original](ballontranslator/data/testpacks/manga/original3.jpg 'https://twitter.com/_taroshin_/status/1231099378779082754')| ![Translated (CHS)](doc/src/original3.png) | ![Translated (ENG)](doc/src/original3_eng.png) |
| ![Original](ballontranslator/data//testpacks/manga/AisazuNihaIrarenai-003.jpg) | ![Translated (CHS)](doc/src/AisazuNihaIrarenai-003.png) | ![Translated (ENG)](doc/src/AisazuNihaIrarenai-003_eng.png) |
|           ![Original](ballontranslator/data//testpacks/comics/006049.jpg)           | ![Translated (CHS)](doc/src/006049.png) | |
+1 −4
Original line number Diff line number Diff line
# BallonTranslator
[简体中文](README.md) | [English](README_RU.md) | [Русский](README_RU.md) | 日本語
[简体中文](README.md)| [English](README_EN.md) | [Русский](README_RU.md) | 日本語 | [Indonesia](README_ID.md)

ディープラーニングを活用したマンガ翻訳支援ツール。

@@ -29,9 +29,6 @@ Windowsユーザーは、[腾讯云](https://share.weiyun.com/xoRhz9i4)または
## ソースコードの実行

```bash
# まず、Python(<=3.9 )がシステムにインストールされている必要があります。
$ python --version

# このリポジトリのクローン
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator

+1 −4
Original line number Diff line number Diff line
# BallonTranslator
[简体中文](README.md) | [English](README_EN.md) | Русский | [日本語](README_JA.md)
[简体中文](README.md) | [English](README_EN.md) | Русский | [日本語](README_JA.md) | [Indonesia](README_ID.md)

Еще один компьютерный инструмент для перевода комиксов/манги на основе глубокого обучения.

@@ -29,9 +29,6 @@
## Запуск из исходного кода (работает слегка с ошибками)

```bash
# Во-первых, в вашей системе должен быть установлен Python(<=3.9 ).
$ python --version

# Клонируйте этот репозиторий
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator

Loading