Commit b264e0c6 authored by dmMaze's avatar dmMaze
Browse files

update readme

parent 30bd6ac4
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -36,9 +36,9 @@ Windows用户可从[腾讯云](https://share.weiyun.com/xoRhz9i4) 或 [Google Dr
$ python --version

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

# 安装依赖
# 安装依赖, macOS安装requirements_macOS.txt
$ pip install -r requirements.txt
```

@@ -50,9 +50,11 @@ pip install torch torchvision torchaudio --extra-index-url https://download.pyto

从 https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing 下载**data**文件夹并移动到 ```BallonsTranslator/ballontranslator```目录, 最后运行
```bash
python ballontranslator/__main__.py
python ballontranslator
```

如果要使用Sugoi翻译器(仅英译日), 下载[离线模型](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm), 将 "sugoi_translator" 移入BallonsTranslator/ballontranslator/data.  

## 一键翻译
**建议在命令行终端下运行程序**, 首次运行请先配置好源语言/目标语言, 打开一个带图片的文件夹, 点击Run等待翻译完成  
<img src="doc/src/run.gif">  
@@ -109,6 +111,8 @@ python ballontranslator/__main__.py
- Patreon: <https://www.patreon.com/voilelabs>
- 爱发电: <https://afdian.net/@voilelabs>

Sugoi翻译器作者: [mingshiba](https://www.patreon.com/mingshiba).
  
### 文本检测
暂时仅支持日文(方块字都差不多)和英文检测, 训练代码和说明见https://github.com/dmMaze/comic-text-detector

@@ -127,10 +131,13 @@ python ballontranslator/__main__.py
 * 谷歌翻译能挂代理建议把url从cn改成com
 * 彩云, 需要申请[token](https://dashboard.caiyunapp.com/)
 * papago  
 * DeepL 和 Sugoi(及它的CT2 Translation转换)翻译器, 感谢[Snowad14](https://github.com/Snowad14)  

 如需添加新的翻译器请参考[加别的翻译器](doc/加别的翻译器.md), 本程序添加新翻译器只需要继承基类实现两个接口即可不需要理会代码其他部分, 欢迎大佬提pr

## 杂
* 如果电脑带N卡, 程序默认对所有模型启用GPU加速, 默认配置下显存占用在6G左右. 4G显存调小修复器inpaint_size即可.  
* 感谢[bropines](https://github.com/bropines)提供俄语翻译

## 一键翻译结果预览
|            Original            |         Translated (CHS)         |         Translated (ENG)         |
+14 −6
Original line number Diff line number Diff line
# BallonTranslator
[简体中文](README.md) | English  
[简体中文](README.md) | English | [Русский](README_RU.md)

Yet another computer-aided comic/manga translation tool powered by deep learning.

@@ -33,9 +33,9 @@ Windows users can download Ballonstranslator-x.x.x-core.7z from [腾讯云](http
$ python --version

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

# Install the dependencies
# install requirements_macOS.txt on macOS
$ pip install -r requirements.txt
```

@@ -47,9 +47,12 @@ pip install torch torchvision torchaudio --extra-index-url https://download.pyto

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
python ballontranslator
```


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.  

## 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.  
<img src="doc/src/run.gif">  
@@ -70,7 +73,7 @@ Image editing mode, inpainting tool
rect tool
</p>

Drag the rectangle with left button pressed to erase the text inside the box, press right button and drag to clear inpainted result.  
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 editing
@@ -103,6 +106,8 @@ This project is heavily dependent upon [manga-image-translator](https://github.c
- Patreon: <https://www.patreon.com/voilelabs>
- 爱发电: <https://afdian.net/@voilelabs>  

Sugoi translator is created by [mingshiba](https://www.patreon.com/mingshiba).
  
## 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)

@@ -121,11 +126,14 @@ Support English and Japanese text detection, training code and more details can
 * 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  
 * DeepL & Sugoi translator(and it's CT2 Translation conversion) thanks to [Snowad14](https://github.com/Snowad14)  

 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
* 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. 
* Thanks to [bropines](https://github.com/bropines) for the Russian localisation.  

## Previews of fully automated translation results
|            Original            |         Translated (CHS)         |         Translated (ENG)         |
+2 −2
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
$ python --version

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

# Установка зависимостей
$ pip install -r requirements.txt
@@ -48,7 +48,7 @@ pip install torch torchvision torchaudio --extra-index-url https://download.pyto
Скачайте папку **data** с сайта https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing и переместите ее в BallonsTranslator/ballontranslator, наконец, выполните команду

```bash
python ballontranslator/__main__.py
python ballontranslator
```

## Полностью автоматизированный перевод
+0 −0

File moved.