init
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +1 -0
- .github/ISSUE_TEMPLATE/bug_report_en.yaml +104 -0
- .github/ISSUE_TEMPLATE/bug_report_zh.yaml +105 -0
- .github/ISSUE_TEMPLATE/feature_request_en.yaml +59 -0
- .github/ISSUE_TEMPLATE/feature_request_zh.yaml +59 -0
- .gitignore +63 -0
- .vscode/launch.json +13 -0
- LICENSE +674 -0
- README.md +230 -0
- README_EN.md +170 -0
- config/stylesheet.css +1080 -0
- config/themes.json +31 -0
- data/pkusegscores.json +1 -0
- doc/CHANGELOG.md +119 -0
- doc/CHANGELOG_EN.md +116 -0
- doc/CHANGELOG_PT-BR.md +109 -0
- doc/Como_add_um_novo_tradutor.md +175 -0
- doc/Como_añadir_un_nuevo_traductor.md +175 -0
- doc/Manual_TuanziOCR_ES.md +15 -0
- doc/Manual_TuanziOCR_FR.md +15 -0
- doc/Manual_TuanziOCR_pt-BR.md +15 -0
- doc/README_ES.md +289 -0
- doc/README_FR.md +254 -0
- doc/README_ID.md +150 -0
- doc/README_JA.md +135 -0
- doc/README_KO.md +252 -0
- doc/README_PT-BR.md +241 -0
- doc/README_RU.md +247 -0
- doc/README_VI.md +244 -0
- doc/add_translator_ru.md +110 -0
- doc/how_to_add_new_translator.md +142 -0
- doc/macOS_app.md +76 -0
- doc/macOS_app_CN.md +41 -0
- doc/modules/translators.md +270 -0
- doc/saladict.md +13 -0
- doc/saladict_chs.md +15 -0
- doc/saladict_es.md +18 -0
- doc/saladict_fr.md +13 -0
- doc/saladict_ko.md +13 -0
- doc/saladict_pt-br.md +18 -0
- doc/src/006049.png +3 -0
- doc/src/AisazuNihaIrarenai-003.png +3 -0
- doc/src/AisazuNihaIrarenai-003_eng.png +3 -0
- doc/src/bottombar0.png +3 -0
- doc/src/configpanel.png +3 -0
- doc/src/fontpresets.gif +3 -0
- doc/src/global_font_format.png +3 -0
- doc/src/imgedit_inpaint.gif +3 -0
- doc/src/multisel_autolayout.gif +3 -0
- doc/src/new_translator.png +3 -0
.gitattributes
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
*.7z filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 2 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 1 |
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.icns filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 4 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 5 |
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
.github/ISSUE_TEMPLATE/bug_report_en.yaml
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Bug Report
|
| 2 |
+
title: "Bug Report:" # Default title
|
| 3 |
+
description: Report a bug
|
| 4 |
+
labels: [bug]
|
| 5 |
+
body:
|
| 6 |
+
- type: markdown
|
| 7 |
+
attributes:
|
| 8 |
+
value: |
|
| 9 |
+
## Before You Begin
|
| 10 |
+
|
| 11 |
+
🚨 **Please follow these steps before creating an issue** 🚨
|
| 12 |
+
|
| 13 |
+
1. Ensure your repository is up-to-date by running one of the following commands:
|
| 14 |
+
- `.\git\bin\git.exe pull`
|
| 15 |
+
- `.\PortableGit\bin\git.exe pull`
|
| 16 |
+
- `git pull`
|
| 17 |
+
|
| 18 |
+
2. Check if a similar issue already exists.
|
| 19 |
+
|
| 20 |
+
3. Provide as much detail as possible, including crash logs (if applicable).
|
| 21 |
+
- type: textarea
|
| 22 |
+
validations:
|
| 23 |
+
required: true
|
| 24 |
+
attributes:
|
| 25 |
+
label: Version Info
|
| 26 |
+
description: |
|
| 27 |
+
Please provide the version information of BallonsTranslator. Copy the following details from the console output (if missing, save your project and restart the application):
|
| 28 |
+
- Python version and interpreter path
|
| 29 |
+
- Application version, branch, and Commit Hash
|
| 30 |
+
placeholder: |
|
| 31 |
+
Example:
|
| 32 |
+
py version: 3.10.9 (tags/v3.10.9:...)
|
| 33 |
+
py executable: Path\to\interpreter
|
| 34 |
+
version: 1.4.0
|
| 35 |
+
branch: dev
|
| 36 |
+
Commit hash: 53eee46fd7bef117a4ada9a86843c3bf6e37d953
|
| 37 |
+
- type: textarea
|
| 38 |
+
validations:
|
| 39 |
+
required: true
|
| 40 |
+
attributes:
|
| 41 |
+
label: Description of the Problem
|
| 42 |
+
description: |
|
| 43 |
+
Please describe the bug in detail and provide reproduction steps.
|
| 44 |
+
- type: markdown
|
| 45 |
+
attributes:
|
| 46 |
+
value: |
|
| 47 |
+
### Affected Modules
|
| 48 |
+
If your issue is related to specific modules, please select the applicable option for each category (if not applicable, choose "None"):
|
| 49 |
+
- type: dropdown
|
| 50 |
+
attributes:
|
| 51 |
+
label: Text Detector
|
| 52 |
+
options:
|
| 53 |
+
- ctd
|
| 54 |
+
- stariver_ocr
|
| 55 |
+
- type: dropdown
|
| 56 |
+
attributes:
|
| 57 |
+
label: OCR
|
| 58 |
+
options:
|
| 59 |
+
- google_lens
|
| 60 |
+
- manga_ocr
|
| 61 |
+
- mit32px
|
| 62 |
+
- mit48px_ctc
|
| 63 |
+
- mit48px
|
| 64 |
+
- stariver_ocr
|
| 65 |
+
- windows ocr
|
| 66 |
+
- type: dropdown
|
| 67 |
+
attributes:
|
| 68 |
+
label: Inpaint
|
| 69 |
+
options:
|
| 70 |
+
- opencv-tela
|
| 71 |
+
- patchmatch
|
| 72 |
+
- aot
|
| 73 |
+
- lama_mpe
|
| 74 |
+
- lama_large_512px
|
| 75 |
+
- type: dropdown
|
| 76 |
+
attributes:
|
| 77 |
+
label: Translator
|
| 78 |
+
options:
|
| 79 |
+
- Baidu
|
| 80 |
+
- Caiyun
|
| 81 |
+
- ChatGPT
|
| 82 |
+
- ChatGPT_exp
|
| 83 |
+
- DeepL
|
| 84 |
+
- DeepL Free
|
| 85 |
+
- DeepLX API
|
| 86 |
+
- google
|
| 87 |
+
- Papago
|
| 88 |
+
- Sakura
|
| 89 |
+
- type: textarea
|
| 90 |
+
attributes:
|
| 91 |
+
label: Screenshot
|
| 92 |
+
description: |
|
| 93 |
+
If possible, attach a screenshot of the issue (you can drag and drop the image).
|
| 94 |
+
- type: textarea
|
| 95 |
+
attributes:
|
| 96 |
+
label: Logs
|
| 97 |
+
description: |
|
| 98 |
+
Paste the log output here (it will be auto-formatted as a code block).
|
| 99 |
+
render: shell
|
| 100 |
+
- type: textarea
|
| 101 |
+
attributes:
|
| 102 |
+
label: Additional Information
|
| 103 |
+
description: |
|
| 104 |
+
Any additional information you would like to provide.
|
.github/ISSUE_TEMPLATE/bug_report_zh.yaml
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Bug 反馈
|
| 2 |
+
title: "Bug 反馈:" # 默认标题
|
| 3 |
+
description: 报告不符合预期的错误
|
| 4 |
+
labels: [bug]
|
| 5 |
+
body:
|
| 6 |
+
- type: markdown
|
| 7 |
+
attributes:
|
| 8 |
+
value: |
|
| 9 |
+
## 在开始之前
|
| 10 |
+
|
| 11 |
+
🚨 **请务必按以下步骤操作** 🚨
|
| 12 |
+
|
| 13 |
+
1. 请确保在创建问题前更新仓库,运行以下任一命令:
|
| 14 |
+
- `.\git\bin\git.exe pull`
|
| 15 |
+
- `.\PortableGit\bin\git.exe pull`
|
| 16 |
+
- `git pull`
|
| 17 |
+
|
| 18 |
+
2. 检查是否已有类似问题存在。
|
| 19 |
+
|
| 20 |
+
3. 请尽可能提供详细信息,包括崩溃日志(如有)。
|
| 21 |
+
- type: textarea
|
| 22 |
+
validations:
|
| 23 |
+
required: true
|
| 24 |
+
attributes:
|
| 25 |
+
label: 版本信息
|
| 26 |
+
description: |
|
| 27 |
+
请提供 BallonsTranslator 的版本信息。请复制控制台显示的以下内容(如果信息消失,请保存项目并重启程序):
|
| 28 |
+
- Python 版本及解释器路径
|
| 29 |
+
- 应用版本、分支及 Commit Hash
|
| 30 |
+
|
| 31 |
+
placeholder: |
|
| 32 |
+
示例:
|
| 33 |
+
py version: 3.10.9 (tags/v3.10.9:...)
|
| 34 |
+
py executable: 路径\到\解释器
|
| 35 |
+
version: 1.4.0
|
| 36 |
+
branch: dev
|
| 37 |
+
Commit hash: 53eee46fd7bef117a4ada9a86843c3bf6e37d953
|
| 38 |
+
- type: textarea
|
| 39 |
+
validations:
|
| 40 |
+
required: true
|
| 41 |
+
attributes:
|
| 42 |
+
label: 问题描述
|
| 43 |
+
description: |
|
| 44 |
+
请详细描述问题,并提供复现步骤。
|
| 45 |
+
- type: markdown
|
| 46 |
+
attributes:
|
| 47 |
+
value: |
|
| 48 |
+
### 受影响的模块
|
| 49 |
+
如果问题与特定模块相关,请选择相关项(如果不适用,请选择“无”):
|
| 50 |
+
- type: dropdown
|
| 51 |
+
attributes:
|
| 52 |
+
label: 文本检测
|
| 53 |
+
options:
|
| 54 |
+
- ctd
|
| 55 |
+
- stariver_ocr
|
| 56 |
+
- type: dropdown
|
| 57 |
+
attributes:
|
| 58 |
+
label: OCR
|
| 59 |
+
options:
|
| 60 |
+
- google_lens
|
| 61 |
+
- manga_ocr
|
| 62 |
+
- mit32px
|
| 63 |
+
- mit48px_ctc
|
| 64 |
+
- mit48px
|
| 65 |
+
- stariver_ocr
|
| 66 |
+
- windows ocr
|
| 67 |
+
- type: dropdown
|
| 68 |
+
attributes:
|
| 69 |
+
label: Inpaint
|
| 70 |
+
options:
|
| 71 |
+
- opencv-tela
|
| 72 |
+
- patchmatch
|
| 73 |
+
- aot
|
| 74 |
+
- lama_mpe
|
| 75 |
+
- lama_large_512px
|
| 76 |
+
- type: dropdown
|
| 77 |
+
attributes:
|
| 78 |
+
label: 翻译器
|
| 79 |
+
options:
|
| 80 |
+
- Baidu
|
| 81 |
+
- Caiyun
|
| 82 |
+
- ChatGPT
|
| 83 |
+
- ChatGPT_exp
|
| 84 |
+
- DeepL
|
| 85 |
+
- DeepL Free
|
| 86 |
+
- DeepLX API
|
| 87 |
+
- google
|
| 88 |
+
- Papago
|
| 89 |
+
- Sakura
|
| 90 |
+
- type: textarea
|
| 91 |
+
attributes:
|
| 92 |
+
label: 屏幕截图
|
| 93 |
+
description: |
|
| 94 |
+
如果可能,请附上错误时的屏幕截图(可直接拖拽图片)。
|
| 95 |
+
- type: textarea
|
| 96 |
+
attributes:
|
| 97 |
+
label: 日志
|
| 98 |
+
description: |
|
| 99 |
+
请复制粘贴日志内容(内容会自动格式化为代码块)。
|
| 100 |
+
render: shell
|
| 101 |
+
- type: textarea
|
| 102 |
+
attributes:
|
| 103 |
+
label: 其他信息
|
| 104 |
+
description: |
|
| 105 |
+
其他你想提供的信息。
|
.github/ISSUE_TEMPLATE/feature_request_en.yaml
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Feature Request
|
| 2 |
+
title: "Feature Request:" # Default title
|
| 3 |
+
description: Propose new features or optimizations
|
| 4 |
+
labels: [feature]
|
| 5 |
+
body:
|
| 6 |
+
- type: markdown
|
| 7 |
+
attributes:
|
| 8 |
+
value: |
|
| 9 |
+
## Before You Begin
|
| 10 |
+
|
| 11 |
+
🚨 **Please follow these steps before creating an issue** 🚨
|
| 12 |
+
|
| 13 |
+
1. Ensure your repository is up-to-date by running one of the following commands:
|
| 14 |
+
- `.\git\bin\git.exe pull`
|
| 15 |
+
- `.\PortableGit\bin\git.exe pull`
|
| 16 |
+
- `git pull`
|
| 17 |
+
|
| 18 |
+
2. Check if a similar feature request already exists.
|
| 19 |
+
- type: textarea
|
| 20 |
+
validations:
|
| 21 |
+
required: true
|
| 22 |
+
attributes:
|
| 23 |
+
label: Version Info
|
| 24 |
+
description: |
|
| 25 |
+
Please provide the version information of BallonsTranslator. Copy the following details from the console output (if missing, save your project and restart the application):
|
| 26 |
+
- Python version and interpreter path
|
| 27 |
+
- Application version, branch, and Commit Hash
|
| 28 |
+
placeholder: |
|
| 29 |
+
Example:
|
| 30 |
+
py version: 3.10.9 (tags/v3.10.9:...)
|
| 31 |
+
py executable: Path\to\interpreter
|
| 32 |
+
version: 1.4.0
|
| 33 |
+
branch: dev
|
| 34 |
+
Commit hash: 53eee46fd7bef117a4ada9a86843c3bf6e37d953
|
| 35 |
+
- type: dropdown
|
| 36 |
+
validations:
|
| 37 |
+
required: true
|
| 38 |
+
attributes:
|
| 39 |
+
label: Type of Request
|
| 40 |
+
options:
|
| 41 |
+
- New Feature
|
| 42 |
+
- Feature Optimization
|
| 43 |
+
- type: textarea
|
| 44 |
+
validations:
|
| 45 |
+
required: true
|
| 46 |
+
attributes:
|
| 47 |
+
label: Description
|
| 48 |
+
description: |
|
| 49 |
+
Please describe the feature or improvement you would like to see.
|
| 50 |
+
- type: textarea
|
| 51 |
+
attributes:
|
| 52 |
+
label: Pictures
|
| 53 |
+
description: |
|
| 54 |
+
If possible, attach relevant examples or UI screenshots (you can drag and drop the image).
|
| 55 |
+
- type: textarea
|
| 56 |
+
attributes:
|
| 57 |
+
label: Additional Information
|
| 58 |
+
description: |
|
| 59 |
+
Any additional information you would like to provide.
|
.github/ISSUE_TEMPLATE/feature_request_zh.yaml
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: 功能建议
|
| 2 |
+
title: "Feature Request:" # 默认标题
|
| 3 |
+
description: 提出新功能或优化建议
|
| 4 |
+
labels: [feature]
|
| 5 |
+
body:
|
| 6 |
+
- type: markdown
|
| 7 |
+
attributes:
|
| 8 |
+
value: |
|
| 9 |
+
## 在开始之前
|
| 10 |
+
|
| 11 |
+
🚨 **请务必按以下步骤操作** 🚨
|
| 12 |
+
|
| 13 |
+
1. 请确保在提交建议前更新仓库,运行以下任一命令:
|
| 14 |
+
- `.\git\bin\git.exe pull`
|
| 15 |
+
- `.\PortableGit\bin\git.exe pull`
|
| 16 |
+
- `git pull`
|
| 17 |
+
|
| 18 |
+
2. 检查是否已有类似建议存在。
|
| 19 |
+
- type: textarea
|
| 20 |
+
validations:
|
| 21 |
+
required: true
|
| 22 |
+
attributes:
|
| 23 |
+
label: 版本信息
|
| 24 |
+
description: |
|
| 25 |
+
请提供 BallonsTranslator 的版本信息。请复制控制台显示的以下内容(如果信息消失,请保存项目并重启程序):
|
| 26 |
+
- Python 版本及解释器路径
|
| 27 |
+
- 应用版本、分支及 Commit Hash
|
| 28 |
+
placeholder: |
|
| 29 |
+
示例:
|
| 30 |
+
py version: 3.10.9 (tags/v3.10.9:...)
|
| 31 |
+
py executable: 路径\到\解释器
|
| 32 |
+
version: 1.4.0
|
| 33 |
+
branch: dev
|
| 34 |
+
Commit hash: 53eee46fd7bef117a4ada9a86843c3bf6e37d953
|
| 35 |
+
- type: dropdown
|
| 36 |
+
validations:
|
| 37 |
+
required: true
|
| 38 |
+
attributes:
|
| 39 |
+
label: 建议类型
|
| 40 |
+
options:
|
| 41 |
+
- 新功能
|
| 42 |
+
- 功能优化
|
| 43 |
+
- type: textarea
|
| 44 |
+
validations:
|
| 45 |
+
required: true
|
| 46 |
+
attributes:
|
| 47 |
+
label: 描述
|
| 48 |
+
description: |
|
| 49 |
+
请详细描述你希望添加或改进的功能。
|
| 50 |
+
- type: textarea
|
| 51 |
+
attributes:
|
| 52 |
+
label: 图片
|
| 53 |
+
description: |
|
| 54 |
+
如果可能,请附上相关示例或界面截图(可直接拖拽图片)。
|
| 55 |
+
- type: textarea
|
| 56 |
+
attributes:
|
| 57 |
+
label: 其他信息
|
| 58 |
+
description: |
|
| 59 |
+
其他你想提供的信息。
|
.gitignore
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__
|
| 2 |
+
local_*
|
| 3 |
+
inpainted
|
| 4 |
+
mask
|
| 5 |
+
result
|
| 6 |
+
data/models
|
| 7 |
+
data/testpacks/eng_dontupload
|
| 8 |
+
data/testpacks/testpacks
|
| 9 |
+
data/*.png
|
| 10 |
+
data/testpacks
|
| 11 |
+
config/textstyles
|
| 12 |
+
release
|
| 13 |
+
libs
|
| 14 |
+
# icons
|
| 15 |
+
.btrans_cache
|
| 16 |
+
|
| 17 |
+
tmp.py
|
| 18 |
+
dummy_scripts.py
|
| 19 |
+
|
| 20 |
+
alphabet-all-*
|
| 21 |
+
*gitpython
|
| 22 |
+
PortableGit
|
| 23 |
+
test_dir
|
| 24 |
+
tmp
|
| 25 |
+
logs
|
| 26 |
+
ballontrans_pylibs_win
|
| 27 |
+
config/config.json
|
| 28 |
+
localtmp*
|
| 29 |
+
|
| 30 |
+
# .vscode
|
| 31 |
+
.VSCodeCounter
|
| 32 |
+
.idea
|
| 33 |
+
*.zip
|
| 34 |
+
*.ipynb
|
| 35 |
+
*.dll
|
| 36 |
+
*.so
|
| 37 |
+
*.docx
|
| 38 |
+
*.doc
|
| 39 |
+
*.pt
|
| 40 |
+
*.ckpt
|
| 41 |
+
*.onnx
|
| 42 |
+
*.7z
|
| 43 |
+
venv
|
| 44 |
+
pip
|
| 45 |
+
.DS_Store
|
| 46 |
+
*.dic
|
| 47 |
+
*.aff
|
| 48 |
+
*.exc
|
| 49 |
+
|
| 50 |
+
fonts/*
|
| 51 |
+
!fonts/put fonts here.txt
|
| 52 |
+
|
| 53 |
+
#venv and autoinstaller folders
|
| 54 |
+
aria2c
|
| 55 |
+
python
|
| 56 |
+
git
|
| 57 |
+
modules/experiments
|
| 58 |
+
update_git.bat
|
| 59 |
+
launch_win_venv.bat
|
| 60 |
+
install_venv.bat
|
| 61 |
+
install-BT.cmd
|
| 62 |
+
download_models.bat
|
| 63 |
+
Ultralytics/settings.json
|
.vscode/launch.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": "0.2.0",
|
| 3 |
+
"configurations": [
|
| 4 |
+
|
| 5 |
+
{
|
| 6 |
+
"name": "Python Debugger: Current File",
|
| 7 |
+
"type": "debugpy",
|
| 8 |
+
"request": "launch",
|
| 9 |
+
"program": "${file}",
|
| 10 |
+
"console": "integratedTerminal"
|
| 11 |
+
}
|
| 12 |
+
]
|
| 13 |
+
}
|
LICENSE
ADDED
|
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
GNU GENERAL PUBLIC LICENSE
|
| 2 |
+
Version 3, 29 June 2007
|
| 3 |
+
|
| 4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
| 5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 6 |
+
of this license document, but changing it is not allowed.
|
| 7 |
+
|
| 8 |
+
Preamble
|
| 9 |
+
|
| 10 |
+
The GNU General Public License is a free, copyleft license for
|
| 11 |
+
software and other kinds of works.
|
| 12 |
+
|
| 13 |
+
The licenses for most software and other practical works are designed
|
| 14 |
+
to take away your freedom to share and change the works. By contrast,
|
| 15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
| 16 |
+
share and change all versions of a program--to make sure it remains free
|
| 17 |
+
software for all its users. We, the Free Software Foundation, use the
|
| 18 |
+
GNU General Public License for most of our software; it applies also to
|
| 19 |
+
any other work released this way by its authors. You can apply it to
|
| 20 |
+
your programs, too.
|
| 21 |
+
|
| 22 |
+
When we speak of free software, we are referring to freedom, not
|
| 23 |
+
price. Our General Public Licenses are designed to make sure that you
|
| 24 |
+
have the freedom to distribute copies of free software (and charge for
|
| 25 |
+
them if you wish), that you receive source code or can get it if you
|
| 26 |
+
want it, that you can change the software or use pieces of it in new
|
| 27 |
+
free programs, and that you know you can do these things.
|
| 28 |
+
|
| 29 |
+
To protect your rights, we need to prevent others from denying you
|
| 30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
| 31 |
+
certain responsibilities if you distribute copies of the software, or if
|
| 32 |
+
you modify it: responsibilities to respect the freedom of others.
|
| 33 |
+
|
| 34 |
+
For example, if you distribute copies of such a program, whether
|
| 35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
| 36 |
+
freedoms that you received. You must make sure that they, too, receive
|
| 37 |
+
or can get the source code. And you must show them these terms so they
|
| 38 |
+
know their rights.
|
| 39 |
+
|
| 40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
| 41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
| 42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
| 43 |
+
|
| 44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
| 45 |
+
that there is no warranty for this free software. For both users' and
|
| 46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
| 47 |
+
changed, so that their problems will not be attributed erroneously to
|
| 48 |
+
authors of previous versions.
|
| 49 |
+
|
| 50 |
+
Some devices are designed to deny users access to install or run
|
| 51 |
+
modified versions of the software inside them, although the manufacturer
|
| 52 |
+
can do so. This is fundamentally incompatible with the aim of
|
| 53 |
+
protecting users' freedom to change the software. The systematic
|
| 54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
| 55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
| 56 |
+
have designed this version of the GPL to prohibit the practice for those
|
| 57 |
+
products. If such problems arise substantially in other domains, we
|
| 58 |
+
stand ready to extend this provision to those domains in future versions
|
| 59 |
+
of the GPL, as needed to protect the freedom of users.
|
| 60 |
+
|
| 61 |
+
Finally, every program is threatened constantly by software patents.
|
| 62 |
+
States should not allow patents to restrict development and use of
|
| 63 |
+
software on general-purpose computers, but in those that do, we wish to
|
| 64 |
+
avoid the special danger that patents applied to a free program could
|
| 65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
| 66 |
+
patents cannot be used to render the program non-free.
|
| 67 |
+
|
| 68 |
+
The precise terms and conditions for copying, distribution and
|
| 69 |
+
modification follow.
|
| 70 |
+
|
| 71 |
+
TERMS AND CONDITIONS
|
| 72 |
+
|
| 73 |
+
0. Definitions.
|
| 74 |
+
|
| 75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
| 76 |
+
|
| 77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
| 78 |
+
works, such as semiconductor masks.
|
| 79 |
+
|
| 80 |
+
"The Program" refers to any copyrightable work licensed under this
|
| 81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
| 82 |
+
"recipients" may be individuals or organizations.
|
| 83 |
+
|
| 84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
| 85 |
+
in a fashion requiring copyright permission, other than the making of an
|
| 86 |
+
exact copy. The resulting work is called a "modified version" of the
|
| 87 |
+
earlier work or a work "based on" the earlier work.
|
| 88 |
+
|
| 89 |
+
A "covered work" means either the unmodified Program or a work based
|
| 90 |
+
on the Program.
|
| 91 |
+
|
| 92 |
+
To "propagate" a work means to do anything with it that, without
|
| 93 |
+
permission, would make you directly or secondarily liable for
|
| 94 |
+
infringement under applicable copyright law, except executing it on a
|
| 95 |
+
computer or modifying a private copy. Propagation includes copying,
|
| 96 |
+
distribution (with or without modification), making available to the
|
| 97 |
+
public, and in some countries other activities as well.
|
| 98 |
+
|
| 99 |
+
To "convey" a work means any kind of propagation that enables other
|
| 100 |
+
parties to make or receive copies. Mere interaction with a user through
|
| 101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
| 102 |
+
|
| 103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
| 104 |
+
to the extent that it includes a convenient and prominently visible
|
| 105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
| 106 |
+
tells the user that there is no warranty for the work (except to the
|
| 107 |
+
extent that warranties are provided), that licensees may convey the
|
| 108 |
+
work under this License, and how to view a copy of this License. If
|
| 109 |
+
the interface presents a list of user commands or options, such as a
|
| 110 |
+
menu, a prominent item in the list meets this criterion.
|
| 111 |
+
|
| 112 |
+
1. Source Code.
|
| 113 |
+
|
| 114 |
+
The "source code" for a work means the preferred form of the work
|
| 115 |
+
for making modifications to it. "Object code" means any non-source
|
| 116 |
+
form of a work.
|
| 117 |
+
|
| 118 |
+
A "Standard Interface" means an interface that either is an official
|
| 119 |
+
standard defined by a recognized standards body, or, in the case of
|
| 120 |
+
interfaces specified for a particular programming language, one that
|
| 121 |
+
is widely used among developers working in that language.
|
| 122 |
+
|
| 123 |
+
The "System Libraries" of an executable work include anything, other
|
| 124 |
+
than the work as a whole, that (a) is included in the normal form of
|
| 125 |
+
packaging a Major Component, but which is not part of that Major
|
| 126 |
+
Component, and (b) serves only to enable use of the work with that
|
| 127 |
+
Major Component, or to implement a Standard Interface for which an
|
| 128 |
+
implementation is available to the public in source code form. A
|
| 129 |
+
"Major Component", in this context, means a major essential component
|
| 130 |
+
(kernel, window system, and so on) of the specific operating system
|
| 131 |
+
(if any) on which the executable work runs, or a compiler used to
|
| 132 |
+
produce the work, or an object code interpreter used to run it.
|
| 133 |
+
|
| 134 |
+
The "Corresponding Source" for a work in object code form means all
|
| 135 |
+
the source code needed to generate, install, and (for an executable
|
| 136 |
+
work) run the object code and to modify the work, including scripts to
|
| 137 |
+
control those activities. However, it does not include the work's
|
| 138 |
+
System Libraries, or general-purpose tools or generally available free
|
| 139 |
+
programs which are used unmodified in performing those activities but
|
| 140 |
+
which are not part of the work. For example, Corresponding Source
|
| 141 |
+
includes interface definition files associated with source files for
|
| 142 |
+
the work, and the source code for shared libraries and dynamically
|
| 143 |
+
linked subprograms that the work is specifically designed to require,
|
| 144 |
+
such as by intimate data communication or control flow between those
|
| 145 |
+
subprograms and other parts of the work.
|
| 146 |
+
|
| 147 |
+
The Corresponding Source need not include anything that users
|
| 148 |
+
can regenerate automatically from other parts of the Corresponding
|
| 149 |
+
Source.
|
| 150 |
+
|
| 151 |
+
The Corresponding Source for a work in source code form is that
|
| 152 |
+
same work.
|
| 153 |
+
|
| 154 |
+
2. Basic Permissions.
|
| 155 |
+
|
| 156 |
+
All rights granted under this License are granted for the term of
|
| 157 |
+
copyright on the Program, and are irrevocable provided the stated
|
| 158 |
+
conditions are met. This License explicitly affirms your unlimited
|
| 159 |
+
permission to run the unmodified Program. The output from running a
|
| 160 |
+
covered work is covered by this License only if the output, given its
|
| 161 |
+
content, constitutes a covered work. This License acknowledges your
|
| 162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
| 163 |
+
|
| 164 |
+
You may make, run and propagate covered works that you do not
|
| 165 |
+
convey, without conditions so long as your license otherwise remains
|
| 166 |
+
in force. You may convey covered works to others for the sole purpose
|
| 167 |
+
of having them make modifications exclusively for you, or provide you
|
| 168 |
+
with facilities for running those works, provided that you comply with
|
| 169 |
+
the terms of this License in conveying all material for which you do
|
| 170 |
+
not control copyright. Those thus making or running the covered works
|
| 171 |
+
for you must do so exclusively on your behalf, under your direction
|
| 172 |
+
and control, on terms that prohibit them from making any copies of
|
| 173 |
+
your copyrighted material outside their relationship with you.
|
| 174 |
+
|
| 175 |
+
Conveying under any other circumstances is permitted solely under
|
| 176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
| 177 |
+
makes it unnecessary.
|
| 178 |
+
|
| 179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
| 180 |
+
|
| 181 |
+
No covered work shall be deemed part of an effective technological
|
| 182 |
+
measure under any applicable law fulfilling obligations under article
|
| 183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
| 184 |
+
similar laws prohibiting or restricting circumvention of such
|
| 185 |
+
measures.
|
| 186 |
+
|
| 187 |
+
When you convey a covered work, you waive any legal power to forbid
|
| 188 |
+
circumvention of technological measures to the extent such circumvention
|
| 189 |
+
is effected by exercising rights under this License with respect to
|
| 190 |
+
the covered work, and you disclaim any intention to limit operation or
|
| 191 |
+
modification of the work as a means of enforcing, against the work's
|
| 192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
| 193 |
+
technological measures.
|
| 194 |
+
|
| 195 |
+
4. Conveying Verbatim Copies.
|
| 196 |
+
|
| 197 |
+
You may convey verbatim copies of the Program's source code as you
|
| 198 |
+
receive it, in any medium, provided that you conspicuously and
|
| 199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
| 200 |
+
keep intact all notices stating that this License and any
|
| 201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
| 202 |
+
keep intact all notices of the absence of any warranty; and give all
|
| 203 |
+
recipients a copy of this License along with the Program.
|
| 204 |
+
|
| 205 |
+
You may charge any price or no price for each copy that you convey,
|
| 206 |
+
and you may offer support or warranty protection for a fee.
|
| 207 |
+
|
| 208 |
+
5. Conveying Modified Source Versions.
|
| 209 |
+
|
| 210 |
+
You may convey a work based on the Program, or the modifications to
|
| 211 |
+
produce it from the Program, in the form of source code under the
|
| 212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
| 213 |
+
|
| 214 |
+
a) The work must carry prominent notices stating that you modified
|
| 215 |
+
it, and giving a relevant date.
|
| 216 |
+
|
| 217 |
+
b) The work must carry prominent notices stating that it is
|
| 218 |
+
released under this License and any conditions added under section
|
| 219 |
+
7. This requirement modifies the requirement in section 4 to
|
| 220 |
+
"keep intact all notices".
|
| 221 |
+
|
| 222 |
+
c) You must license the entire work, as a whole, under this
|
| 223 |
+
License to anyone who comes into possession of a copy. This
|
| 224 |
+
License will therefore apply, along with any applicable section 7
|
| 225 |
+
additional terms, to the whole of the work, and all its parts,
|
| 226 |
+
regardless of how they are packaged. This License gives no
|
| 227 |
+
permission to license the work in any other way, but it does not
|
| 228 |
+
invalidate such permission if you have separately received it.
|
| 229 |
+
|
| 230 |
+
d) If the work has interactive user interfaces, each must display
|
| 231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
| 232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
| 233 |
+
work need not make them do so.
|
| 234 |
+
|
| 235 |
+
A compilation of a covered work with other separate and independent
|
| 236 |
+
works, which are not by their nature extensions of the covered work,
|
| 237 |
+
and which are not combined with it such as to form a larger program,
|
| 238 |
+
in or on a volume of a storage or distribution medium, is called an
|
| 239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
| 240 |
+
used to limit the access or legal rights of the compilation's users
|
| 241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
| 242 |
+
in an aggregate does not cause this License to apply to the other
|
| 243 |
+
parts of the aggregate.
|
| 244 |
+
|
| 245 |
+
6. Conveying Non-Source Forms.
|
| 246 |
+
|
| 247 |
+
You may convey a covered work in object code form under the terms
|
| 248 |
+
of sections 4 and 5, provided that you also convey the
|
| 249 |
+
machine-readable Corresponding Source under the terms of this License,
|
| 250 |
+
in one of these ways:
|
| 251 |
+
|
| 252 |
+
a) Convey the object code in, or embodied in, a physical product
|
| 253 |
+
(including a physical distribution medium), accompanied by the
|
| 254 |
+
Corresponding Source fixed on a durable physical medium
|
| 255 |
+
customarily used for software interchange.
|
| 256 |
+
|
| 257 |
+
b) Convey the object code in, or embodied in, a physical product
|
| 258 |
+
(including a physical distribution medium), accompanied by a
|
| 259 |
+
written offer, valid for at least three years and valid for as
|
| 260 |
+
long as you offer spare parts or customer support for that product
|
| 261 |
+
model, to give anyone who possesses the object code either (1) a
|
| 262 |
+
copy of the Corresponding Source for all the software in the
|
| 263 |
+
product that is covered by this License, on a durable physical
|
| 264 |
+
medium customarily used for software interchange, for a price no
|
| 265 |
+
more than your reasonable cost of physically performing this
|
| 266 |
+
conveying of source, or (2) access to copy the
|
| 267 |
+
Corresponding Source from a network server at no charge.
|
| 268 |
+
|
| 269 |
+
c) Convey individual copies of the object code with a copy of the
|
| 270 |
+
written offer to provide the Corresponding Source. This
|
| 271 |
+
alternative is allowed only occasionally and noncommercially, and
|
| 272 |
+
only if you received the object code with such an offer, in accord
|
| 273 |
+
with subsection 6b.
|
| 274 |
+
|
| 275 |
+
d) Convey the object code by offering access from a designated
|
| 276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
| 277 |
+
Corresponding Source in the same way through the same place at no
|
| 278 |
+
further charge. You need not require recipients to copy the
|
| 279 |
+
Corresponding Source along with the object code. If the place to
|
| 280 |
+
copy the object code is a network server, the Corresponding Source
|
| 281 |
+
may be on a different server (operated by you or a third party)
|
| 282 |
+
that supports equivalent copying facilities, provided you maintain
|
| 283 |
+
clear directions next to the object code saying where to find the
|
| 284 |
+
Corresponding Source. Regardless of what server hosts the
|
| 285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
| 286 |
+
available for as long as needed to satisfy these requirements.
|
| 287 |
+
|
| 288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
| 289 |
+
you inform other peers where the object code and Corresponding
|
| 290 |
+
Source of the work are being offered to the general public at no
|
| 291 |
+
charge under subsection 6d.
|
| 292 |
+
|
| 293 |
+
A separable portion of the object code, whose source code is excluded
|
| 294 |
+
from the Corresponding Source as a System Library, need not be
|
| 295 |
+
included in conveying the object code work.
|
| 296 |
+
|
| 297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
| 298 |
+
tangible personal property which is normally used for personal, family,
|
| 299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
| 300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
| 301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
| 302 |
+
product received by a particular user, "normally used" refers to a
|
| 303 |
+
typical or common use of that class of product, regardless of the status
|
| 304 |
+
of the particular user or of the way in which the particular user
|
| 305 |
+
actually uses, or expects or is expected to use, the product. A product
|
| 306 |
+
is a consumer product regardless of whether the product has substantial
|
| 307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
| 308 |
+
the only significant mode of use of the product.
|
| 309 |
+
|
| 310 |
+
"Installation Information" for a User Product means any methods,
|
| 311 |
+
procedures, authorization keys, or other information required to install
|
| 312 |
+
and execute modified versions of a covered work in that User Product from
|
| 313 |
+
a modified version of its Corresponding Source. The information must
|
| 314 |
+
suffice to ensure that the continued functioning of the modified object
|
| 315 |
+
code is in no case prevented or interfered with solely because
|
| 316 |
+
modification has been made.
|
| 317 |
+
|
| 318 |
+
If you convey an object code work under this section in, or with, or
|
| 319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
| 320 |
+
part of a transaction in which the right of possession and use of the
|
| 321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
| 322 |
+
fixed term (regardless of how the transaction is characterized), the
|
| 323 |
+
Corresponding Source conveyed under this section must be accompanied
|
| 324 |
+
by the Installation Information. But this requirement does not apply
|
| 325 |
+
if neither you nor any third party retains the ability to install
|
| 326 |
+
modified object code on the User Product (for example, the work has
|
| 327 |
+
been installed in ROM).
|
| 328 |
+
|
| 329 |
+
The requirement to provide Installation Information does not include a
|
| 330 |
+
requirement to continue to provide support service, warranty, or updates
|
| 331 |
+
for a work that has been modified or installed by the recipient, or for
|
| 332 |
+
the User Product in which it has been modified or installed. Access to a
|
| 333 |
+
network may be denied when the modification itself materially and
|
| 334 |
+
adversely affects the operation of the network or violates the rules and
|
| 335 |
+
protocols for communication across the network.
|
| 336 |
+
|
| 337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
| 338 |
+
in accord with this section must be in a format that is publicly
|
| 339 |
+
documented (and with an implementation available to the public in
|
| 340 |
+
source code form), and must require no special password or key for
|
| 341 |
+
unpacking, reading or copying.
|
| 342 |
+
|
| 343 |
+
7. Additional Terms.
|
| 344 |
+
|
| 345 |
+
"Additional permissions" are terms that supplement the terms of this
|
| 346 |
+
License by making exceptions from one or more of its conditions.
|
| 347 |
+
Additional permissions that are applicable to the entire Program shall
|
| 348 |
+
be treated as though they were included in this License, to the extent
|
| 349 |
+
that they are valid under applicable law. If additional permissions
|
| 350 |
+
apply only to part of the Program, that part may be used separately
|
| 351 |
+
under those permissions, but the entire Program remains governed by
|
| 352 |
+
this License without regard to the additional permissions.
|
| 353 |
+
|
| 354 |
+
When you convey a copy of a covered work, you may at your option
|
| 355 |
+
remove any additional permissions from that copy, or from any part of
|
| 356 |
+
it. (Additional permissions may be written to require their own
|
| 357 |
+
removal in certain cases when you modify the work.) You may place
|
| 358 |
+
additional permissions on material, added by you to a covered work,
|
| 359 |
+
for which you have or can give appropriate copyright permission.
|
| 360 |
+
|
| 361 |
+
Notwithstanding any other provision of this License, for material you
|
| 362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
| 363 |
+
that material) supplement the terms of this License with terms:
|
| 364 |
+
|
| 365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
| 366 |
+
terms of sections 15 and 16 of this License; or
|
| 367 |
+
|
| 368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
| 369 |
+
author attributions in that material or in the Appropriate Legal
|
| 370 |
+
Notices displayed by works containing it; or
|
| 371 |
+
|
| 372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
| 373 |
+
requiring that modified versions of such material be marked in
|
| 374 |
+
reasonable ways as different from the original version; or
|
| 375 |
+
|
| 376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
| 377 |
+
authors of the material; or
|
| 378 |
+
|
| 379 |
+
e) Declining to grant rights under trademark law for use of some
|
| 380 |
+
trade names, trademarks, or service marks; or
|
| 381 |
+
|
| 382 |
+
f) Requiring indemnification of licensors and authors of that
|
| 383 |
+
material by anyone who conveys the material (or modified versions of
|
| 384 |
+
it) with contractual assumptions of liability to the recipient, for
|
| 385 |
+
any liability that these contractual assumptions directly impose on
|
| 386 |
+
those licensors and authors.
|
| 387 |
+
|
| 388 |
+
All other non-permissive additional terms are considered "further
|
| 389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
| 390 |
+
received it, or any part of it, contains a notice stating that it is
|
| 391 |
+
governed by this License along with a term that is a further
|
| 392 |
+
restriction, you may remove that term. If a license document contains
|
| 393 |
+
a further restriction but permits relicensing or conveying under this
|
| 394 |
+
License, you may add to a covered work material governed by the terms
|
| 395 |
+
of that license document, provided that the further restriction does
|
| 396 |
+
not survive such relicensing or conveying.
|
| 397 |
+
|
| 398 |
+
If you add terms to a covered work in accord with this section, you
|
| 399 |
+
must place, in the relevant source files, a statement of the
|
| 400 |
+
additional terms that apply to those files, or a notice indicating
|
| 401 |
+
where to find the applicable terms.
|
| 402 |
+
|
| 403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
| 404 |
+
form of a separately written license, or stated as exceptions;
|
| 405 |
+
the above requirements apply either way.
|
| 406 |
+
|
| 407 |
+
8. Termination.
|
| 408 |
+
|
| 409 |
+
You may not propagate or modify a covered work except as expressly
|
| 410 |
+
provided under this License. Any attempt otherwise to propagate or
|
| 411 |
+
modify it is void, and will automatically terminate your rights under
|
| 412 |
+
this License (including any patent licenses granted under the third
|
| 413 |
+
paragraph of section 11).
|
| 414 |
+
|
| 415 |
+
However, if you cease all violation of this License, then your
|
| 416 |
+
license from a particular copyright holder is reinstated (a)
|
| 417 |
+
provisionally, unless and until the copyright holder explicitly and
|
| 418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
| 419 |
+
holder fails to notify you of the violation by some reasonable means
|
| 420 |
+
prior to 60 days after the cessation.
|
| 421 |
+
|
| 422 |
+
Moreover, your license from a particular copyright holder is
|
| 423 |
+
reinstated permanently if the copyright holder notifies you of the
|
| 424 |
+
violation by some reasonable means, this is the first time you have
|
| 425 |
+
received notice of violation of this License (for any work) from that
|
| 426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
| 427 |
+
your receipt of the notice.
|
| 428 |
+
|
| 429 |
+
Termination of your rights under this section does not terminate the
|
| 430 |
+
licenses of parties who have received copies or rights from you under
|
| 431 |
+
this License. If your rights have been terminated and not permanently
|
| 432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
| 433 |
+
material under section 10.
|
| 434 |
+
|
| 435 |
+
9. Acceptance Not Required for Having Copies.
|
| 436 |
+
|
| 437 |
+
You are not required to accept this License in order to receive or
|
| 438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
| 439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
| 440 |
+
to receive a copy likewise does not require acceptance. However,
|
| 441 |
+
nothing other than this License grants you permission to propagate or
|
| 442 |
+
modify any covered work. These actions infringe copyright if you do
|
| 443 |
+
not accept this License. Therefore, by modifying or propagating a
|
| 444 |
+
covered work, you indicate your acceptance of this License to do so.
|
| 445 |
+
|
| 446 |
+
10. Automatic Licensing of Downstream Recipients.
|
| 447 |
+
|
| 448 |
+
Each time you convey a covered work, the recipient automatically
|
| 449 |
+
receives a license from the original licensors, to run, modify and
|
| 450 |
+
propagate that work, subject to this License. You are not responsible
|
| 451 |
+
for enforcing compliance by third parties with this License.
|
| 452 |
+
|
| 453 |
+
An "entity transaction" is a transaction transferring control of an
|
| 454 |
+
organization, or substantially all assets of one, or subdividing an
|
| 455 |
+
organization, or merging organizations. If propagation of a covered
|
| 456 |
+
work results from an entity transaction, each party to that
|
| 457 |
+
transaction who receives a copy of the work also receives whatever
|
| 458 |
+
licenses to the work the party's predecessor in interest had or could
|
| 459 |
+
give under the previous paragraph, plus a right to possession of the
|
| 460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
| 461 |
+
the predecessor has it or can get it with reasonable efforts.
|
| 462 |
+
|
| 463 |
+
You may not impose any further restrictions on the exercise of the
|
| 464 |
+
rights granted or affirmed under this License. For example, you may
|
| 465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
| 466 |
+
rights granted under this License, and you may not initiate litigation
|
| 467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
| 468 |
+
any patent claim is infringed by making, using, selling, offering for
|
| 469 |
+
sale, or importing the Program or any portion of it.
|
| 470 |
+
|
| 471 |
+
11. Patents.
|
| 472 |
+
|
| 473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
| 474 |
+
License of the Program or a work on which the Program is based. The
|
| 475 |
+
work thus licensed is called the contributor's "contributor version".
|
| 476 |
+
|
| 477 |
+
A contributor's "essential patent claims" are all patent claims
|
| 478 |
+
owned or controlled by the contributor, whether already acquired or
|
| 479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
| 480 |
+
by this License, of making, using, or selling its contributor version,
|
| 481 |
+
but do not include claims that would be infringed only as a
|
| 482 |
+
consequence of further modification of the contributor version. For
|
| 483 |
+
purposes of this definition, "control" includes the right to grant
|
| 484 |
+
patent sublicenses in a manner consistent with the requirements of
|
| 485 |
+
this License.
|
| 486 |
+
|
| 487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
| 488 |
+
patent license under the contributor's essential patent claims, to
|
| 489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
| 490 |
+
propagate the contents of its contributor version.
|
| 491 |
+
|
| 492 |
+
In the following three paragraphs, a "patent license" is any express
|
| 493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
| 494 |
+
(such as an express permission to practice a patent or covenant not to
|
| 495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
| 496 |
+
party means to make such an agreement or commitment not to enforce a
|
| 497 |
+
patent against the party.
|
| 498 |
+
|
| 499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
| 500 |
+
and the Corresponding Source of the work is not available for anyone
|
| 501 |
+
to copy, free of charge and under the terms of this License, through a
|
| 502 |
+
publicly available network server or other readily accessible means,
|
| 503 |
+
then you must either (1) cause the Corresponding Source to be so
|
| 504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
| 505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
| 506 |
+
consistent with the requirements of this License, to extend the patent
|
| 507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
| 508 |
+
actual knowledge that, but for the patent license, your conveying the
|
| 509 |
+
covered work in a country, or your recipient's use of the covered work
|
| 510 |
+
in a country, would infringe one or more identifiable patents in that
|
| 511 |
+
country that you have reason to believe are valid.
|
| 512 |
+
|
| 513 |
+
If, pursuant to or in connection with a single transaction or
|
| 514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
| 515 |
+
covered work, and grant a patent license to some of the parties
|
| 516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
| 517 |
+
or convey a specific copy of the covered work, then the patent license
|
| 518 |
+
you grant is automatically extended to all recipients of the covered
|
| 519 |
+
work and works based on it.
|
| 520 |
+
|
| 521 |
+
A patent license is "discriminatory" if it does not include within
|
| 522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
| 523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
| 524 |
+
specifically granted under this License. You may not convey a covered
|
| 525 |
+
work if you are a party to an arrangement with a third party that is
|
| 526 |
+
in the business of distributing software, under which you make payment
|
| 527 |
+
to the third party based on the extent of your activity of conveying
|
| 528 |
+
the work, and under which the third party grants, to any of the
|
| 529 |
+
parties who would receive the covered work from you, a discriminatory
|
| 530 |
+
patent license (a) in connection with copies of the covered work
|
| 531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
| 532 |
+
for and in connection with specific products or compilations that
|
| 533 |
+
contain the covered work, unless you entered into that arrangement,
|
| 534 |
+
or that patent license was granted, prior to 28 March 2007.
|
| 535 |
+
|
| 536 |
+
Nothing in this License shall be construed as excluding or limiting
|
| 537 |
+
any implied license or other defenses to infringement that may
|
| 538 |
+
otherwise be available to you under applicable patent law.
|
| 539 |
+
|
| 540 |
+
12. No Surrender of Others' Freedom.
|
| 541 |
+
|
| 542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
| 543 |
+
otherwise) that contradict the conditions of this License, they do not
|
| 544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
| 545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
| 546 |
+
License and any other pertinent obligations, then as a consequence you may
|
| 547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
| 548 |
+
to collect a royalty for further conveying from those to whom you convey
|
| 549 |
+
the Program, the only way you could satisfy both those terms and this
|
| 550 |
+
License would be to refrain entirely from conveying the Program.
|
| 551 |
+
|
| 552 |
+
13. Use with the GNU Affero General Public License.
|
| 553 |
+
|
| 554 |
+
Notwithstanding any other provision of this License, you have
|
| 555 |
+
permission to link or combine any covered work with a work licensed
|
| 556 |
+
under version 3 of the GNU Affero General Public License into a single
|
| 557 |
+
combined work, and to convey the resulting work. The terms of this
|
| 558 |
+
License will continue to apply to the part which is the covered work,
|
| 559 |
+
but the special requirements of the GNU Affero General Public License,
|
| 560 |
+
section 13, concerning interaction through a network will apply to the
|
| 561 |
+
combination as such.
|
| 562 |
+
|
| 563 |
+
14. Revised Versions of this License.
|
| 564 |
+
|
| 565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
| 566 |
+
the GNU General Public License from time to time. Such new versions will
|
| 567 |
+
be similar in spirit to the present version, but may differ in detail to
|
| 568 |
+
address new problems or concerns.
|
| 569 |
+
|
| 570 |
+
Each version is given a distinguishing version number. If the
|
| 571 |
+
Program specifies that a certain numbered version of the GNU General
|
| 572 |
+
Public License "or any later version" applies to it, you have the
|
| 573 |
+
option of following the terms and conditions either of that numbered
|
| 574 |
+
version or of any later version published by the Free Software
|
| 575 |
+
Foundation. If the Program does not specify a version number of the
|
| 576 |
+
GNU General Public License, you may choose any version ever published
|
| 577 |
+
by the Free Software Foundation.
|
| 578 |
+
|
| 579 |
+
If the Program specifies that a proxy can decide which future
|
| 580 |
+
versions of the GNU General Public License can be used, that proxy's
|
| 581 |
+
public statement of acceptance of a version permanently authorizes you
|
| 582 |
+
to choose that version for the Program.
|
| 583 |
+
|
| 584 |
+
Later license versions may give you additional or different
|
| 585 |
+
permissions. However, no additional obligations are imposed on any
|
| 586 |
+
author or copyright holder as a result of your choosing to follow a
|
| 587 |
+
later version.
|
| 588 |
+
|
| 589 |
+
15. Disclaimer of Warranty.
|
| 590 |
+
|
| 591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
| 592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
| 593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
| 594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
| 595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
| 597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
| 598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 599 |
+
|
| 600 |
+
16. Limitation of Liability.
|
| 601 |
+
|
| 602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
| 604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
| 605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
| 606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
| 607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
| 608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
| 609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 610 |
+
SUCH DAMAGES.
|
| 611 |
+
|
| 612 |
+
17. Interpretation of Sections 15 and 16.
|
| 613 |
+
|
| 614 |
+
If the disclaimer of warranty and limitation of liability provided
|
| 615 |
+
above cannot be given local legal effect according to their terms,
|
| 616 |
+
reviewing courts shall apply local law that most closely approximates
|
| 617 |
+
an absolute waiver of all civil liability in connection with the
|
| 618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
| 619 |
+
copy of the Program in return for a fee.
|
| 620 |
+
|
| 621 |
+
END OF TERMS AND CONDITIONS
|
| 622 |
+
|
| 623 |
+
How to Apply These Terms to Your New Programs
|
| 624 |
+
|
| 625 |
+
If you develop a new program, and you want it to be of the greatest
|
| 626 |
+
possible use to the public, the best way to achieve this is to make it
|
| 627 |
+
free software which everyone can redistribute and change under these terms.
|
| 628 |
+
|
| 629 |
+
To do so, attach the following notices to the program. It is safest
|
| 630 |
+
to attach them to the start of each source file to most effectively
|
| 631 |
+
state the exclusion of warranty; and each file should have at least
|
| 632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
| 633 |
+
|
| 634 |
+
<one line to give the program's name and a brief idea of what it does.>
|
| 635 |
+
Copyright (C) <year> <name of author>
|
| 636 |
+
|
| 637 |
+
This program is free software: you can redistribute it and/or modify
|
| 638 |
+
it under the terms of the GNU General Public License as published by
|
| 639 |
+
the Free Software Foundation, either version 3 of the License, or
|
| 640 |
+
(at your option) any later version.
|
| 641 |
+
|
| 642 |
+
This program is distributed in the hope that it will be useful,
|
| 643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 645 |
+
GNU General Public License for more details.
|
| 646 |
+
|
| 647 |
+
You should have received a copy of the GNU General Public License
|
| 648 |
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
| 649 |
+
|
| 650 |
+
Also add information on how to contact you by electronic and paper mail.
|
| 651 |
+
|
| 652 |
+
If the program does terminal interaction, make it output a short
|
| 653 |
+
notice like this when it starts in an interactive mode:
|
| 654 |
+
|
| 655 |
+
<program> Copyright (C) <year> <name of author>
|
| 656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
| 657 |
+
This is free software, and you are welcome to redistribute it
|
| 658 |
+
under certain conditions; type `show c' for details.
|
| 659 |
+
|
| 660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
| 661 |
+
parts of the General Public License. Of course, your program's commands
|
| 662 |
+
might be different; for a GUI interface, you would use an "about box".
|
| 663 |
+
|
| 664 |
+
You should also get your employer (if you work as a programmer) or school,
|
| 665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
| 666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
| 667 |
+
<https://www.gnu.org/licenses/>.
|
| 668 |
+
|
| 669 |
+
The GNU General Public License does not permit incorporating your program
|
| 670 |
+
into proprietary programs. If your program is a subroutine library, you
|
| 671 |
+
may consider it more useful to permit linking proprietary applications with
|
| 672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
| 673 |
+
Public License instead of this License. But first, please read
|
| 674 |
+
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
README.md
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
> [!IMPORTANT]
|
| 2 |
+
> **如打算公开分享本工具的机翻结果,且没有有经验的译者进行过完整的翻译或校对,请在显眼位置注明机翻。**
|
| 3 |
+
|
| 4 |
+
# BallonTranslator
|
| 5 |
+
简体中文 | [English](/README_EN.md) | [pt-BR](doc/README_PT-BR.md) | [Русский](doc/README_RU.md) | [日本語](doc/README_JA.md) | [Indonesia](doc/README_ID.md) | [Tiếng Việt](doc/README_VI.md) | [한국어](doc/README_KO.md) | [Español](doc/README_ES.md) | [Français](doc/README_FR.md)
|
| 6 |
+
|
| 7 |
+
深度学习辅助漫画翻译工具,支持一键机翻和简单的图像/文本编辑
|
| 8 |
+
|
| 9 |
+
<img src="doc/src/ui0.jpg" div align=center>
|
| 10 |
+
|
| 11 |
+
<p align=center>
|
| 12 |
+
界面预览
|
| 13 |
+
</p>
|
| 14 |
+
|
| 15 |
+
# Features
|
| 16 |
+
* 一键机翻
|
| 17 |
+
- 译文回填参考对原文排版的估计,包括颜色,轮廓,角度,朝向,对齐方式等
|
| 18 |
+
- 最后效果取决于文本检测,识别,抹字,机翻四个模块的整体表现
|
| 19 |
+
- 支持日漫和美漫
|
| 20 |
+
- 英译中,日译英排版已优化,文本布局以提取到的背景泡为参考,中文基于 pkuseg 进行断句,日译中竖排待改善
|
| 21 |
+
|
| 22 |
+
* 图像编辑
|
| 23 |
+
支持掩膜编辑和修复画笔
|
| 24 |
+
|
| 25 |
+
* 文本编辑
|
| 26 |
+
- 支持所见即所得地富文本编辑和一些基础排版格式调整、[字体样式预设](https://github.com/dmMaze/BallonsTranslator/pull/311)
|
| 27 |
+
- 支持全文/原文/译文查找替换
|
| 28 |
+
- 支持导入导出 word 文档
|
| 29 |
+
|
| 30 |
+
* 适用于条漫
|
| 31 |
+
|
| 32 |
+
# 使用说明
|
| 33 |
+
|
| 34 |
+
## Windows
|
| 35 |
+
如果用 Windows 而且不想自己手动配置环境,而且能正常访问互联网:
|
| 36 |
+
从 [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) 或 [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) 下载 BallonsTranslator_dev_src_with_gitpython.7z,解压并运行 launch_win.bat 启动程序。如果无法自动下载库和模型,手动下载 data 和 ballontrans_pylibs_win.7z 并解压到程序目录下。
|
| 37 |
+
运行 scripts/local_gitpull.bat 获取更新。
|
| 38 |
+
注意这些打包版无法在 Windows 7 上运行,win 7 用户需要自行安装 [Python 3.8](https://www.python.org/downloads/release/python-3810/) 运行源码。
|
| 39 |
+
|
| 40 |
+
## 运行源码
|
| 41 |
+
|
| 42 |
+
安装 [Python](https://www.python.org/downloads/release/python-31011) **<= 3.12** (别用微软应用商店版) 和 [Git](https://git-scm.com/downloads)
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
# 克隆仓库
|
| 46 |
+
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
|
| 47 |
+
|
| 48 |
+
# 启动程序
|
| 49 |
+
$ python3 launch.py
|
| 50 |
+
|
| 51 |
+
# 更新程序
|
| 52 |
+
python3 launch.py --update
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
第一次运行会自动安装 torch 等依赖项并下载所需模型和文件,如果模型下载失败,需要手动从 [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) 或 [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) 下载 data 文件夹(或者报错里提到缺失的文件),并保存到源码目录下的对应位置。
|
| 56 |
+
|
| 57 |
+
## 构建 macOS 应用(适用 apple silicon 芯片)
|
| 58 |
+
[参考](doc/macOS_app_CN.md)
|
| 59 |
+
可能会有各种问题,目前还是推荐跑源码
|
| 60 |
+
|
| 61 |
+
## 一键翻译
|
| 62 |
+
**建议在命令行终端下运行程序**,首次运行请先配置好源语言/目标语言,打开一个带图片的文件夹,点击 Run 等待翻译完成
|
| 63 |
+
<img src="doc/src/run.gif">
|
| 64 |
+
|
| 65 |
+
一键机翻嵌字格式如大小、颜色等默认是由程序决定的,可以在设置面板->嵌字菜单中改用全局设置。全局字体格式就是未编辑任何文本块时右侧字体面板显示的格式:
|
| 66 |
+
<img src="doc/src/global_font_format.png">
|
| 67 |
+
|
| 68 |
+
## 画板
|
| 69 |
+
|
| 70 |
+
## 修复画笔
|
| 71 |
+
<img src="doc/src/imgedit_inpaint.gif">
|
| 72 |
+
<p align = "center">
|
| 73 |
+
修复画笔
|
| 74 |
+
</p>
|
| 75 |
+
|
| 76 |
+
### 矩形工具
|
| 77 |
+
<img src="doc/src/rect_tool.gif">
|
| 78 |
+
<p align = "center">
|
| 79 |
+
矩形工具
|
| 80 |
+
</p>
|
| 81 |
+
|
| 82 |
+
按下鼠标左键拖动矩形框抹除框内文字,按下右键拉框清除框内修复结果。
|
| 83 |
+
抹除结果取决于算法(gif 中的"方法1"和"方法2")对文字区域估算的准确程度,一般拉的框最好稍大于需要抹除的文本块。两种方法都比较玄学,能够应付绝大多数简单文字简单背景,部分复杂背景简单文字/简单背景复杂文字,少数复杂背景复杂文字,可以多拉几次试试。
|
| 84 |
+
勾选"自动"拉完框立即修复,否则需要按下"修复"或者空格键才进行修复,或 ```Ctrl+D``` 删除矩形选框。
|
| 85 |
+
|
| 86 |
+
## 文本编辑
|
| 87 |
+
<img src="doc/src/textedit.gif">
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
<p align = "center">
|
| 91 |
+
文本编辑
|
| 92 |
+
</p>
|
| 93 |
+
|
| 94 |
+
<img src="doc/src/multisel_autolayout.gif" div align=center>
|
| 95 |
+
<p align=center>
|
| 96 |
+
批量文本格式调整及自动排版
|
| 97 |
+
</p>
|
| 98 |
+
|
| 99 |
+
<img src="doc/src/ocrselected.gif" div align=center>
|
| 100 |
+
<p align=center>
|
| 101 |
+
OCR并翻译选中文本框
|
| 102 |
+
</p>
|
| 103 |
+
|
| 104 |
+
## 界面说明及快捷键
|
| 105 |
+
* Ctrl+Z,Ctrl+Y 可以撤销重做大部分操作,注意翻页后撤消重做栈会清空
|
| 106 |
+
* A/D 或 pageUp/Down 翻页,如果当前页面未保存会自动保存
|
| 107 |
+
* T 切换到文本编辑模式下(底部最右"T"图标),W激活文本块创建模式后在画布右键拉文本框
|
| 108 |
+
* P 切换到画板模式,右下角滑条改原��透明度
|
| 109 |
+
* 标题栏->运行 可以启用/禁用任意自动化模块,全部禁用后Run会根据全局字体样式和嵌字设置重新渲染文本
|
| 110 |
+
* 设置面板配置各自动化模块参数
|
| 111 |
+
* Ctrl++/- 或滚轮缩放画布
|
| 112 |
+
* Ctrl+A 可选中界面中所有文本块
|
| 113 |
+
* Ctrl+F 查找当前页,Ctrl+G全局查找
|
| 114 |
+
* 0-9调整嵌字/原图透明度
|
| 115 |
+
* 文本编辑下 ```Ctrl+B``` 加粗,```Ctrl+U``` 下划线,```Ctrl+I``` 斜体
|
| 116 |
+
* 字体样式面板-"特效"修改透明度添加阴影
|
| 117 |
+
* ```Alt+Arrow Keys``` 或 ```Alt+WASD``` (正在编辑文本块时 ```pageDown``` 或 ```pageUp```) 在文本块间切换
|
| 118 |
+
|
| 119 |
+
<img src="doc/src/configpanel.png">
|
| 120 |
+
|
| 121 |
+
## 命令行模式 (无GUI)
|
| 122 |
+
``` python
|
| 123 |
+
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
|
| 124 |
+
```
|
| 125 |
+
所有设置 (如检测模型, 原语言目标语言等) 会从 config/config.json 导入。
|
| 126 |
+
如果渲染字体大小不对, 通过 ```--ldpi ``` 指定 Logical DPI 大小, 通常为 96 和 72。
|
| 127 |
+
|
| 128 |
+
# 自动化模块
|
| 129 |
+
本项目重度依赖 [manga-image-translator](https://github.com/zyddnys/manga-image-translator),在线服务器和模型训练需要费用,有条件请考虑支持一下
|
| 130 |
+
- Ko-fi: <https://ko-fi.com/voilelabs>
|
| 131 |
+
- Patreon: <https://www.patreon.com/voilelabs>
|
| 132 |
+
- 爱发电: <https://afdian.net/@voilelabs>
|
| 133 |
+
|
| 134 |
+
Sugoi 翻译器作者: [mingshiba](https://www.patreon.com/mingshiba)
|
| 135 |
+
|
| 136 |
+
### 文本检测
|
| 137 |
+
* 暂时仅支持日文(方块字都差不多)和英文检测,训练代码和说明见https://github.com/dmMaze/comic-text-detector
|
| 138 |
+
* 支持使用 [星河云(团子漫画OCR)](https://cloud.stariver.org.cn/)的文本检测,需要填写用户名和密码,每次启动时会自动登录。
|
| 139 |
+
* 详细说明见 [团子OCR说明](doc/团子OCR说明.md)
|
| 140 |
+
* `YSGDetector` 是由 [lhj5426](https://github.com/lhj5426) 训练的模型,能更好地过滤日漫/CG里的拟声词。需要手动从 [YSGYoloDetector](https://huggingface.co/YSGforMTL/YSGYoloDetector) 下载模型放到 data/models 目录下。
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
### OCR
|
| 144 |
+
* 所有 mit 模型来自 manga-image-translator,支持日英汉识别和颜色提取
|
| 145 |
+
* [manga_ocr](https://github.com/kha-white/manga-ocr) 来自 [kha-white](https://github.com/kha-white),支持日语识别,注意选用该模型程序不会提取颜色
|
| 146 |
+
* 支持使用 [星河云(团子漫画OCR)](https://cloud.stariver.org.cn/)的OCR,需要填写用户名和密码,每次启动时会自动登录。
|
| 147 |
+
* 目前的实现方案是逐个textblock进行OCR,速度较慢,准确度没有明显提升,不推荐使用。如果有需要,请使用团子Detector。
|
| 148 |
+
* 推荐文本检测设置为团子Detector时,将OCR设为none_ocr,直接读取文本,节省时间和请求次数。
|
| 149 |
+
* 详细说明见 [团子OCR说明](doc/团子OCR说明.md)
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
### 图像修复
|
| 153 |
+
* AOT 修复模型来自 manga-image-translator
|
| 154 |
+
* patchmatch 是非深度学习算法,也是PS修复画笔背后的算法,实现来自 [PyPatchMatch](https://github.com/vacancy/PyPatchMatch),本程序用的是我的[修改版](https://github.com/dmMaze/PyPatchMatchInpaint)
|
| 155 |
+
* lama* 是微调过的[lama](https://github.com/advimman/lama)
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
### 翻译器
|
| 159 |
+
|
| 160 |
+
* 谷歌翻译器已经关闭中国服务,大陆再用需要设置全局代理,并在设置面板把 url 换成*.com
|
| 161 |
+
* 彩云,需要申请 [token](https://dashboard.caiyunapp.com/)
|
| 162 |
+
* papago
|
| 163 |
+
* DeepL 和 Sugoi (及它的 CT2 Translation 转换)翻译器,感谢 [Snowad14](https://github.com/Snowad14),如果要使用Sugoi翻译器(仅日译英),下载[离线模型](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm),将 ```sugoi_translator``` 移入 BallonsTranslator/ballontranslator/data/models。
|
| 164 |
+
* 支持 [Sakura-13B-Galgame](https://github.com/SakuraLLM/Sakura-13B-Galgame)。如果在本地单卡上运行且显存不足,可以在设置面板里勾选 ```low vram mode``` (默认启用)。
|
| 165 |
+
* DeepLX 请参考[Vercel](https://github.com/bropines/Deeplx-vercel) 或 [deeplx](https://github.com/OwO-Network/DeepLX)
|
| 166 |
+
* 支持两个版本的 OpenAI 兼容翻译器,支持兼容 OpenAI API 的官方或第三方LLM提供商,需要在设置面板里配置。
|
| 167 |
+
* 无后缀版本token消耗更小,但分句稳定性稍差,长文本翻译可能有问题。
|
| 168 |
+
* exp后缀版本token消耗更大,但稳定性更好,且在Prompt中进行了“越狱”,适合长文本翻译。
|
| 169 |
+
* [m2m100](https://huggingface.co/facebook/m2m100_1.2B): 下载并将 m2m100-1.2B-ctranslate2 移到 data/models 目录下
|
| 170 |
+
|
| 171 |
+
其它优秀的离线英文翻译模型请参考[这条讨论](https://github.com/dmMaze/BallonsTranslator/discussions/515)
|
| 172 |
+
如需添加新的翻译器请参考[加别的翻译器](doc/加别的翻译器.md),本程序添加新翻译器只需要继承基类实现两个接口即可不需要理会代码其他部分,欢迎大佬提 pr
|
| 173 |
+
|
| 174 |
+
## 杂
|
| 175 |
+
* 电脑带 Nvidia 显卡或 Apple silicon 默认启用 GPU 加速
|
| 176 |
+
* 感谢 [bropines](https://github.com/bropines) 提供俄语翻译
|
| 177 |
+
* 第三方输入法可能会造成右侧编辑框���示 bug,见[#76](https://github.com/dmMaze/BallonsTranslator/issues/76),暂时不打算修
|
| 178 |
+
* 选中文本迷你菜单支持*聚合词典专业划词翻译*[沙拉查词](https://saladict.crimx.com): [安装说明](doc/saladict_chs.md)
|
| 179 |
+
<details>
|
| 180 |
+
<summary><i>启用 AMD ROCm 显卡加速方法</i></summary>
|
| 181 |
+
|
| 182 |
+
### 通用方案 ZLUDA (ROCm6)
|
| 183 |
+
|
| 184 |
+
**优点:**
|
| 185 |
+
文本和文本框识别速度比社区预览版快,当然比 CPU 更快
|
| 186 |
+
|
| 187 |
+
**缺点:**
|
| 188 |
+
需要额外安装并进行相关配置才可工作,首次启动以及更换识别模型和驱动都需要长时间预热缓存
|
| 189 |
+
|
| 190 |
+
**安装步骤:**
|
| 191 |
+
|
| 192 |
+
1. 更新显卡驱动至最新版 (建议 24.12.1 及以上,下载并安装 [AMD HIP SDK 6.2](https://www.amd.com/en/developer/resources/rocm-hub/hip-sdk.html) )
|
| 193 |
+
2. 下载 [ZLUDA](https://github.com/lshqqytiger/ZLUDA/releases)(ROCm6版本)并解压到 zluda 文件夹内,复制 zluda 文件夹到系统盘下: 比如c盘 (C:\zluda)
|
| 194 |
+
3. 配置系统环境变量,以 windows 10 系统为例:设置 - 系统属性 - 高级系统设置 - 环境变量 - 系统变量 - 找到 path 变量,点击编辑,在最后添加 `C:\zluda` 和 `%HIP_PATH_62%bin` 两项
|
| 195 |
+
4. 替换 CUDA 库的动态链接文件: 将 `C:\zluda` 文件夹内的 `cublas.dll` `cusparse.dll` 和 `nvrtc.dll` 复制出一份到桌面,按如下规则重命名复制出来的文件
|
| 196 |
+
|
| 197 |
+
**注意: (AMD 驱动 25.5.1 务必更新 ZLUDA 版本到 3.9.5 及以上)**
|
| 198 |
+
|
| 199 |
+
```
|
| 200 |
+
原文件名 → 新文件名
|
| 201 |
+
|
| 202 |
+
cublas.dll → cublas64_11.dll
|
| 203 |
+
|
| 204 |
+
cusparse.dll → cusparse64_11.dll
|
| 205 |
+
|
| 206 |
+
nvrtc.dll → nvrtc64_112_0.dll
|
| 207 |
+
```
|
| 208 |
+
将已经重命名的文件替换掉 `BallonsTranslator\ballontrans_pylibs_win\Lib\site-packages\torch\lib\` 目录中的同名文件
|
| 209 |
+
|
| 210 |
+
5. 启动程序并设置 OCR 和文本检测 为 Cuda **(图像修复请继续使用 CPU)**
|
| 211 |
+
6. 运行 OCR 并等待 ZLUDA 编译 PTX 文件 **(首次编译大概需要 5-10 分钟,取决于 CPU 性能)**,**下次运行无需编译**
|
| 212 |
+
|
| 213 |
+
### 原生社区预览方案 (ROCm7)
|
| 214 |
+
|
| 215 |
+
**优点:**
|
| 216 |
+
无需额外安装,开箱即用。且图像修复工具可以正常使用 CUDA 加速。
|
| 217 |
+
|
| 218 |
+
**缺点:**
|
| 219 |
+
由于社区版尚未集成FA2等注意力优化框架,速度不如 ZLUDA。
|
| 220 |
+
|
| 221 |
+
而且对显卡限制大,对Python版本也有要求
|
| 222 |
+
|
| 223 |
+
**安装步骤:**
|
| 224 |
+
|
| 225 |
+
1. 检查显卡架构是否为 RDNA3 和 RDNA4, 目前社区预览版 ROCm7 仅支持这两种架构的显卡 既 RX7000 和 9000系列,以及对应的专业卡
|
| 226 |
+
2. 确保 Python 版本不低于 3.12.x
|
| 227 |
+
3. 使用 [launch_win_amd_nightly.bat](launch_win_amd_nightly.bat) 启动程序
|
| 228 |
+
4. 检查 OCR 和文本检测、图像修复设置是否为 CUDA
|
| 229 |
+
|
| 230 |
+
</details>
|
README_EN.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
> [!IMPORTANT]
|
| 2 |
+
> **If you're sharing the translated result publicly and no experienced human translator participated in a throughout translating or proofreading, please mark it as machine translation somewhere clear to see.**
|
| 3 |
+
|
| 4 |
+
# BallonTranslator
|
| 5 |
+
[简体中文](/README.md) | English | [pt-BR](doc/README_PT-BR.md) | [Русский](doc/README_RU.md) | [日本語](doc/README_JA.md) | [Indonesia](doc/README_ID.md) | [Tiếng Việt](doc/README_VI.md) | [한국어](doc/README_KO.md) | [Español](doc/README_ES.md) | [Français](doc/README_FR.md)
|
| 6 |
+
|
| 7 |
+
Yet another computer-aided comic/manga translation tool powered by deep learning.
|
| 8 |
+
|
| 9 |
+
<img src="doc/src/ui0.jpg" div align=center>
|
| 10 |
+
|
| 11 |
+
<p align=center>
|
| 12 |
+
preview
|
| 13 |
+
</p>
|
| 14 |
+
|
| 15 |
+
# Features
|
| 16 |
+
* Fully automated translation
|
| 17 |
+
- Support automatic text-detection, recognition, removal, and translation. Overall performance is dependent upon these modules.
|
| 18 |
+
- Typesetting is based on the formatting estimation of the original text.
|
| 19 |
+
- Works decently with manga and comics.
|
| 20 |
+
- Improved manga->English, English->Chinese typesetting (based on the extraction of balloon regions.).
|
| 21 |
+
|
| 22 |
+
* Image editing
|
| 23 |
+
- Support mask editing & inpainting (something like spot healing brush tool in PS)
|
| 24 |
+
- Adapted to images with extreme aspect ratio such as webtoons
|
| 25 |
+
|
| 26 |
+
* Text editing
|
| 27 |
+
- Support rich text formatting and [text style presets](https://github.com/dmMaze/BallonsTranslator/pull/311), translated texts can be edited interactively.
|
| 28 |
+
- Support search & replace
|
| 29 |
+
- Support export/import to/from word documents
|
| 30 |
+
|
| 31 |
+
# Installation
|
| 32 |
+
|
| 33 |
+
## On Windows
|
| 34 |
+
If you don't want to install Python and Git by yourself and have access to the Internet:
|
| 35 |
+
Download BallonsTranslator_dev_src_with_gitpython.7z from [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) or [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing), unzip it and run launch_win.bat.
|
| 36 |
+
Run scripts/local_gitpull.bat to get the latest update.
|
| 37 |
+
Note these provided packages cannot run on Windows 7, Win 7 users need to install [Python 3.8](https://www.python.org/downloads/release/python-3810/) and run the source code.
|
| 38 |
+
|
| 39 |
+
## Run the source code
|
| 40 |
+
|
| 41 |
+
Install [Python](https://www.python.org/downloads/release/python-31011) **<= 3.12** (dont use the one installed from microsoft store) and [Git](https://git-scm.com/downloads).
|
| 42 |
+
|
| 43 |
+
```bash
|
| 44 |
+
# Clone this repo
|
| 45 |
+
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
|
| 46 |
+
|
| 47 |
+
# Launch app
|
| 48 |
+
$ python3 launch.py
|
| 49 |
+
|
| 50 |
+
# Update app
|
| 51 |
+
$ python3 launch.py --update
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
Note the first time you launch it will install the required libraries and download models automatically. If the downloads fail, you will need to download the **data** folder (or missing files mentioned in the terminal) from [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) or [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) and save it to the corresponding path in source code folder.
|
| 55 |
+
|
| 56 |
+
## Build macOS application (compatible with both intel and apple silicon chips)
|
| 57 |
+
[Reference](doc/macOS_app.md)
|
| 58 |
+
Some issues may occur, running the source code directly is the recommended way for now.
|
| 59 |
+
|
| 60 |
+
# Usage
|
| 61 |
+
|
| 62 |
+
**It is recommended to run the program in a terminal in case it crashed and left no information, see the following gif.**
|
| 63 |
+
<img src="doc/src/run.gif">
|
| 64 |
+
- The first time you run the application, please select the translator and set the source and target languages by clicking the settings icon.
|
| 65 |
+
- Open a folder containing images of a comic (manga/manhua/manhwa) that need translation by clicking the folder icon.
|
| 66 |
+
- Click the `Run` button and wait for the process to complete.
|
| 67 |
+
|
| 68 |
+
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->Typesetting. (global settings are those formats shown by the right font format panel when you are not editing any textblock in the scene)
|
| 69 |
+
|
| 70 |
+
## Image Editing
|
| 71 |
+
|
| 72 |
+
### Inpaint Tool
|
| 73 |
+
<img src="doc/src/imgedit_inpaint.gif">
|
| 74 |
+
<p align = "center">
|
| 75 |
+
Image Editing Mode, Inpainting Tool
|
| 76 |
+
</p>
|
| 77 |
+
|
| 78 |
+
### rect tool
|
| 79 |
+
<img src="doc/src/rect_tool.gif">
|
| 80 |
+
<p align = "center">
|
| 81 |
+
Rect Tool
|
| 82 |
+
</p>
|
| 83 |
+
|
| 84 |
+
To 'erase' unwanted inpainted results, use the inpainting tool or rect tool with your **right button** pressed.
|
| 85 |
+
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.
|
| 86 |
+
|
| 87 |
+
## Text editing
|
| 88 |
+
<img src="doc/src/textedit.gif">
|
| 89 |
+
<p align = "center">
|
| 90 |
+
Text Editing Mode
|
| 91 |
+
</p>
|
| 92 |
+
|
| 93 |
+
<img src="doc/src/multisel_autolayout.gif" div align=center>
|
| 94 |
+
<p align=center>
|
| 95 |
+
Batch Text Formatting & Auto Layout
|
| 96 |
+
</p>
|
| 97 |
+
|
| 98 |
+
<img src="doc/src/ocrselected.gif" div align=center>
|
| 99 |
+
<p align=center>
|
| 100 |
+
OCR & Translate Selected Area
|
| 101 |
+
</p>
|
| 102 |
+
|
| 103 |
+
## Shortcuts
|
| 104 |
+
* ```A```/```D``` or ```pageUp```/```Down``` to turn the page
|
| 105 |
+
* ```Ctrl+Z```, ```Ctrl+Shift+Z``` to undo/redo most operations. (note the undo stack will be cleared after you turn the page)
|
| 106 |
+
* ```T``` to text-editting mode (or the "T" button on the bottom toolbar).
|
| 107 |
+
* ```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)
|
| 108 |
+
* ```P``` to image-editting mode.
|
| 109 |
+
* In the image editing mode, use the slider on the right bottom to control the original image transparency.
|
| 110 |
+
* Disable or enable any automatic modules via titlebar->run, run with all modules disabled will re-letter and re-render all text according to corresponding settings.
|
| 111 |
+
* Set parameters of automatic modules in the config panel.
|
| 112 |
+
* ```Ctrl++```/```Ctrl+-``` (Also ```Ctrl+Shift+=```) to resize image.
|
| 113 |
+
* ```Ctrl+G```/```Ctrl+F``` to search globally/in current page.
|
| 114 |
+
* ```0-9``` to adjust opacity of text layer
|
| 115 |
+
* For text editing: bold - ```Ctrl+B```, underline - ```Ctrl+U```, Italics - ```Ctrl+I```
|
| 116 |
+
* Set text shadow and transparency in the text style panel -> Effect.
|
| 117 |
+
* ```Alt+Arrow Keys``` or ```Alt+WASD``` (```pageDown``` or ```pageUp``` while in text editing mode) to switch between text blocks.
|
| 118 |
+
|
| 119 |
+
<img src="doc/src/configpanel.png">
|
| 120 |
+
|
| 121 |
+
## Headless mode (Run without GUI)
|
| 122 |
+
``` python
|
| 123 |
+
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
|
| 124 |
+
```
|
| 125 |
+
Note the configuration (source language, target language, inpaint model, etc) will load from config/config.json.
|
| 126 |
+
If the rendered font size is not right, specify logical DPI manually via ```--ldpi ```, typical values are 96 and 72.
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
# Automation modules
|
| 130 |
+
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:
|
| 131 |
+
- Ko-fi: <https://ko-fi.com/voilelabs>
|
| 132 |
+
- Patreon: <https://www.patreon.com/voilelabs>
|
| 133 |
+
- 爱发电: <https://afdian.net/@voilelabs>
|
| 134 |
+
|
| 135 |
+
[Sugoi translator](https://sugoitranslator.com/) is created by [mingshiba](https://www.patreon.com/mingshiba).
|
| 136 |
+
|
| 137 |
+
## Text detection
|
| 138 |
+
* 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)
|
| 139 |
+
* Support using text detection from [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). Username and password need to be filled in, and automatic login will be performed each time the program is launched.
|
| 140 |
+
|
| 141 |
+
* For detailed instructions, see **Tuanzi OCR Instructions**: ([Chinese](doc/团子OCR说明.md) & [Brazilian Portuguese](doc/Manual_TuanziOCR_pt-BR.md) only)
|
| 142 |
+
|
| 143 |
+
* `YSGDetector` models are trained by [lhj5426](https://github.com/lhj5426), these models would filter out onomatopoeia in CGs/Manga, download checkpoints from [YSGYoloDetector](https://huggingface.co/YSGforMTL/YSGYoloDetector) and put into `data/models`.
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
## OCR
|
| 147 |
+
* All mit* models are from manga-image-translator, support English, Japanese and Korean recognition and text color extraction.
|
| 148 |
+
* [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.
|
| 149 |
+
* Support using OCR from [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). Username and password need to be filled in, and automatic login will be performed each time the program is launched.
|
| 150 |
+
* The current implementation uses OCR on each textblock individually, resulting in slower speed and no significant improvement in accuracy. It is not recommended. If needed, please use the Tuanzi Detector instead.
|
| 151 |
+
* When using the Tuanzi Detector for text detection, it is recommended to set OCR to none_ocr to directly read the text, saving time and reducing the number of requests.
|
| 152 |
+
* For detailed instructions, see **Tuanzi OCR Instructions**: ([Chinese](doc/团子OCR说明.md) & [Brazilian Portuguese](doc/Manual_TuanziOCR_pt-BR.md) only)
|
| 153 |
+
* Added as an "optional" PaddleOCR module. In Debug mode you will see a message stating that it is not there. You can simply install it by following the instructions described there. If you don’t want to install the package yourself, just uncomment (remove the `#`) the lines with paddlepaddle(gpu) and paddleocr. Bet everything at your own peril andrisk. For me (bropines) and two testers, everything was installed fine, you may have an error. Write about it in issue and tag me.
|
| 154 |
+
* Added [OneOCR](https://github.com/b1tg/win11-oneocr). Local WINDOWS model taken from SnippingTOOL or Win.PHOTOS applications. To use it, you need to place the model and DLL files in the 'data/models/one-ocr' folder. Before running, it is better to throw the files at once. Read how to find and get DLL and model files here: https://github.com/dmMaze/BallonsTranslator/discussions/859#discussioncomment-12876757 . Thanks AuroraWright for the project [OneOCR](https://github.com/AuroraWright/oneocr)
|
| 155 |
+
|
| 156 |
+
## Inpainting
|
| 157 |
+
* AOT is from [manga-image-translator](https://github.com/zyddnys/manga-image-translator).
|
| 158 |
+
* All lama* are finetuned using [LaMa](https://github.com/advimman/lama)
|
| 159 |
+
* PatchMatch is an algorithm from [PyPatchMatch](https://github.com/vacancy/PyPatchMatch), this program uses a [modified version](https://github.com/dmMaze/PyPatchMatchInpaint) by me.
|
| 160 |
+
|
| 161 |
+
## Translators
|
| 162 |
+
* **You can find information about Translators modules [here.](doc/modules/translators.md)**
|
| 163 |
+
|
| 164 |
+
## FAQ & Misc
|
| 165 |
+
* If your computer has an Nvidia GPU or Apple silicon, the program will enable hardware acceleration.
|
| 166 |
+
* Add support for [saladict](https://saladict.crimx.com) (*All-in-one professional pop-up dictionary and page translator*) in the mini menu on text selection. [Installation guide](doc/saladict.md)
|
| 167 |
+
* Accelarate performance if you have a [NVIDIA's CUDA](https://pytorch.org/docs/stable/notes/cuda.html) or [AMD's ROCm](https://pytorch.org/docs/stable/notes/hip.html) device as most modules uses [PyTorch](https://pytorch.org/get-started/locally/).
|
| 168 |
+
* Fonts are from your system's fonts.
|
| 169 |
+
* Thanks to [bropines](https://github.com/bropines) for the Russian localization.
|
| 170 |
+
* Added Export to photoshop JSX script by [bropines](https://github.com/bropines). </br> To read the instructions, improve the code and just poke around to see how it works, you can go to `scripts/export to photoshop` -> `install_manual.md`.
|
config/stylesheet.css
ADDED
|
@@ -0,0 +1,1080 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
QWidget {
|
| 2 |
+
/* border-style: none; */
|
| 3 |
+
color: @qwidgetForegroundColor;
|
| 4 |
+
background-color: @qwidgetBackgroundColor;
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
SeparatorWidget {
|
| 8 |
+
border-color: @borderColor;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
Widget {
|
| 12 |
+
background-color: @widgetBackgroundColor;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
ConfigTextLabel {
|
| 17 |
+
background-color : @emptyContentBackgroundColor;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
CustomGV {
|
| 21 |
+
background-color: @emptyContentBackgroundColor;
|
| 22 |
+
border-color: @borderColor;
|
| 23 |
+
border-style: solid;
|
| 24 |
+
border-width: 1px;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
ConfigTable {
|
| 28 |
+
border-color: @borderColor;
|
| 29 |
+
border-style: solid;
|
| 30 |
+
border-width: 1px;
|
| 31 |
+
background-color: @emptyContentBackgroundColor
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
ConfigBlock {
|
| 35 |
+
background-color: @emptyContentBackgroundColor
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
ConfigSubBlock {
|
| 39 |
+
background-color: @emptyContentBackgroundColor
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
SearchResultTree {
|
| 43 |
+
border-style: none;
|
| 44 |
+
background-color: @widgetBackgroundColor;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
QSplitter:handle {
|
| 48 |
+
background: @widgetBackgroundColor;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
QSplitter::handle:pressed {
|
| 52 |
+
background: rgb(30, 147, 229)
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
ConfigSubBlock::hover {
|
| 56 |
+
background-color: rgba(30, 147, 229, 20%);
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
SourceTextEdit {
|
| 60 |
+
font-size: 17px;
|
| 61 |
+
background-color: @emptyContentBackgroundColor;
|
| 62 |
+
border-radius: 5px;
|
| 63 |
+
border-style: none;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
TransTextEdit {
|
| 67 |
+
font-size: 17px;
|
| 68 |
+
border-radius: 5px;
|
| 69 |
+
background-color: @transtexteditBackgroundColor;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
QComboBox {
|
| 73 |
+
height: 27px;
|
| 74 |
+
font-size: 14px;
|
| 75 |
+
padding-left: 8px;
|
| 76 |
+
border: 1px solid @borderColor;
|
| 77 |
+
background-color: @transtexteditBackgroundColor;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
QLineEdit {
|
| 81 |
+
border: 1px solid @borderColor;
|
| 82 |
+
background-color: @transtexteditBackgroundColor;
|
| 83 |
+
height: 27px;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
QPlainTextEdit {
|
| 87 |
+
border: 1px solid @borderColor;
|
| 88 |
+
background-color: @transtexteditBackgroundColor;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
QPlainTextEdit:focus {
|
| 92 |
+
border: 1px solid rgb(30, 147, 229);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
QComboBox::drop-down {
|
| 96 |
+
border-left-width: 0px;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
QComboBox::hover {
|
| 100 |
+
border: 1px solid rgb(30, 147, 229);
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
QComboBox::down-arrow {
|
| 104 |
+
image: url(icons/combobox_arrow.svg);
|
| 105 |
+
width: 11px;
|
| 106 |
+
height: 11px;
|
| 107 |
+
padding-right: 13px;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
QFontComboBox#FontFamilyBox {
|
| 111 |
+
width: 106px;
|
| 112 |
+
height: 26px;
|
| 113 |
+
font-size: 14px;
|
| 114 |
+
padding-right: 14px;
|
| 115 |
+
padding-left: 6px;
|
| 116 |
+
border-color: @borderColor;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
QFontComboBox#FontFamilyBox::hover {
|
| 120 |
+
border: 1px solid rgb(30, 147, 229);
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
SizeComboBox {
|
| 124 |
+
padding-left: 0px;
|
| 125 |
+
padding-right: 0px;
|
| 126 |
+
font-size: 12px;
|
| 127 |
+
min-width: 54px;
|
| 128 |
+
max-width: 54px;
|
| 129 |
+
border-color: @borderColor;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
SizeComboBox::hover {
|
| 133 |
+
border: 1px solid rgb(30, 147, 229);
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
SizeComboBox::down-arrow {
|
| 137 |
+
image: url(icons/combobox_arrow.svg);
|
| 138 |
+
width: 24px;
|
| 139 |
+
height: 11px;
|
| 140 |
+
padding-right: 11px;
|
| 141 |
+
margin-right: 0px;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
SizeComboBox::drop-down {
|
| 145 |
+
width: 12px;
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
SizeControlLabel {
|
| 149 |
+
font-size: 14px;
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
SmallSizeControlLabel {
|
| 154 |
+
font-size: 12px;
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
QLabel#lineSpacingLabel {
|
| 158 |
+
image: url(icons/fontfmt_linespacing.svg);
|
| 159 |
+
max-width: 25px;
|
| 160 |
+
max-height: 25px;
|
| 161 |
+
min-width: 25px;
|
| 162 |
+
min-height: 25px;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
QGroupBox {
|
| 166 |
+
font-size: 14px;
|
| 167 |
+
border: 1px solid @borderColor;
|
| 168 |
+
margin-top: 9px;
|
| 169 |
+
border-radius: 6px;
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
QGroupBox::title {
|
| 173 |
+
subcontrol-origin: margin;
|
| 174 |
+
left: 7px;
|
| 175 |
+
padding: 0px 5px 0px 5px;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
QLabel#letterSpacingLabel {
|
| 179 |
+
image: url(icons/fontfmt_letterspacing.svg);
|
| 180 |
+
max-width: 28px;
|
| 181 |
+
max-height: 28px;
|
| 182 |
+
min-width: 28px;
|
| 183 |
+
min-height: 28px;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
ColorPickerLabel {
|
| 187 |
+
max-height: 25px;
|
| 188 |
+
min-height: 25px;
|
| 189 |
+
min-width: 25px;
|
| 190 |
+
max-width: 25px;
|
| 191 |
+
border: 2px solid @borderColor;
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
ColorPickerLabel::hover {
|
| 195 |
+
border: 2px solid rgb(30, 147, 229);
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
SmallColorPickerLabel {
|
| 199 |
+
max-height: 17px;
|
| 200 |
+
min-height: 17px;
|
| 201 |
+
min-width: 17px;
|
| 202 |
+
max-width: 17px;
|
| 203 |
+
border: 1px solid @borderColor;
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
AlignmentChecker {
|
| 207 |
+
margin: 0px;
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
AlignmentChecker::indicator {
|
| 211 |
+
height: 28px;
|
| 212 |
+
width: 28px;
|
| 213 |
+
border: 2px solid @borderColor;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
AlignmentChecker::indicator:checked {
|
| 217 |
+
background-color: rgb(30, 147, 229);
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
AlignmentChecker::indicator:hover {
|
| 221 |
+
border: 2px solid rgb(30, 147, 229);
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
AlignmentChecker#AlignLeftChecker::indicator {
|
| 225 |
+
border-right: none;
|
| 226 |
+
min-width: 36px;
|
| 227 |
+
max-width: 36px;
|
| 228 |
+
image: url(icons/fontfmt_alignl.svg);
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
AlignmentChecker#AlignLeftChecker::indicator:checked {
|
| 232 |
+
image: url(icons/fontfmt_alignl_activate.svg);
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
AlignmentChecker#AlignCenterChecker::indicator {
|
| 236 |
+
border-right: none;
|
| 237 |
+
border-left: none;
|
| 238 |
+
min-width: 36px;
|
| 239 |
+
max-width: 36px;
|
| 240 |
+
image: url(icons/fontfmt_alignc.svg);
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
AlignmentChecker#AlignCenterChecker::indicator:checked {
|
| 244 |
+
image: url(icons/fontfmt_alignc_activate.svg);
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
AlignmentChecker#AlignRightChecker::indicator {
|
| 248 |
+
border-left: none;
|
| 249 |
+
min-width: 35px;
|
| 250 |
+
max-width: 35px;
|
| 251 |
+
image: url(icons/fontfmt_alignr.svg);
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
AlignmentChecker#AlignRightChecker::indicator:checked {
|
| 255 |
+
image: url(icons/fontfmt_alignr_activate.svg);
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
QFontChecker {
|
| 259 |
+
max-width: 34px;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
QFontChecker::indicator {
|
| 263 |
+
width: 30px;
|
| 264 |
+
height: 30px;
|
| 265 |
+
border: 2px solid rgba(30, 147, 229, 0);
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
QFontChecker::indicator::hover {
|
| 269 |
+
border: 2px solid rgb(30, 147, 229);
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
QFontChecker::indicator::checked {
|
| 273 |
+
border: 2px solid rgb(30, 147, 229);
|
| 274 |
+
background-color: rgb(30, 147, 229);
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
QFontChecker#FontBoldChecker::indicator {
|
| 278 |
+
image: url(icons/fontfmt_bold.svg);
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
QFontChecker#FontBoldChecker::indicator:checked {
|
| 282 |
+
image: url(icons/fontfmt_bold_activate.svg);
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
QFontChecker#FontItalicChecker::indicator {
|
| 286 |
+
image: url(icons/fontfmt_italic.svg);
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
QFontChecker#FontItalicChecker::indicator:checked {
|
| 290 |
+
image: url(icons/fontfmt_italic_activate.svg);
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
QFontChecker#FontUnderlineChecker::indicator {
|
| 294 |
+
image: url(icons/fontfmt_underline.svg);
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
QFontChecker#FontUnderlineChecker::indicator:checked {
|
| 298 |
+
image: url(icons/fontfmt_underline_activate.svg);
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
QFontChecker#FontVerticalChecker::indicator {
|
| 302 |
+
image: url(icons/fontfmt_vertical.svg);
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
QFontChecker#FontVerticalChecker::indicator:checked {
|
| 306 |
+
image: url(icons/fontfmt_vertical_activate.svg);
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
TextEditListScrollArea {
|
| 310 |
+
border-style: none;
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
QListWidget {
|
| 314 |
+
background-color: @emptyContentBackgroundColor;
|
| 315 |
+
border-color: @borderColor;
|
| 316 |
+
border-style: solid;
|
| 317 |
+
border-width: 1px;
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
QAction {
|
| 321 |
+
min-height: 66px;
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
QMenu {
|
| 325 |
+
background-color: @emptyContentBackgroundColor;
|
| 326 |
+
margin: 0px; /* some spacing around the menu */
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
QMenu::item {
|
| 330 |
+
height: 28px;
|
| 331 |
+
min-width: 128px;
|
| 332 |
+
margin: 0px;
|
| 333 |
+
background-color: @emptyContentBackgroundColor;
|
| 334 |
+
padding-left: 20px;
|
| 335 |
+
padding-right: 20px;
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
QMenu::separator {
|
| 339 |
+
height: 5px;
|
| 340 |
+
/* background: lightblue; */
|
| 341 |
+
margin-left: 12px;
|
| 342 |
+
margin-right: 12px;
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
/* QMenu::item {
|
| 346 |
+
background-color: @emptyContentBackgroundColor;
|
| 347 |
+
min-height: 100px;
|
| 348 |
+
}*/
|
| 349 |
+
|
| 350 |
+
QMenu::item:selected {
|
| 351 |
+
background-color: #cad7ed;
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
QDialog {
|
| 355 |
+
font-size: 14px;
|
| 356 |
+
background-color: @widgetBackgroundColor;
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
QDialog QPushButton {
|
| 360 |
+
padding: 5px 15px;
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
QGroupBox {
|
| 364 |
+
background-color: @emptyContentBackgroundColor;
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
QPushButton {
|
| 368 |
+
/* max-width: 94px; */
|
| 369 |
+
height: 32px;
|
| 370 |
+
font-size: 14px;
|
| 371 |
+
background-color: @pushBtnBackgroundColor;
|
| 372 |
+
border: 1px solid @borderColor;
|
| 373 |
+
border-radius: 4px;
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
QPushButton#RunButton {
|
| 377 |
+
font-size: 12px;
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
NoBorderPushBtn {
|
| 381 |
+
background-color: @noboderPushBtnBackgroundColor;
|
| 382 |
+
border: none;
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
QPushButton::hover {
|
| 386 |
+
background-color: #cad7ed;
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
QPushButton:pressed {
|
| 390 |
+
border: 1px solid royalblue;
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
QPushButton#minBtn {
|
| 394 |
+
border-radius: 0px;
|
| 395 |
+
background-color: rgba(0, 0, 0, 0);
|
| 396 |
+
border: 0px;
|
| 397 |
+
width: 16px;
|
| 398 |
+
height: 16px;
|
| 399 |
+
padding-top: 5px;
|
| 400 |
+
padding-bottom: 5px;
|
| 401 |
+
padding-left: 16px;
|
| 402 |
+
padding-right: 16px;
|
| 403 |
+
image: url(icons/titlebar_min.svg);
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
QPushButton#minBtn::hover {
|
| 407 |
+
background-color: rgba(0, 0, 0, 10%);
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
StatusButton {
|
| 411 |
+
/* max-width: 140px; */
|
| 412 |
+
max-width: 10800px;
|
| 413 |
+
/* height: 50px; */
|
| 414 |
+
/* min-width: 140px; */
|
| 415 |
+
font-size: 12px;
|
| 416 |
+
padding-left: 7px;
|
| 417 |
+
padding-left: 7px;
|
| 418 |
+
border: none;
|
| 419 |
+
}
|
| 420 |
+
|
| 421 |
+
QCheckBox#maxBtn::indicator{
|
| 422 |
+
height: 17px;
|
| 423 |
+
width: 17px;
|
| 424 |
+
padding-top: 5px;
|
| 425 |
+
padding-bottom: 5px;
|
| 426 |
+
padding-left: 16px;
|
| 427 |
+
padding-right: 16px;
|
| 428 |
+
image: url(icons/titlebar_max.svg);
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
QCheckBox#maxBtn::indicator:hover
|
| 432 |
+
{
|
| 433 |
+
background-color: rgba(0, 0, 0, 10%);
|
| 434 |
+
}
|
| 435 |
+
QCheckBox#maxBtn::indicator:checked
|
| 436 |
+
{
|
| 437 |
+
image: url(icons/titlebar_windowmode.svg);
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
QPushButton#closeBtn {
|
| 441 |
+
border-radius: 0px;
|
| 442 |
+
background-color: rgba(0, 0, 0, 0);
|
| 443 |
+
border: 0px;
|
| 444 |
+
width: 14px;
|
| 445 |
+
height: 14px;
|
| 446 |
+
padding-top: 7px;
|
| 447 |
+
padding-bottom: 7px;
|
| 448 |
+
padding-left: 16px;
|
| 449 |
+
padding-right: 16px;
|
| 450 |
+
image: url(icons/titlebar_close.svg);
|
| 451 |
+
}
|
| 452 |
+
|
| 453 |
+
QPushButton#closeBtn::hover {
|
| 454 |
+
background-color: #E81123;
|
| 455 |
+
image: url(icons/titlebar_close_activate.svg);
|
| 456 |
+
}
|
| 457 |
+
|
| 458 |
+
TextCheckerLabel::hover {
|
| 459 |
+
background-color: rgba(30, 147, 229, 20%);
|
| 460 |
+
}
|
| 461 |
+
|
| 462 |
+
QCheckBox#TransChecker::indicator {
|
| 463 |
+
padding-left: 8px;
|
| 464 |
+
padding-right: 8px;
|
| 465 |
+
padding-top: 3px;
|
| 466 |
+
padding-bottom: 3px;
|
| 467 |
+
height: 27px;
|
| 468 |
+
width: 27px;
|
| 469 |
+
image: url(icons/bottombar_translate.svg);
|
| 470 |
+
}
|
| 471 |
+
|
| 472 |
+
QCheckBox#TransChecker::indicator:checked {
|
| 473 |
+
image: url(icons/bottombar_translate_activate.svg);
|
| 474 |
+
}
|
| 475 |
+
|
| 476 |
+
QCheckBox#TransChecker::indicator:hover {
|
| 477 |
+
background-color: rgba(30, 147, 229, 20%);
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
QCheckBox#PaintChecker::indicator {
|
| 481 |
+
padding-left: 8px;
|
| 482 |
+
padding-right: 8px;
|
| 483 |
+
padding-top: 8px;
|
| 484 |
+
/* padding-bottom: 4px; */
|
| 485 |
+
height: 33px;
|
| 486 |
+
width: 33px;
|
| 487 |
+
image: url(icons/bottombar_paintmode.svg);
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
QCheckBox#PaintChecker::indicator:checked {
|
| 491 |
+
image: url(icons/bottombar_paintmode_activate.svg);
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
QCheckBox#PaintChecker::indicator:hover {
|
| 495 |
+
background-color: rgba(30, 147, 229, 20%);
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
QCheckBox#TexteditChecker::indicator {
|
| 499 |
+
padding-left: 8px;
|
| 500 |
+
padding-right: 8px;
|
| 501 |
+
padding-top: 3px;
|
| 502 |
+
padding-bottom: 3px;
|
| 503 |
+
height: 28px;
|
| 504 |
+
width: 28px;
|
| 505 |
+
image: url(icons/bottombar_textedit.svg);
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
QCheckBox#TexteditChecker::indicator:checked {
|
| 509 |
+
image: url(icons/bottombar_textedit_activate.svg);
|
| 510 |
+
}
|
| 511 |
+
|
| 512 |
+
QCheckBox#TexteditChecker::indicator:hover {
|
| 513 |
+
background-color: rgba(30, 147, 229, 20%);
|
| 514 |
+
}
|
| 515 |
+
|
| 516 |
+
QCheckBox#TextblockChecker::indicator{
|
| 517 |
+
padding-left: 8px;
|
| 518 |
+
padding-right: 8px;
|
| 519 |
+
padding-top: 3px;
|
| 520 |
+
padding-bottom: 3px;
|
| 521 |
+
height: 28px;
|
| 522 |
+
width: 28px;
|
| 523 |
+
image: url(icons/bottombar_textblock.svg);
|
| 524 |
+
}
|
| 525 |
+
|
| 526 |
+
QCheckBox#TextblockChecker::indicator:hover {
|
| 527 |
+
background-color: rgba(30, 147, 229, 20%);
|
| 528 |
+
}
|
| 529 |
+
|
| 530 |
+
QCheckBox#TextblockChecker::indicator:checked{
|
| 531 |
+
image: url(icons/bottombar_textblock_activate.svg);
|
| 532 |
+
}
|
| 533 |
+
|
| 534 |
+
OpenBtn {
|
| 535 |
+
border-style: none;
|
| 536 |
+
image: url(icons/openbtn.svg);
|
| 537 |
+
background-color: @widgetBackgroundColor;
|
| 538 |
+
|
| 539 |
+
}
|
| 540 |
+
|
| 541 |
+
OpenBtn::hover {
|
| 542 |
+
image: url(icons/openbtn_activate.svg);
|
| 543 |
+
}
|
| 544 |
+
|
| 545 |
+
OpenBtn::pressed {
|
| 546 |
+
image: url(icons/openbtn_activate.svg);
|
| 547 |
+
}
|
| 548 |
+
|
| 549 |
+
QProgressBar {
|
| 550 |
+
background-color: @emptyContentBackgroundColor;
|
| 551 |
+
width: 450px;
|
| 552 |
+
height: 45px;
|
| 553 |
+
max-width: 450px;
|
| 554 |
+
max-height: 45px;
|
| 555 |
+
}
|
| 556 |
+
|
| 557 |
+
ShowPageListChecker::indicator{
|
| 558 |
+
height: 27px;
|
| 559 |
+
width: 27px;
|
| 560 |
+
image: url(icons/showpagelist.svg);
|
| 561 |
+
}
|
| 562 |
+
|
| 563 |
+
ShowPageListChecker::indicator:hover
|
| 564 |
+
{
|
| 565 |
+
image: url(icons/showpagelist_activate.svg);
|
| 566 |
+
}
|
| 567 |
+
ShowPageListChecker::indicator:checked
|
| 568 |
+
{
|
| 569 |
+
image: url(icons/showpagelist_activate.svg);
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
QCheckBox#GlobalSearchChecker::indicator{
|
| 573 |
+
height: 28px;
|
| 574 |
+
width: 28px;
|
| 575 |
+
image: url(icons/search.svg);
|
| 576 |
+
}
|
| 577 |
+
|
| 578 |
+
QCheckBox#GlobalSearchChecker::indicator:hover
|
| 579 |
+
{
|
| 580 |
+
image: url(icons/search_activate.svg);
|
| 581 |
+
}
|
| 582 |
+
QCheckBox#GlobalSearchChecker::indicator:checked
|
| 583 |
+
{
|
| 584 |
+
image: url(icons/search_activate.svg);
|
| 585 |
+
}
|
| 586 |
+
|
| 587 |
+
|
| 588 |
+
StateChecker#ImgTransChecker::indicator{
|
| 589 |
+
height: 27px;
|
| 590 |
+
width: 27px;
|
| 591 |
+
image: url(icons/leftbar_imgtrans.svg);
|
| 592 |
+
}
|
| 593 |
+
|
| 594 |
+
StateChecker#ImgTransChecker::indicator:hover
|
| 595 |
+
{
|
| 596 |
+
image: url(icons/leftbar_imgtrans_activate.svg);
|
| 597 |
+
}
|
| 598 |
+
StateChecker#ImgTransChecker::indicator:checked
|
| 599 |
+
{
|
| 600 |
+
image: url(icons/leftbar_imgtrans_activate.svg);
|
| 601 |
+
color: red;
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
StateChecker#ConfigChecker::indicator{
|
| 605 |
+
height: 27px;
|
| 606 |
+
width: 27px;
|
| 607 |
+
image: url(icons/leftbar_config.svg);
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
StateChecker#ConfigChecker::indicator:hover
|
| 611 |
+
{
|
| 612 |
+
image: url(icons/leftbar_config_activate.svg);
|
| 613 |
+
}
|
| 614 |
+
StateChecker#ConfigChecker::indicator:checked
|
| 615 |
+
{
|
| 616 |
+
image: url(icons/leftbar_config_activate.svg);
|
| 617 |
+
}
|
| 618 |
+
|
| 619 |
+
QProgressBar::chunk {
|
| 620 |
+
background-color: #b0cbf8;
|
| 621 |
+
}
|
| 622 |
+
|
| 623 |
+
|
| 624 |
+
/*https://github.com/PyQt5/PyQt/blob/master/QScrollBar/StyleScrollBar.py*/
|
| 625 |
+
/*纵向滚动条*/
|
| 626 |
+
QScrollBar:vertical {
|
| 627 |
+
/* background: transparent; 背景透明 */
|
| 628 |
+
width: 10px; /*宽度*/
|
| 629 |
+
margin: 0px 0px 0px 0px; /**/
|
| 630 |
+
padding-top: 0px; /*距离上面12px*/
|
| 631 |
+
padding-bottom: 0px; /*距离底部12px*/
|
| 632 |
+
background: @scrollBarBackground
|
| 633 |
+
}
|
| 634 |
+
/*横向滚动条*/
|
| 635 |
+
QScrollBar:horizontal {
|
| 636 |
+
background: @scrollBarBackground;
|
| 637 |
+
height: 7px; /*高度*/
|
| 638 |
+
margin: 0px 0px 0px 0px;
|
| 639 |
+
padding-left: 0px; /*距离左边12px*/
|
| 640 |
+
padding-right: 0px; /*距离右边12px*/
|
| 641 |
+
}
|
| 642 |
+
|
| 643 |
+
/*当鼠标放到纵向或者横向滚动条上面时*/
|
| 644 |
+
QScrollBar:vertical:hover,QScrollBar:horizontal:hover {
|
| 645 |
+
background: @scrollBarColor; /*修改背景透明度 30*/
|
| 646 |
+
}
|
| 647 |
+
|
| 648 |
+
/*纵向滚动条上面的滑块*/
|
| 649 |
+
QScrollBar::handle:vertical {
|
| 650 |
+
background: @scrollBarColor;
|
| 651 |
+
width: 10px;
|
| 652 |
+
/* border-radius: 5px; */
|
| 653 |
+
border: none;
|
| 654 |
+
}
|
| 655 |
+
/*横向滚动条上面的滑块*/
|
| 656 |
+
QScrollBar::handle:horizontal {
|
| 657 |
+
background: @scrollBarColor;
|
| 658 |
+
height: 10px;
|
| 659 |
+
/* border-radius: 5px; */
|
| 660 |
+
border: none;
|
| 661 |
+
}
|
| 662 |
+
|
| 663 |
+
/*当鼠标放到滚动条滑块上面时改变透明度实现颜色的深浅变化*/
|
| 664 |
+
QScrollBar::handle:vertical:hover,QScrollBar::handle:horizontal:hover {
|
| 665 |
+
background: @scrollBarHoverColor;
|
| 666 |
+
}
|
| 667 |
+
|
| 668 |
+
/*纵向滚动条下部分块*/
|
| 669 |
+
QScrollBar::add-page:vertical {
|
| 670 |
+
width: 0px;
|
| 671 |
+
background: transparent;
|
| 672 |
+
}
|
| 673 |
+
/*横向滚动条后面部分块*/
|
| 674 |
+
QScrollBar::add-page:horizontal {
|
| 675 |
+
height: 0px;
|
| 676 |
+
background: transparent;
|
| 677 |
+
}
|
| 678 |
+
/*纵向滚动条上面部分块*/
|
| 679 |
+
QScrollBar::sub-page:vertical {
|
| 680 |
+
width: 0px;
|
| 681 |
+
background: transparent;
|
| 682 |
+
}
|
| 683 |
+
/*横向滚动条左部分块*/
|
| 684 |
+
QScrollBar::sub-page:horizontal {
|
| 685 |
+
height: 0px;
|
| 686 |
+
background: transparent;
|
| 687 |
+
}
|
| 688 |
+
|
| 689 |
+
QScrollBar::sub-line {
|
| 690 |
+
height: 0px;
|
| 691 |
+
width: 0px;
|
| 692 |
+
background: transparent;
|
| 693 |
+
subcontrol-position: top;
|
| 694 |
+
}
|
| 695 |
+
|
| 696 |
+
/*纵向滚动条顶部三角形位置*/
|
| 697 |
+
QScrollBar::add-line {
|
| 698 |
+
height: 0px;
|
| 699 |
+
width: 0px;
|
| 700 |
+
background: transparent;
|
| 701 |
+
subcontrol-position: top;
|
| 702 |
+
}
|
| 703 |
+
|
| 704 |
+
|
| 705 |
+
.IncrementalBtn#FsizeIncrementUp {
|
| 706 |
+
border-image: url(icons/incre_up.svg) 0 0 0 0 stretch stretch;
|
| 707 |
+
}
|
| 708 |
+
.IncrementalBtn#FsizeIncrementDown {
|
| 709 |
+
border-image: url(icons/incre_down.svg) 0 0 0 0 stretch stretch;
|
| 710 |
+
}
|
| 711 |
+
|
| 712 |
+
.FadeLabel {
|
| 713 |
+
background: rgba(0, 0, 0, 85);
|
| 714 |
+
border-radius: 16px;
|
| 715 |
+
border: none;
|
| 716 |
+
font-size: 22px;
|
| 717 |
+
min-height: 36px;
|
| 718 |
+
max-height: 36px;
|
| 719 |
+
min-width: 72px;
|
| 720 |
+
max-width: 72px;
|
| 721 |
+
color: rgba(255, 255, 255, 150);
|
| 722 |
+
}
|
| 723 |
+
|
| 724 |
+
QLabel#TitleLabel {
|
| 725 |
+
font-size: 13px;
|
| 726 |
+
color: @qwidgetForegroundColor;
|
| 727 |
+
}
|
| 728 |
+
|
| 729 |
+
QLabel#angleLabel {
|
| 730 |
+
background: rgba(0, 0, 0, 85);
|
| 731 |
+
border-radius: 10px;
|
| 732 |
+
border: none;
|
| 733 |
+
font-size: 20px;
|
| 734 |
+
min-height: 32px;
|
| 735 |
+
max-height: 32px;
|
| 736 |
+
min-width: 72px;
|
| 737 |
+
max-width: 72px;
|
| 738 |
+
color: rgba(255, 255, 255, 150);
|
| 739 |
+
}
|
| 740 |
+
|
| 741 |
+
.ClickableLabel::hover {
|
| 742 |
+
background-color: rgba(30, 147, 229, 20%);
|
| 743 |
+
}
|
| 744 |
+
|
| 745 |
+
.ConfigClickableLabel {
|
| 746 |
+
font-size: 12px;
|
| 747 |
+
}
|
| 748 |
+
|
| 749 |
+
.ConfigClickableLabel::hover {
|
| 750 |
+
background-color: rgba(30, 147, 229, 20%);
|
| 751 |
+
}
|
| 752 |
+
|
| 753 |
+
.ExpandLabel::hover {
|
| 754 |
+
background-color: rgba(30, 147, 229, 20%);
|
| 755 |
+
}
|
| 756 |
+
|
| 757 |
+
DrawToolCheckBox::indicator {
|
| 758 |
+
height: 34px;
|
| 759 |
+
width: 34px;
|
| 760 |
+
border-radius: 6px;
|
| 761 |
+
padding: 6px;
|
| 762 |
+
}
|
| 763 |
+
|
| 764 |
+
DrawToolCheckBox::indicator:checked {
|
| 765 |
+
background-color: rgba(30, 147, 229, 80);
|
| 766 |
+
}
|
| 767 |
+
|
| 768 |
+
DrawToolCheckBox#DrawHandTool::indicator {
|
| 769 |
+
|
| 770 |
+
image: url(icons/drawingtools_hand.svg);
|
| 771 |
+
}
|
| 772 |
+
|
| 773 |
+
DrawToolCheckBox#DrawHandTool::indicator:hover {
|
| 774 |
+
image: url(icons/drawingtools_hand_activate.svg);
|
| 775 |
+
}
|
| 776 |
+
|
| 777 |
+
DrawToolCheckBox#DrawHandTool::indicator:checked {
|
| 778 |
+
|
| 779 |
+
image: url(icons/drawingtools_hand.svg);
|
| 780 |
+
}
|
| 781 |
+
|
| 782 |
+
DrawToolCheckBox#DrawInpaintTool::indicator {
|
| 783 |
+
image: url(icons/drawingtools_inpaint.svg);
|
| 784 |
+
}
|
| 785 |
+
|
| 786 |
+
DrawToolCheckBox#DrawInpaintTool::indicator:hover {
|
| 787 |
+
image: url(icons/drawingtools_inpaint_activate.svg);
|
| 788 |
+
}
|
| 789 |
+
|
| 790 |
+
DrawToolCheckBox#DrawInpaintTool::indicator:checked {
|
| 791 |
+
image: url(icons/drawingtools_inpaint.svg);
|
| 792 |
+
}
|
| 793 |
+
|
| 794 |
+
DrawToolCheckBox#DrawPenTool::indicator {
|
| 795 |
+
image: url(icons/drawingtools_pen.svg);
|
| 796 |
+
}
|
| 797 |
+
|
| 798 |
+
DrawToolCheckBox#DrawPenTool::indicator:hover {
|
| 799 |
+
image: url(icons/drawingtools_pen_activate.svg);
|
| 800 |
+
}
|
| 801 |
+
|
| 802 |
+
DrawToolCheckBox#DrawPenTool::indicator:checked {
|
| 803 |
+
image: url(icons/drawingtools_pen.svg);
|
| 804 |
+
}
|
| 805 |
+
|
| 806 |
+
DrawToolCheckBox#DrawRectTool::indicator {
|
| 807 |
+
image: url(icons/bottombar_textblock_activate.svg);
|
| 808 |
+
}
|
| 809 |
+
|
| 810 |
+
DrawToolCheckBox#DrawRectTool::indicator:hover {
|
| 811 |
+
image: url(icons/bottombar_textblock.svg);
|
| 812 |
+
}
|
| 813 |
+
|
| 814 |
+
DrawToolCheckBox#DrawRectTool::indicator:checked {
|
| 815 |
+
image: url(icons/bottombar_textblock_activate.svg);
|
| 816 |
+
}
|
| 817 |
+
|
| 818 |
+
GlobalSearchWidget {
|
| 819 |
+
border-color: @borderColor;
|
| 820 |
+
border-style: solid;
|
| 821 |
+
border-width: 1px;
|
| 822 |
+
}
|
| 823 |
+
|
| 824 |
+
QScrollArea {
|
| 825 |
+
border-color: @borderColor;
|
| 826 |
+
border-style: solid;
|
| 827 |
+
border-width: 1px;
|
| 828 |
+
}
|
| 829 |
+
|
| 830 |
+
TextEditListScrollArea {
|
| 831 |
+
border-left: 0px;
|
| 832 |
+
border-right: 0px;
|
| 833 |
+
border-bottom: 0px;
|
| 834 |
+
}
|
| 835 |
+
|
| 836 |
+
PresetListWidget {
|
| 837 |
+
min-height: 280px;
|
| 838 |
+
}
|
| 839 |
+
|
| 840 |
+
ClickableLabel#PrevMatchBtn {
|
| 841 |
+
image: url(icons/arrow-up.svg);
|
| 842 |
+
min-width: 24px;
|
| 843 |
+
}
|
| 844 |
+
|
| 845 |
+
ClickableLabel#NextMatchBtn {
|
| 846 |
+
image: url(icons/arrow-down.svg);
|
| 847 |
+
min-width: 24px;
|
| 848 |
+
}
|
| 849 |
+
|
| 850 |
+
|
| 851 |
+
ClickableLabel#SearchCloseBtn {
|
| 852 |
+
image: url(icons/chrome-close.svg);
|
| 853 |
+
min-width: 24px;
|
| 854 |
+
}
|
| 855 |
+
|
| 856 |
+
QCheckBox#CaseSensitiveToggle::indicator {
|
| 857 |
+
height: 24px;
|
| 858 |
+
width: 24px;
|
| 859 |
+
padding-top: 3px;
|
| 860 |
+
image: url(icons/case-sensitive.svg);
|
| 861 |
+
}
|
| 862 |
+
|
| 863 |
+
QCheckBox#CaseSensitiveToggle::indicator:hover {
|
| 864 |
+
background-color: rgba(127, 127, 127, 20%);
|
| 865 |
+
}
|
| 866 |
+
|
| 867 |
+
QCheckBox#CaseSensitiveToggle::indicator:checked {
|
| 868 |
+
image: url(icons/case-sensitive_activated.svg);
|
| 869 |
+
}
|
| 870 |
+
|
| 871 |
+
QCheckBox#WholeWordToggle::indicator {
|
| 872 |
+
height: 24px;
|
| 873 |
+
width: 24px;
|
| 874 |
+
image: url(icons/whole-word.svg);
|
| 875 |
+
}
|
| 876 |
+
|
| 877 |
+
QCheckBox#WholeWordToggle::indicator:checked {
|
| 878 |
+
image: url(icons/whole-word_activate.svg);
|
| 879 |
+
}
|
| 880 |
+
|
| 881 |
+
QCheckBox#WholeWordToggle::indicator:hover {
|
| 882 |
+
background-color: rgba(127, 127, 127, 20%);
|
| 883 |
+
}
|
| 884 |
+
|
| 885 |
+
QCheckBox#RegexToggle::indicator {
|
| 886 |
+
height: 24px;
|
| 887 |
+
width: 24px;
|
| 888 |
+
image: url(icons/regex.svg);
|
| 889 |
+
}
|
| 890 |
+
|
| 891 |
+
QCheckBox#RegexToggle::indicator:checked {
|
| 892 |
+
image: url(icons/regex_activate.svg);
|
| 893 |
+
}
|
| 894 |
+
|
| 895 |
+
QCheckBox#RegexToggle::indicator:hover {
|
| 896 |
+
background-color: rgba(127, 127, 127, 20%);
|
| 897 |
+
}
|
| 898 |
+
|
| 899 |
+
SearchEditor {
|
| 900 |
+
height: 32px;
|
| 901 |
+
}
|
| 902 |
+
|
| 903 |
+
ClickableLabel#ReplaceBtn {
|
| 904 |
+
image: url(icons/replace.svg);
|
| 905 |
+
min-width: 24px;
|
| 906 |
+
min-height: 24px;
|
| 907 |
+
}
|
| 908 |
+
|
| 909 |
+
ClickableLabel#ReplaceAllBtn {
|
| 910 |
+
image: url(icons/replace-all.svg);
|
| 911 |
+
min-width: 24px;
|
| 912 |
+
min-height: 24px;
|
| 913 |
+
}
|
| 914 |
+
|
| 915 |
+
ClickableLabel#SalaDict {
|
| 916 |
+
image: url(icons/saladict.png);
|
| 917 |
+
max-width: 24px;
|
| 918 |
+
height: 24px;
|
| 919 |
+
}
|
| 920 |
+
|
| 921 |
+
ClickableLabel#SearchInternet {
|
| 922 |
+
image: url(icons/search.svg);
|
| 923 |
+
max-width: 24px;
|
| 924 |
+
height: 24px;
|
| 925 |
+
}
|
| 926 |
+
|
| 927 |
+
TitleBarToolBtn {
|
| 928 |
+
padding-left: 4px;
|
| 929 |
+
padding-right: 4px;
|
| 930 |
+
border-style: none;
|
| 931 |
+
font-size: 15px;
|
| 932 |
+
color: @titleBarColor;
|
| 933 |
+
}
|
| 934 |
+
|
| 935 |
+
TitleBarToolBtn::hover {
|
| 936 |
+
background-color: rgb(30, 147, 229);
|
| 937 |
+
color: whitesmoke;
|
| 938 |
+
}
|
| 939 |
+
|
| 940 |
+
TitleBarToolBtn::menu-indicator
|
| 941 |
+
{
|
| 942 |
+
width:0px;
|
| 943 |
+
}
|
| 944 |
+
|
| 945 |
+
QProgressBar {
|
| 946 |
+
border: 0px;
|
| 947 |
+
text-align: center;
|
| 948 |
+
max-height: 3px;
|
| 949 |
+
background-color: @borderColor;
|
| 950 |
+
}
|
| 951 |
+
QProgressBar::chunk {
|
| 952 |
+
background-color: rgb(30, 147, 229);
|
| 953 |
+
}
|
| 954 |
+
|
| 955 |
+
|
| 956 |
+
TextAreaStyleButton {
|
| 957 |
+
width: 15px;
|
| 958 |
+
height: 15px;
|
| 959 |
+
border-radius: 10px;
|
| 960 |
+
padding: 5px;
|
| 961 |
+
background-color: @widgetBackgroundColor;
|
| 962 |
+
}
|
| 963 |
+
|
| 964 |
+
TextAreaStyleButton#NewTextStyleButton {
|
| 965 |
+
image: url(icons/add.svg);
|
| 966 |
+
}
|
| 967 |
+
|
| 968 |
+
TextAreaStyleButton#ClearTextStyleButton {
|
| 969 |
+
image: url(icons/titlebar_close.svg);
|
| 970 |
+
}
|
| 971 |
+
|
| 972 |
+
TextAreaStyleButton#ClearTextStyleButton::hover {
|
| 973 |
+
background-color: #FF605C;
|
| 974 |
+
}
|
| 975 |
+
|
| 976 |
+
TextAreaStyleButton::hover {
|
| 977 |
+
background-color: #cad7ed;
|
| 978 |
+
}
|
| 979 |
+
|
| 980 |
+
HidePanelButton {
|
| 981 |
+
width: 12px;
|
| 982 |
+
height: 12px;
|
| 983 |
+
padding: 3px;
|
| 984 |
+
border: none;
|
| 985 |
+
background-color: @widgetBackgroundColor;
|
| 986 |
+
image: url(icons/titlebar_close.svg);
|
| 987 |
+
}
|
| 988 |
+
|
| 989 |
+
HidePanelButton::hover {
|
| 990 |
+
background-color: #FF605C;
|
| 991 |
+
}
|
| 992 |
+
|
| 993 |
+
PanelAreaContent {
|
| 994 |
+
background-color : @emptyContentBackgroundColor;
|
| 995 |
+
border-radius: 7px;
|
| 996 |
+
border: none;
|
| 997 |
+
border-width: 0px;
|
| 998 |
+
}
|
| 999 |
+
|
| 1000 |
+
PanelArea {
|
| 1001 |
+
background-color : @emptyContentBackgroundColor;
|
| 1002 |
+
border-radius: 7px;
|
| 1003 |
+
border: none;
|
| 1004 |
+
border-width: 0px;
|
| 1005 |
+
}
|
| 1006 |
+
|
| 1007 |
+
|
| 1008 |
+
PanelGroupBox {
|
| 1009 |
+
border: 1px solid @borderColor;
|
| 1010 |
+
margin-top: 6px;
|
| 1011 |
+
background-color : @emptyContentBackgroundColor;
|
| 1012 |
+
border-left: none;
|
| 1013 |
+
border-right: none;
|
| 1014 |
+
border-bottom: none;
|
| 1015 |
+
border-radius: 7px;
|
| 1016 |
+
}
|
| 1017 |
+
|
| 1018 |
+
PanelGroupBox::title {
|
| 1019 |
+
subcontrol-origin: margin;
|
| 1020 |
+
/* left: 12px; */
|
| 1021 |
+
padding: 0px 5px 0px 10px;
|
| 1022 |
+
}
|
| 1023 |
+
|
| 1024 |
+
|
| 1025 |
+
TextStyleLabel {
|
| 1026 |
+
border-radius: 7px;
|
| 1027 |
+
}
|
| 1028 |
+
|
| 1029 |
+
SmallParamLabel {
|
| 1030 |
+
font-size: 12px;
|
| 1031 |
+
height: 20px;
|
| 1032 |
+
}
|
| 1033 |
+
|
| 1034 |
+
SmallComboBox {
|
| 1035 |
+
height: 20px;
|
| 1036 |
+
font-size: 12px;
|
| 1037 |
+
/* padding-left: 8px; */
|
| 1038 |
+
border: 1px solid @borderColor;
|
| 1039 |
+
background-color: @transtexteditBackgroundColor;
|
| 1040 |
+
}
|
| 1041 |
+
|
| 1042 |
+
SmallConfigPutton {
|
| 1043 |
+
height: 20px;
|
| 1044 |
+
width: 20px;
|
| 1045 |
+
border: none;
|
| 1046 |
+
border-width: 0px;
|
| 1047 |
+
background-color: rgba(0, 0, 0, 0);
|
| 1048 |
+
}
|
| 1049 |
+
|
| 1050 |
+
SmallSizeComboBox {
|
| 1051 |
+
height: 20px;
|
| 1052 |
+
font-size: 12px;
|
| 1053 |
+
/* padding-left: 8px; */
|
| 1054 |
+
border: 1px solid @borderColor;
|
| 1055 |
+
background-color: @transtexteditBackgroundColor;
|
| 1056 |
+
}
|
| 1057 |
+
|
| 1058 |
+
ArrowLeftButton {
|
| 1059 |
+
image: url(icons/arrow-left.svg);
|
| 1060 |
+
border: none;
|
| 1061 |
+
background-color: rgba(0, 0, 0, 0);
|
| 1062 |
+
border-radius: 7px;
|
| 1063 |
+
}
|
| 1064 |
+
|
| 1065 |
+
ArrowRightButton {
|
| 1066 |
+
image: url(icons/arrow-right.svg);
|
| 1067 |
+
border: none;
|
| 1068 |
+
background-color: rgba(0, 0, 0, 0);
|
| 1069 |
+
border-radius: 7px;
|
| 1070 |
+
}
|
| 1071 |
+
|
| 1072 |
+
DeleteStyleButton {
|
| 1073 |
+
border: none;
|
| 1074 |
+
background-color: rgba(0, 0, 0, 0);
|
| 1075 |
+
border-radius: 7px;
|
| 1076 |
+
}
|
| 1077 |
+
|
| 1078 |
+
DeleteStyleButton::hover {
|
| 1079 |
+
background-color: #FF605C;
|
| 1080 |
+
}
|
config/themes.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"eva-light": {
|
| 3 |
+
"@borderColor": "#b3b6bf",
|
| 4 |
+
"@qwidgetForegroundColor": "#5d5d5f",
|
| 5 |
+
"@widgetBackgroundColor": "#ebeef5",
|
| 6 |
+
"@emptyContentBackgroundColor": "#e1e4eb",
|
| 7 |
+
"@titleBarColor": "#6d6d6f",
|
| 8 |
+
"@pushBtnBackgroundColor": "rgba(198, 201, 207, 50%)",
|
| 9 |
+
"@noboderPushBtnBackgroundColor": "rgb(198, 201, 207)",
|
| 10 |
+
"@transtexteditBackgroundColor": "whitesmoke",
|
| 11 |
+
"@sliderHandleColor" : "#555560",
|
| 12 |
+
"@scrollBarBackground": "rgba(0, 0, 0, 30)",
|
| 13 |
+
"@scrollBarColor": "rgba(0, 0, 0, 30)",
|
| 14 |
+
"@scrollBarHoverColor": "rgba(0, 0, 0, 50)"
|
| 15 |
+
},
|
| 16 |
+
"eva-dark": {
|
| 17 |
+
"@borderColor": "#535671",
|
| 18 |
+
"@qwidgetForegroundColor": "#8e99b1",
|
| 19 |
+
"@qwidgetBackgroundColor": "#282c34",
|
| 20 |
+
"@widgetBackgroundColor": "#282c34",
|
| 21 |
+
"@emptyContentBackgroundColor": "#21252b",
|
| 22 |
+
"@titleBarColor": "#8c97af",
|
| 23 |
+
"@pushBtnBackgroundColor": "#21252b",
|
| 24 |
+
"@noboderPushBtnBackgroundColor": "#191d24",
|
| 25 |
+
"@transtexteditBackgroundColor": "#191d24",
|
| 26 |
+
"@sliderHandleColor" : "#96a4cd",
|
| 27 |
+
"@scrollBarBackground": "rgba(0, 0, 0, 30)",
|
| 28 |
+
"@scrollBarColor": "rgba(127, 127, 127, 100)",
|
| 29 |
+
"@scrollBarHoverColor": "rgba(127, 127, 127, 200)"
|
| 30 |
+
}
|
| 31 |
+
}
|
data/pkusegscores.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"n": {"n": 0.0622, "t": 0, "s": 0, "f": 0.0405, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.1921, "a": 0, "z": 0, "d": 0.0891, "p": 0.0258, "c": 0.0228, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "t": {"n": 0.0736, "t": 1, "s": 0, "f": 0.027, "m": 0, "q": 0, "b": 0, "r": 0.172, "v": 0.2027, "a": 0, "z": 0, "d": 0.1426, "p": 0.0384, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "s": {"n": 0.0578, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.3442, "a": 0, "z": 0, "d": 0.102, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "f": {"n": 0.0501, "t": 0, "s": 0, "f": 0, "m": 0.0305, "q": 0, "b": 0, "r": 0.0302, "v": 0.2821, "a": 0, "z": 0, "d": 0.0829, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "m": {"n": 0.2381, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0.4929, "b": 0, "r": 0, "v": 0.0675, "a": 0.0355, "z": 0, "d": 0.0297, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "q": {"n": 0.4815, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0.0329, "v": 0.0943, "a": 0.0826, "z": 0, "d": 0.0447, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "b": {"n": 0.3708, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.026, "a": 0, "z": 0, "d": 0, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0.0207, "vx": 0, "ad": 0, "an": 0}, "r": {"n": 0.1064, "t": 0, "s": 0, "f": 0, "m": 0.0341, "q": 0, "b": 0, "r": 0.0441, "v": 0.2954, "a": 0.027, "z": 0, "d": 0.1562, "p": 0.0429, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "v": {"n": 0.1081, "t": 0, "s": 0, "f": 0, "m": 0.0432, "q": 0, "b": 0, "r": 0.1591, "v": 0.1757, "a": 0.0224, "z": 0, "d": 0.036, "p": 0.0421, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "a": {"n": 0.1464, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.0333, "a": 0.0281, "z": 0, "d": 0, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "z": {"n": 0.0737, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.1117, "a": 0.0306, "z": 0, "d": 0, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "d": {"n": 0, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0.0313, "v": 0.5905, "a": 0.1047, "z": 0, "d": 0.1317, "p": 0.0626, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "p": {"n": 0.2263, "t": 0.0201, "s": 0.034, "f": 0, "m": 0.0314, "q": 0, "b": 0, "r": 0.4427, "v": 0.0835, "a": 0.0232, "z": 0, "d": 0, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0.0318, "ns": 0.0314, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "c": {"n": 0.1367, "t": 0, "s": 0, "f": 0, "m": 0.0253, "q": 0, "b": 0, "r": 0.2692, "v": 0.2089, "a": 0.0321, "z": 0, "d": 0.108, "p": 0.0514, "c": 0.0296, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0.0274, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "u": {"n": 0.5251, "t": 0, "s": 0, "f": 0, "m": 0.043, "q": 0, "b": 0, "r": 0.0581, "v": 0.0781, "a": 0.0424, "z": 0, "d": 0.0276, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0.0414, "vx": 0, "ad": 0, "an": 0}, "y": {"n": 0, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0, "a": 0, "z": 0, "d": 0, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "e": {"n": 0, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0, "a": 0, "z": 0, "d": 0, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "o": {"n": 0, "t": 0, "s": 0, "f": 0, "m": 0.0412, "q": 0, "b": 0, "r": 0, "v": 0.1031, "a": 0, "z": 0, "d": 0, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "i": {"n": 0, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.0205, "a": 0, "z": 0, "d": 0, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "l": {"n": 0.0289, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.0433, "a": 0, "z": 0, "d": 0.0409, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "j": {"n": 0.2866, "t": 0, "s": 0, "f": 0.0258, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.0789, "a": 0, "z": 0, "d": 0.0304, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0.1251, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0.1348, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "h": {"n": 0.5789, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0.0351, "v": 0.0526, "a": 0.1228, "z": 0, "d": 0.0526, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0.0351, "vx": 0, "ad": 0, "an": 0}, "k": {"n": 0.0236, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0.0236, "v": 0.2505, "a": 0, "z": 0, "d": 0.1234, "p": 0.0526, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "g": {}, "x": {}, "w": {"n": 0.0859, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0.2504, "v": 0.1699, "a": 0, "z": 0, "d": 0.1199, "p": 0.0597, "c": 0.1215, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0.0376, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "nr": {"n": 0.1627, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.1824, "a": 0, "z": 0, "d": 0.0654, "p": 0.0393, "c": 0.0417, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0.1234, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "ns": {"n": 0.2905, "t": 0, "s": 0.0305, "f": 0.0397, "m": 0.0257, "q": 0, "b": 0, "r": 0, "v": 0.1452, "a": 0, "z": 0, "d": 0.0317, "p": 0, "c": 0.0274, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0.03, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "nt": {"n": 0.2051, "t": 0, "s": 0, "f": 0.0897, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.2436, "a": 0, "z": 0, "d": 0, "p": 0.0385, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0.0256, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0.0513, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "nx": {"n": 1.0, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0, "a": 0, "z": 0, "d": 0, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "nz": {"n": 0.3944, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.0646, "a": 0, "z": 0, "d": 0.0347, "p": 0, "c": 0.0221, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "vd": {"n": 0, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.7857, "a": 0, "z": 0, "d": 0.119, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "vn": {"n": 0.2322, "t": 0, "s": 0, "f": 0.0323, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.0619, "a": 0, "z": 0, "d": 0.0467, "p": 0, "c": 0.033, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0.0201, "vx": 0, "ad": 0, "an": 0}, "vx": {"n": 0.0396, "t": 0, "s": 0, "f": 0, "m": 0.0223, "q": 0, "b": 0, "r": 0.1609, "v": 0, "a": 0.052, "z": 0, "d": 0.0223, "p": 0, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0.4728, "vx": 0, "ad": 0, "an": 0.047}, "ad": {"n": 0, "t": 0, "s": 0, "f": 0, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.844, "a": 0.0336, "z": 0, "d": 0.0519, "p": 0.0528, "c": 0, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}, "an": {"n": 0, "t": 0, "s": 0, "f": 0.0246, "m": 0, "q": 0, "b": 0, "r": 0, "v": 0.1258, "a": 0, "z": 0, "d": 0.0912, "p": 0, "c": 0.0629, "u": 1, "y": 1, "e": 0, "o": 0, "i": 0, "l": 0, "j": 0, "h": 0, "k": 0, "g": 0, "x": 0, "w": 1, "nr": 0, "ns": 0, "nt": 0, "nx": 0, "nz": 0, "vd": 0, "vn": 0, "vx": 0, "ad": 0, "an": 0}}
|
doc/CHANGELOG.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Changelogs
|
| 2 |
+
|
| 3 |
+
### 2023-04-15
|
| 4 |
+
支持从某些源站下载/更新图片,感谢[ROKOLYT](https://github.com/ROKOLYT)
|
| 5 |
+
|
| 6 |
+
### 2023-02-27
|
| 7 |
+
[v1.3.34](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.34) 发布
|
| 8 |
+
1. 修复繁体直排bug (#96)
|
| 9 |
+
2. 彩云和deepl目标语言支持繁体 (#100)
|
| 10 |
+
3. 支持读取.webp图片 (#85)
|
| 11 |
+
|
| 12 |
+
### 2023-02-23
|
| 13 |
+
[v1.3.30](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.30) 发布
|
| 14 |
+
1. 从PyQt5换到PyQt6以支持更好的嵌字预览, [避免PyQt5与nuitka的线程兼容性问题](https://github.com/Nuitka/Nuitka/issues/251)
|
| 15 |
+
2. 支持改变嵌字层透明度 (#88) 注意只是预览, 不会改变渲染结果, 嵌字透明度在右侧菜单效果里改
|
| 16 |
+
3. log文件写进data/logs
|
| 17 |
+
|
| 18 |
+
### 2023-01-27
|
| 19 |
+
[v1.3.26](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.26) 发布
|
| 20 |
+
1. 选中文本迷你菜单支持*聚合词典专业划词翻译*[沙拉查词](https://saladict.crimx.com): [安装说明](doc/saladict_chs.md)
|
| 21 |
+
<img src = "./src/saladict_doc.jpg">
|
| 22 |
+
|
| 23 |
+
2. 支持替换OCR和机翻结果中的关键字, 见编辑菜单或设置面板 [#78](https://github.com/dmMaze/BallonsTranslator/issues/78)
|
| 24 |
+
3. 支持拖拽导入文件夹 [#77](https://github.com/dmMaze/BallonsTranslator/issues/77)
|
| 25 |
+
4. 编辑文本时隐藏控制小方块 [#81](https://github.com/dmMaze/BallonsTranslator/issues/81)
|
| 26 |
+
5. 修Bug
|
| 27 |
+
|
| 28 |
+
### 2023-01-08
|
| 29 |
+
[v1.3.22](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.22) 发布
|
| 30 |
+
1. 支持删除并恢复被抹除文字
|
| 31 |
+
2. 支持角度复位
|
| 32 |
+
3. 修Bug
|
| 33 |
+
|
| 34 |
+
### 2022-12-30
|
| 35 |
+
[v1.3.20](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.20)发布
|
| 36 |
+
1. 适应具有极端宽高比的图片比如条漫
|
| 37 |
+
2. 支持粘贴到多个选中的文本编辑框
|
| 38 |
+
3. 修bug
|
| 39 |
+
4. OCR/翻译/修复选中文字区域, 填字样式会继承选中的文字框自己的
|
| 40 |
+
单行文本建议选用ctc_48px, 多行日文选mangocr, 目前对多行其它语言不太行, 需要重新训练检测模型
|
| 41 |
+
注意如果用**ctc_48px**要保证框在竖排模式下且尽可能贴合单行文本
|
| 42 |
+
<img src="./src/ocrselected.gif" div align=center>
|
| 43 |
+
|
| 44 |
+
### 2022-11-29
|
| 45 |
+
[v1.3.15](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.15)发布
|
| 46 |
+
1. 修bug
|
| 47 |
+
2. 优化保存逻辑
|
| 48 |
+
3. 画笔现在可以改成方形(实验)
|
| 49 |
+
|
| 50 |
+
### 2022-10-25
|
| 51 |
+
[v1.3.14](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.14)发布
|
| 52 |
+
1. 修bug
|
| 53 |
+
|
| 54 |
+
### 2022-09-30
|
| 55 |
+
v1.3.13起支持深色模式: 视图->深色模式
|
| 56 |
+
|
| 57 |
+
### 2022-09-24
|
| 58 |
+
[v1.3.12](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.12)发布
|
| 59 |
+
|
| 60 |
+
1. 支持全局(Ctrl+G)/当前页(Ctrl+F)查找替换
|
| 61 |
+
2. 原来的文本编辑器局部撤销重做并入全局文本编辑撤销重做栈, 画板撤销重做现在和文本编辑分离
|
| 62 |
+
3. Word文档导入导出bug修复
|
| 63 |
+
4. 基于 https://github.com/zhiyiYo/PyQt-Frameless-Window 重写无边框窗口
|
| 64 |
+
|
| 65 |
+
### 2022-09-13
|
| 66 |
+
[v1.3.8](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.8)发布
|
| 67 |
+
|
| 68 |
+
1. 画笔工具修复及优化
|
| 69 |
+
2. 修正界面缩放
|
| 70 |
+
3. 支持添加自定义字体样式预设, 支持调整文字透明度和阴影, 详见https://github.com/dmMaze/BallonsTranslator/pull/38
|
| 71 |
+
4. 支持导入导出word文档, 支持打开*.json项目文件, 详见https://github.com/dmMaze/BallonsTranslator/pull/40
|
| 72 |
+
|
| 73 |
+
### 2022-08-31
|
| 74 |
+
[v1.3.4](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.4)发布
|
| 75 |
+
|
| 76 |
+
1. 添加离线日译英模型Sugoi Translator(仅日译英, 作者[mingshiba](https://www.patreon.com/mingshiba), 已获得集成授权), 感谢[@Snowad14](https://github.com/Snowad14)提供CT2转换模型
|
| 77 |
+
2. 来自[bropines](https://github.com/bropines)的俄语本地化支持
|
| 78 |
+
3. 文本编辑支持字距调节
|
| 79 |
+
4. 调整竖排符号及半角字符位置规则, 详见https://github.com/dmMaze/BallonsTranslator/pull/30
|
| 80 |
+
|
| 81 |
+
### 2022-08-17
|
| 82 |
+
[v1.3.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.0)发布
|
| 83 |
+
|
| 84 |
+
1. 修复DeepL翻译器的bug, 感谢[@Snowad14](https://github.com/Snowad14)
|
| 85 |
+
2. 修复部分字体偏小+轮廓导致看不清的问题
|
| 86 |
+
3. 支持**全局字体格式**(一键机翻字体格式): 在控制面板->嵌字菜单里将相应项从"由程序决定"改为"使用全局设置"后启用. 注意全局设置就是未编辑任何文本块时右侧字体格式面板的那些设置.
|
| 87 |
+
4. 添加**新的修复模型**: lama-mpe (默认启用)
|
| 88 |
+
5. 文本块支持多选和**批量调整格式** (ctrl+鼠标左键或者按下右键拉框框选)
|
| 89 |
+
6. 支持日译英, 英译中的**自动排版**, 基于提取出的背景气泡, 目标语言为中文时会自动断句(基于pkuseg). 勾选设置面板->常规->嵌字->自动排版后将对一键机翻生效(默认启用).
|
| 90 |
+
|
| 91 |
+
<img src="./src/multisel_autolayout.gif" div align=center>
|
| 92 |
+
<p align=center>
|
| 93 |
+
批量格式调整, 英译中自动断句分行
|
| 94 |
+
</p>
|
| 95 |
+
|
| 96 |
+
### 2022-05-19
|
| 97 |
+
[v1.2.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.2.0)发布
|
| 98 |
+
|
| 99 |
+
1. 支持DeepL翻译器, 感谢[@Snowad14](https://github.com/Snowad14)
|
| 100 |
+
2. 增加来自manga-image-translator的新OCR模型, 支持韩语识别
|
| 101 |
+
3. 修bug
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
### 2022-04-17
|
| 105 |
+
[v1.1.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.1.0)发布
|
| 106 |
+
|
| 107 |
+
1. 用qthread存编辑图片, 避免翻页卡顿
|
| 108 |
+
2. 图像修复策略优化:
|
| 109 |
+
- 修复算法和**CPU模式**下的修复模型输入由整张图片改为文本块
|
| 110 |
+
- 可选由程序自动评估当前块是否有必要调用开销大的修复方法, 在设置-图像修复启用/禁用, 启用后纯色背景对话泡将会由计算出的背景色直接填充
|
| 111 |
+
|
| 112 |
+
优化后图像修复阶段速度提升至原来的2x-5x不等
|
| 113 |
+
|
| 114 |
+
3. 添加矩形工具
|
| 115 |
+
4. 更多快捷键
|
| 116 |
+
5. 修bug
|
| 117 |
+
|
| 118 |
+
### 2022-04-09
|
| 119 |
+
v1.0.0发布
|
doc/CHANGELOG_EN.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Changelogs
|
| 2 |
+
|
| 3 |
+
### 2023-04-15
|
| 4 |
+
Src download implementation based on gallery-dl (#131) thanks to [ROKOLYT](https://github.com/ROKOLYT)
|
| 5 |
+
|
| 6 |
+
### 2023-02-27
|
| 7 |
+
[v1.3.34](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.34) released
|
| 8 |
+
1. fix incorrect orientation assignment for CHT (#96)
|
| 9 |
+
2. convert CHS to CHT if it is required for Caiyun & DeepL (#100)
|
| 10 |
+
3. support for webp (#85)
|
| 11 |
+
|
| 12 |
+
### 2023-02-23
|
| 13 |
+
[v1.3.30](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.30) released
|
| 14 |
+
1. Migrate to PyQt6 for better text rendering preview and [compatibility](https://github.com/Nuitka/Nuitka/issues/251) with nuitka
|
| 15 |
+
2. Support set transparency of text layer (#88)
|
| 16 |
+
3. Dump logs to data/logs
|
| 17 |
+
|
| 18 |
+
### 2023-01-27
|
| 19 |
+
[v1.3.26](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.26) released
|
| 20 |
+
1. Add support for [saladict](https://saladict.crimx.com) (*All-in-one professional pop-up dictionary and page translator*) in the mini menu on text selection. [Installation guide](doc/saladict.md)
|
| 21 |
+
<img src = "./src/saladict_doc.jpg">
|
| 22 |
+
|
| 23 |
+
2. Support keyword substitution for OCR & machine translation results [#78](https://github.com/dmMaze/BallonsTranslator/issues/78): Edit -> ```Keyword substitution for machine translation```
|
| 24 |
+
3. Support import folder with drag&drop [#77](https://github.com/dmMaze/BallonsTranslator/issues/77)
|
| 25 |
+
4. Hide control blocks on start text editing. [#81](https://github.com/dmMaze/BallonsTranslator/issues/81)
|
| 26 |
+
5. Bugfix
|
| 27 |
+
|
| 28 |
+
### 2023-01-08
|
| 29 |
+
[v1.3.22](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.22) released
|
| 30 |
+
1. Support delete and restore removed text
|
| 31 |
+
2. Support reset angle
|
| 32 |
+
3. Bugfixes
|
| 33 |
+
|
| 34 |
+
### 2022-12-31
|
| 35 |
+
[v1.3.20](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.20) released
|
| 36 |
+
1. Adapted to images with extreme aspect ratio such as webtoons
|
| 37 |
+
2. Support paste text to multiple selected Text blocks.
|
| 38 |
+
3. Bugfixes
|
| 39 |
+
4. OCR/Translate/Inpaint selected text blocks
|
| 40 |
+
lettering style will inherit from corresponding selected block.
|
| 41 |
+
ctc_48px is more recommended for single line text, mangocr for multi-line Japanese, need to retrain detection model make ctc48_px generalize to multi-lines
|
| 42 |
+
Note that if you use **ctc_48px** make sure that the box is in vertical mode and fits as close to the single line of text as possible
|
| 43 |
+
<img src="./src/ocrselected.gif" div align=center>
|
| 44 |
+
|
| 45 |
+
### 2022-11-29
|
| 46 |
+
[v1.3.15](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.15) released
|
| 47 |
+
1. Bugfixes
|
| 48 |
+
2. Optimize saving logic
|
| 49 |
+
3. The shape of Pen/Inpaint tool can be set to rectangle (experimental)
|
| 50 |
+
|
| 51 |
+
### 2022-10-25
|
| 52 |
+
[v1.3.14](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.14) released
|
| 53 |
+
1. Bugfixes
|
| 54 |
+
|
| 55 |
+
### 2022-09-30
|
| 56 |
+
Support Dark Mode since v1.3.13: View->Dark Mode
|
| 57 |
+
|
| 58 |
+
### 2022-09-24
|
| 59 |
+
[v1.3.12](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.12) released
|
| 60 |
+
|
| 61 |
+
1. Support global Search(Ctrl+G) and search current page(Ctrl+F).
|
| 62 |
+
2. Local redo stack of each texteditor are merged into a main text-edit stack, text-edit stack is split from drawing board's now.
|
| 63 |
+
3. Word doc import/export bugfixes
|
| 64 |
+
4. Frameless window rework based on https://github.com/zhiyiYo/PyQt-Frameless-Window
|
| 65 |
+
|
| 66 |
+
### 2022-09-13
|
| 67 |
+
[v1.3.8](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.8) released
|
| 68 |
+
|
| 69 |
+
1. Pen tool bug fixes & optimization
|
| 70 |
+
2. Fix scaling
|
| 71 |
+
3. Support making font style presets, text graphical effects(shadow & opacity), see https://github.com/dmMaze/BallonsTranslator/pull/38
|
| 72 |
+
4. Support word document(*.docx) import/export: https://github.com/dmMaze/BallonsTranslator/pull/40
|
| 73 |
+
|
| 74 |
+
### 2022-08-31
|
| 75 |
+
[v1.3.4](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.4) released
|
| 76 |
+
|
| 77 |
+
1. Add Sugoi Translator(Japanese-English only, created & authorized by [mingshiba](https://www.patreon.com/mingshiba)): download the [model](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm) converted by [@Snowad14](https://github.com/Snowad14) and put "sugoi_translator" in the "data" folder.
|
| 78 |
+
2. Add support for russian, thanks to [bropines](https://github.com/bropines)
|
| 79 |
+
3. Support letter spacing adjustment.
|
| 80 |
+
4. Vertical type rework & text rendering bug fixes: https://github.com/dmMaze/BallonsTranslator/pull/30
|
| 81 |
+
|
| 82 |
+
### 2022-08-17
|
| 83 |
+
[v1.3.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.0) released
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
1. Fix deepl translator, thanks to [@Snowad14](https://github.com/Snowad14)
|
| 87 |
+
2. Fix font size & stroke bug which makes text unreadable
|
| 88 |
+
3. Support **global font format** (determine the font format settings used by auto-translation mode): in config panel->Typesetting, 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.
|
| 89 |
+
4. Add **new inpainting model**: lama-mpe and set it as default.
|
| 90 |
+
5. Support multiple textblocks selection & formatting.
|
| 91 |
+
6. Improved manga->English, English->Chinese typesetting (**Auto-layout** in Config panel->Typesetting, enabled by default), it can also be applied to selected text blocks use the option in the right-click menu.
|
| 92 |
+
|
| 93 |
+
<img src="./src/multisel_autolayout.gif" div align=center>
|
| 94 |
+
<p align=center>
|
| 95 |
+
batch text formatting & auto layout
|
| 96 |
+
</p>
|
| 97 |
+
|
| 98 |
+
### 2022-05-19
|
| 99 |
+
[v1.2.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.2.0) released
|
| 100 |
+
|
| 101 |
+
1. Support DeepL, thanks to [@Snowad14](https://github.com/Snowad14)
|
| 102 |
+
2. Add new ocr model from manga-image-translator, support korean recognition
|
| 103 |
+
3. Bugfixes
|
| 104 |
+
|
| 105 |
+
### 2022-04-17
|
| 106 |
+
|
| 107 |
+
[v1.1.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.1.0) released
|
| 108 |
+
1. use qthread to write edited images to avoid freezing when turning pages.
|
| 109 |
+
2. optimized inpainting policy
|
| 110 |
+
3. add rect tool
|
| 111 |
+
4. More shortcuts
|
| 112 |
+
5. Bugfixes
|
| 113 |
+
|
| 114 |
+
### 2022-04-09
|
| 115 |
+
|
| 116 |
+
1. v1.0.0 released
|
doc/CHANGELOG_PT-BR.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Changelogs
|
| 2 |
+
|
| 3 |
+
### 15/04/2023
|
| 4 |
+
Implementação de download de origem baseada em gallery-dl (#131) graças a [ROKOLYT](https://github.com/ROKOLYT)
|
| 5 |
+
|
| 6 |
+
### 27/02/2023
|
| 7 |
+
[v1.3.34](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.34) lançado
|
| 8 |
+
1. Corrige atribuição incorreta de orientação para CHT (#96)
|
| 9 |
+
2. Converte CHS para CHT se necessário para Caiyun e DeepL (#100)
|
| 10 |
+
3. Suporte para webp (#85)
|
| 11 |
+
|
| 12 |
+
### 23/02/2023
|
| 13 |
+
[v1.3.30](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.30) lançado
|
| 14 |
+
1. Migração para PyQt6 para melhor pré-visualização de renderização de texto e [compatibilidade](https://github.com/Nuitka/Nuitka/issues/251) com nuitka
|
| 15 |
+
2. Suporte para definir transparência da camada de texto (#88)
|
| 16 |
+
3. Exportação de logs para data/logs
|
| 17 |
+
|
| 18 |
+
### 27 de Janeiro de 2023
|
| 19 |
+
**[v1.3.26](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.26) lançado**
|
| 20 |
+
1. Adicionado suporte ao [saladict](https://saladict.crimx.com) (*Dicionário pop-up profissional e tradutor de páginas tudo-em-um*) no mini menu de seleção de texto. [Guia de Instalação](doc/saladict.md)
|
| 21 |
+
<img src = "./src/saladict_doc.jpg">
|
| 22 |
+
|
| 23 |
+
2. Adicionado substituição de palavras-chave para resultados de OCR e tradução automática [#78](https://github.com/dmMaze/BallonsTranslator/issues/78): Editar -> "Substituição de palavras-chave para tradução automática"
|
| 24 |
+
3. Adicionado importação de pastas por arrastar e soltar [#77](https://github.com/dmMaze/BallonsTranslator/issues/77)
|
| 25 |
+
4. Ocultar blocos de controle ao iniciar a edição de texto. [#81](https://github.com/dmMaze/BallonsTranslator/issues/81)
|
| 26 |
+
5. Correção de bugs
|
| 27 |
+
|
| 28 |
+
### 08 de Janeiro de 2023
|
| 29 |
+
**[v1.3.22](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.22) lançado**
|
| 30 |
+
1. Adicionado suporte para excluir e restaurar texto removido
|
| 31 |
+
2. Adicionado suporte para redefinir o ângulo
|
| 32 |
+
3. Correção de bugs
|
| 33 |
+
|
| 34 |
+
### 31 de Dezembro de 2022
|
| 35 |
+
**[v1.3.20](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.20) lançado**
|
| 36 |
+
1. Adaptado para imagens com proporção extrema, como webtoons
|
| 37 |
+
2. Adicionado suporte para colar texto em vários blocos de texto selecionados
|
| 38 |
+
3. Correção de bugs
|
| 39 |
+
4. OCR/Tradução/Inpainting de blocos de texto selecionados: O estilo da letra herdará do bloco selecionado correspondente. ctc_48px é mais recomendado para texto de linha única, mangocr para japonês de várias linhas; é necessário retreinar o modelo de detecção para que ctc48_px seja generalizado para várias linhas. Observe que, se você usar **ctc_48px**, certifique-se de que a caixa esteja no modo vertical e se ajuste o mais próximo possível da linha única de texto.
|
| 40 |
+
<img src="./src/ocrselected.gif" div align=center>
|
| 41 |
+
|
| 42 |
+
### 29 de Novembro de 2022
|
| 43 |
+
**[v1.3.15](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.15) lançado**
|
| 44 |
+
1. Correção de bugs
|
| 45 |
+
2. Otimização da lógica de salvamento
|
| 46 |
+
3. A forma da ferramenta Caneta/Inpaint pode ser definida como retângulo (experimental)
|
| 47 |
+
|
| 48 |
+
### 25 de Outubro de 2022
|
| 49 |
+
**[v1.3.14](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.14) lançado**
|
| 50 |
+
1. Correção de bugs
|
| 51 |
+
|
| 52 |
+
### 30 de Setembro de 2022
|
| 53 |
+
Suporte ao Modo Escuro desde a v1.3.13: Visualizar->Modo Escuro
|
| 54 |
+
|
| 55 |
+
### 24 de Setembro de 2022
|
| 56 |
+
**[v1.3.12](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.12) lançado**
|
| 57 |
+
1. Adicionado suporte para Pesquisa global (Ctrl+G) e pesquisa na página atual (Ctrl+F)
|
| 58 |
+
2. Pilhas de desfazer locais de cada editor de texto mescladas em uma pilha principal de edição de texto, agora separada da prancheta de desenho
|
| 59 |
+
3. Correção de bugs de importação/exportação de documentos do Word
|
| 60 |
+
4. Reformulação da janela sem moldura baseada em [https://github.com/zhiyiYo/PyQt-Frameless-Window](https://github.com/zhiyiYo/PyQt-Frameless-Window)
|
| 61 |
+
|
| 62 |
+
### 13 de Setembro de 2022
|
| 63 |
+
**[v1.3.8](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.8) lançado**
|
| 64 |
+
|
| 65 |
+
1. Correção de bugs e otimização da ferramenta Caneta
|
| 66 |
+
2. Correção de dimensionamento
|
| 67 |
+
3. Adicionado suporte para criação de predefinições de estilo de fonte e efeitos gráficos de texto (sombra e opacidade), veja [https://github.com/dmMaze/BallonsTranslator/pull/38](https://github.com/dmMaze/BallonsTranslator/pull/38)
|
| 68 |
+
4. Adicionado suporte para importação/exportação de documentos do Word (*.docx): [https://github.com/dmMaze/BallonsTranslator/pull/40](https://github.com/dmMaze/BallonsTranslator/pull/40)
|
| 69 |
+
|
| 70 |
+
### 31 de Agosto de 2022
|
| 71 |
+
**[v1.3.4](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.4) lançado**
|
| 72 |
+
|
| 73 |
+
1. Adicionado Sugoi Translator (apenas japonês-inglês, criado e autorizado por [mingshiba](https://www.patreon.com/mingshiba)): baixe o [modelo](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm) convertido por [@Snowad14](https://github.com/Snowad14) e coloque "sugoi_translator" na pasta "data".
|
| 74 |
+
2. Adicionado suporte para russo, graças a [bropines](https://github.com/bropines)
|
| 75 |
+
3. Adicionado ajuste de espaçamento entre letras
|
| 76 |
+
4. Reformulação do tipo vertical e correção de bugs de renderização de texto: [https://github.com/dmMaze/BallonsTranslator/pull/30](https://github.com/dmMaze/BallonsTranslator/pull/30)
|
| 77 |
+
|
| 78 |
+
### 17 de Agosto de 2022
|
| 79 |
+
**[v1.3.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.3.0) lançado**
|
| 80 |
+
|
| 81 |
+
1. Correção do tradutor DeepL, graças a [@Snowad14](https://github.com/Snowad14)
|
| 82 |
+
2. Correção de bug de tamanho e traçado de fonte que tornava o texto ilegível
|
| 83 |
+
3. Adicionado suporte para formato de fonte global (determina as configurações de formato de fonte usadas pelo modo de tradução automática): no painel de configuração->Diagramação, altere a opção correspondente de "decidir pelo programa" para "usar configuração global" para habilitar. Observe que as configurações globais são os formatos mostrados no painel de formato de fonte à direita quando você não está editando nenhum bloco de texto na cena.
|
| 84 |
+
4. Adicionado novo modelo de inpainting: lama-mpe e definido como padrão
|
| 85 |
+
5. Adicionado suporte para seleção e formatação de vários blocos de texto
|
| 86 |
+
6. Aprimorada a diagramação de mangá->inglês, inglês->chinês (**Layout automático** no painel de configuração->Diagramação, habilitado por padrão), também pode ser aplicado a blocos de texto selecionados usando a opção no menu do botão direito.
|
| 87 |
+
|
| 88 |
+
<img src="./src/multisel_autolayout.gif" div align=center>
|
| 89 |
+
<p align=center>
|
| 90 |
+
**formatação de texto em lote e auto layout**
|
| 91 |
+
</p>
|
| 92 |
+
|
| 93 |
+
### 19 de Maio de 2022
|
| 94 |
+
**[v1.2.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.2.0) lançado**
|
| 95 |
+
1. Adicionado suporte ao DeepL, graças a [@Snowad14](https://github.com/Snowad14)
|
| 96 |
+
2. Adicionado novo modelo OCR do manga-image-translator, com suporte a reconhecimento de coreano
|
| 97 |
+
3. Correção de bugs
|
| 98 |
+
|
| 99 |
+
### 17 de Abril de 2022
|
| 100 |
+
**[v1.1.0](https://github.com/dmMaze/BallonsTranslator/releases/tag/v1.1.0) lançado**
|
| 101 |
+
1. Utilização de qthread para gravar imagens editadas para evitar congelamento ao virar páginas
|
| 102 |
+
2. Otimização da política de inpainting
|
| 103 |
+
3. Adicionada ferramenta de retângulo
|
| 104 |
+
4. Mais atalhos
|
| 105 |
+
5. Correção de bugs
|
| 106 |
+
|
| 107 |
+
### 09 de Abril de 2022
|
| 108 |
+
|
| 109 |
+
1. v1.0.0 lançado
|
doc/Como_add_um_novo_tradutor.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/加别的翻译器.md) | [English](../doc/how_to_add_new_translator.md) | pt-BR | [Русский](../doc/add_translator_ru.md)
|
| 2 |
+
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
## Como Adicionar um Novo Tradutor ao BallonsTranslator
|
| 6 |
+
|
| 7 |
+
Se você sabe como utilizar a API do tradutor ou o modelo de tradução desejado em Python, siga os passos abaixo para integrá-lo ao BallonsTranslator.
|
| 8 |
+
|
| 9 |
+
### Implementação da Classe do Tradutor
|
| 10 |
+
|
| 11 |
+
Se você sabe como chamar a API do tradutor alvo ou modelo de tradução em Python, implemente uma classe em `ballontranslator/dl/translators.__init__.py` da seguinte forma para usá-la no aplicativo. O exemplo a seguir, DummyTranslator, está comentado em `ballontranslator/dl/translator/__init__.py` e pode ser descomentado para testar no programa.
|
| 12 |
+
|
| 13 |
+
1. **Crie uma nova classe em `ballontranslator/dl/translators/__init__.py`:**
|
| 14 |
+
|
| 15 |
+
```python
|
| 16 |
+
# "dummy translator" é o nome exibido no aplicativo
|
| 17 |
+
@register_translator('dummy translator')
|
| 18 |
+
class DummyTranslator(BaseTranslator):
|
| 19 |
+
|
| 20 |
+
concate_text = True
|
| 21 |
+
|
| 22 |
+
# parâmetros exibidos no painel de configuração.
|
| 23 |
+
# chaves são nomes dos parâmetros, se o tipo do valor for str, será um editor de texto (chave obrigatória)
|
| 24 |
+
# se o tipo do valor for dict, você precisa especificar o 'type' do parâmetro,
|
| 25 |
+
# o seguinte 'device' é um seletor, as opções são cpu e cuda, o padrão é cpu
|
| 26 |
+
params: Dict = {
|
| 27 |
+
'api_key': '',
|
| 28 |
+
'device': {
|
| 29 |
+
'type': 'selector',
|
| 30 |
+
'options': ['cpu', 'cuda'],
|
| 31 |
+
'value': 'cpu'
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
def _setup_translator(self):
|
| 36 |
+
'''
|
| 37 |
+
faça a configuração aqui.
|
| 38 |
+
as chaves de lang_map são aquelas opções de idiomas exibidas no aplicativo,
|
| 39 |
+
atribua as chaves de idioma correspondentes aceitas pela API aos idiomas suportados.
|
| 40 |
+
Apenas os idiomas suportados pelo tradutor são atribuídos aqui, este tradutor suporta apenas japonês e inglês.
|
| 41 |
+
Para uma lista completa de idiomas, veja LANGMAP_GLOBAL em translator.__init__
|
| 42 |
+
'''
|
| 43 |
+
self.lang_map['日本語'] = 'ja'
|
| 44 |
+
self.lang_map['English'] = 'en'
|
| 45 |
+
|
| 46 |
+
def _translate(self, src_list: List[str]) -> List[str]:
|
| 47 |
+
'''
|
| 48 |
+
faça a tradução aqui.
|
| 49 |
+
Este tradutor não faz nada além de retornar o texto original.
|
| 50 |
+
'''
|
| 51 |
+
source = self.lang_map[self.lang_source]
|
| 52 |
+
target = self.lang_map[self.lang_target]
|
| 53 |
+
|
| 54 |
+
translation = text
|
| 55 |
+
return translation
|
| 56 |
+
|
| 57 |
+
def updateParam(self, param_key: str, param_content):
|
| 58 |
+
'''
|
| 59 |
+
necessário apenas se algum estado precisar ser atualizado imediatamente após o usuário alterar os parâmetros do tradutor,
|
| 60 |
+
por exemplo, se este tradutor for um modelo pytorch, você pode convertê-lo para cpu/gpu aqui.
|
| 61 |
+
'''
|
| 62 |
+
super().updateParam(param_key, param_content)
|
| 63 |
+
if (param_key == 'device'):
|
| 64 |
+
# obtenha o estado atual dos parâmetros
|
| 65 |
+
# self.model.to(self.params['device']['value'])
|
| 66 |
+
pass
|
| 67 |
+
|
| 68 |
+
@property
|
| 69 |
+
def supported_tgt_list(self) -> List[str]:
|
| 70 |
+
'''
|
| 71 |
+
necessário apenas se o suporte a idiomas do tradutor for assimétrico,
|
| 72 |
+
por exemplo, este tradutor suporta apenas inglês -> japonês, não japonês -> inglês.
|
| 73 |
+
'''
|
| 74 |
+
return ['English']
|
| 75 |
+
|
| 76 |
+
@property
|
| 77 |
+
def supported_src_list(self) -> List[str]:
|
| 78 |
+
'''
|
| 79 |
+
necessário apenas se o suporte a idiomas do tradutor for assimétrico.
|
| 80 |
+
'''
|
| 81 |
+
return ['日本語']
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
- Decore a classe com `@register_translator` e forneça o nome do tradutor que será exibido na interface. No exemplo, o nome passado para o decorador é `'dummy translator'`, tome cuidado para não renomeá-lo com um tradutor existente.
|
| 85 |
+
- A classe deve herdar de `BaseTranslator`.
|
| 86 |
+
|
| 87 |
+
2. **Defina o atributo `concate_text`:**
|
| 88 |
+
|
| 89 |
+
```python
|
| 90 |
+
@register_translator('dummy translator')
|
| 91 |
+
class DummyTranslator(BaseTranslator):
|
| 92 |
+
concate_text = True # Se o tradutor aceitar apenas strings concatenadas
|
| 93 |
+
concate_text = False # Se o tradutor aceitar lista de strings ou modelo offline
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
- Indique se o tradutor aceita apenas texto concatenado (várias frases em uma única string) ou uma lista de strings.
|
| 97 |
+
- Se for um modelo offline ou uma API que aceita listas de strings, defina como `False`.
|
| 98 |
+
|
| 99 |
+
3. **Defina os parâmetros (opcional):**
|
| 100 |
+
|
| 101 |
+
```python
|
| 102 |
+
params: Dict = {
|
| 103 |
+
'api_key': '', # Editor de texto para a chave da API
|
| 104 |
+
'device': { # Seletor para CPU ou CUDA
|
| 105 |
+
'type': 'selector',
|
| 106 |
+
'options': ['cpu', 'cuda'],
|
| 107 |
+
'value': 'cpu'
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
- Crie um dicionário `params` se o tradutor precisar de parâmetros configuráveis pelo usuário. Se não, deixe em branco ou atribua `None`.
|
| 113 |
+
- As chaves do dicionário são os nomes dos parâmetros exibidos na interface. Se o tipo de valor correspondente for str, será exibido no aplicativo como um editor de texto, no exemplo acima, o api_key será um editor de texto com um valor padrão vazio.
|
| 114 |
+
- Os valores podem ser strings (para editores de texto) ou dicionários (neste caso deve ser descrito por 'type', como exemplo acima. O parâmetro 'device' será exibido como um seletor no aplicativo, opções válidas são 'cpu' e 'cuda).
|
| 115 |
+
|
| 116 |
+
<p align="center">
|
| 117 |
+
<img src="./src/new_translator.png">
|
| 118 |
+
</p>
|
| 119 |
+
<p align="center">
|
| 120 |
+
params exibidos no painel de configuração do aplicativo.
|
| 121 |
+
</p>
|
| 122 |
+
|
| 123 |
+
4. **Implemente o método `_setup_translator`:**
|
| 124 |
+
|
| 125 |
+
```python
|
| 126 |
+
def _setup_translator(self):
|
| 127 |
+
'''
|
| 128 |
+
faça a configuração aqui.
|
| 129 |
+
as chaves de lang_map são aquelas opções de idiomas exibidas no aplicativo,
|
| 130 |
+
atribua as chaves de idioma correspondentes aceitas pela API aos idiomas suportados.
|
| 131 |
+
Apenas os idiomas suportados pelo tradutor são atribuídos aqui, este tradutor suporta apenas japonês e inglês.
|
| 132 |
+
Para uma lista completa de idiomas, veja LANGMAP_GLOBAL em translator.__init__
|
| 133 |
+
'''
|
| 134 |
+
self.lang_map['日本語'] = 'ja'
|
| 135 |
+
self.lang_map['English'] = 'en'
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
- Realize a configuração do tradutor (inicialização de modelos, autenticação na API, etc.).
|
| 139 |
+
- Mapeie os idiomas exibidos no app para os códigos de idioma aceitos pela API.
|
| 140 |
+
- Consulte `LANGMAP_GLOBAL` em `translator.__init__` para a lista completa de idiomas.
|
| 141 |
+
|
| 142 |
+
5. **Implemente o método `_translate`:**
|
| 143 |
+
|
| 144 |
+
```python
|
| 145 |
+
def _translate(self, src_list: List[str]) -> List[str]:
|
| 146 |
+
'''
|
| 147 |
+
faça a tradução aqui.
|
| 148 |
+
Este tradutor não faz nada além de retornar o texto original.
|
| 149 |
+
'''
|
| 150 |
+
source = self.lang_map[self.lang_source]
|
| 151 |
+
target = self.lang_map[self.lang_target]
|
| 152 |
+
|
| 153 |
+
translation = text
|
| 154 |
+
return translation
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
- Recebe uma lista de strings (`src_list`) a serem traduzidas.
|
| 158 |
+
- Se `concate_text` for `True`, as strings serão concatenadas antes de serem passadas para o tradutor.
|
| 159 |
+
- Realiza a tradução utilizando a API ou modelo.
|
| 160 |
+
- Retorna uma lista com as strings traduzidas.
|
| 161 |
+
|
| 162 |
+
### Métodos Opcionais
|
| 163 |
+
|
| 164 |
+
- **`updateParam(self, param_key: str, param_content)`:**
|
| 165 |
+
- Implemente se precisar atualizar o estado do tradutor imediatamente após o usuário alterar os parâmetros.
|
| 166 |
+
|
| 167 |
+
- **`supported_tgt_list(self) -> List[str]`:**
|
| 168 |
+
- Implemente se o suporte de idiomas do tradutor for assimétrico (por exemplo, só traduz de inglês para japonês).
|
| 169 |
+
|
| 170 |
+
- **`supported_src_list(self) -> List[str]`:**
|
| 171 |
+
- Implemente se o suporte de idiomas do tradutor for assimétrico.
|
| 172 |
+
|
| 173 |
+
### Testes
|
| 174 |
+
|
| 175 |
+
Após implementar o tradutor, teste-o seguindo o exemplo em `tests/test_translators.py`.
|
doc/Como_añadir_un_nuevo_traductor.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/加别的翻译器.md) | [English](../doc/how_to_add_new_translator.md) | [pt-BR](../doc/Como_add_um_novo_tradutor.md)) | [Русский](../doc/add_translator_ru.md) | ESPAÑOL
|
| 2 |
+
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
## Cómo añadir un nuevo traductor a BallonsTranslator
|
| 6 |
+
|
| 7 |
+
Si sabe utilizar la API del traductor o el modelo de traducción deseado en Python, siga los pasos que se indican a continuación para integrarlo con BallonsTranslator.
|
| 8 |
+
|
| 9 |
+
### Implementación de la clase traductor
|
| 10 |
+
|
| 11 |
+
Si sabes cómo llamar a la API del traductor de destino o del modelo de traducción en Python, implementa una clase en `ballontranslator/dl/translators.__init__.py` como se indica a continuación para utilizarla en la aplicación. El siguiente ejemplo, DummyTranslator, está comentado en `ballontranslator/dl/translator/__init__.py` y puede descomentarse para probarlo en el programa.
|
| 12 |
+
|
| 13 |
+
1. **Crear una nueva clase en `ballontranslator/dl/translators/__init__.py`:**
|
| 14 |
+
|
| 15 |
+
```python
|
| 16 |
+
# "dummy translator" es el nombre que aparece en la aplicación
|
| 17 |
+
@register_translator('dummy translator')
|
| 18 |
+
class DummyTranslator(BaseTranslator):
|
| 19 |
+
|
| 20 |
+
concate_text = True
|
| 21 |
+
|
| 22 |
+
# parámetros mostrados en el panel de configuración.
|
| 23 |
+
# las claves son los nombres de los parámetros, si el tipo del valor es str, será un editor de texto (clave requerida)
|
| 24 |
+
# si el tipo del valor es dict, es necesario especificar el 'tipo' del parámetro,
|
| 25 |
+
# el siguiente 'device' es un selector, las opciones son cpu y cuda, por defecto es cpu
|
| 26 |
+
params: Dict = {
|
| 27 |
+
'api_key': '',
|
| 28 |
+
'device': {
|
| 29 |
+
'type': 'selector',
|
| 30 |
+
'options': ['cpu', 'cuda'],
|
| 31 |
+
'value': 'cpu'
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
def _setup_translator(self):
|
| 36 |
+
'''
|
| 37 |
+
configúrelo aquí.
|
| 38 |
+
las claves lang_map son las opciones de idioma que se muestran en la aplicación,
|
| 39 |
+
asigne las correspondientes claves de idioma aceptadas por la API a los idiomas soportados.
|
| 40 |
+
Aquí sólo se asignan los idiomas soportados por el traductor, este traductor sólo soporta japonés e inglés.
|
| 41 |
+
Para obtener una lista completa de idiomas, consulte LANGMAP_GLOBAL en translator.__init__.
|
| 42 |
+
'''
|
| 43 |
+
self.lang_map['日本語'] = 'ja'
|
| 44 |
+
self.lang_map['English'] = 'en'
|
| 45 |
+
|
| 46 |
+
def _translate(self, src_list: List[str]) -> List[str]:
|
| 47 |
+
'''
|
| 48 |
+
hacer la traducción aquí.
|
| 49 |
+
Este traductor no hace más que devolver el texto original.
|
| 50 |
+
'''
|
| 51 |
+
source = self.lang_map[self.lang_source]
|
| 52 |
+
target = self.lang_map[self.lang_target]
|
| 53 |
+
|
| 54 |
+
translation = text
|
| 55 |
+
return translation
|
| 56 |
+
|
| 57 |
+
def updateParam(self, param_key: str, param_content):
|
| 58 |
+
'''
|
| 59 |
+
sólo es necesario si algún estado necesita ser actualizado inmediatamente después de que el usuario cambie los parámetros del traductor,
|
| 60 |
+
por ejemplo, si este traductor es un modelo pytorch, puedes convertirlo a cpu/gpu aquí.
|
| 61 |
+
'''
|
| 62 |
+
super().updateParam(param_key, param_content)
|
| 63 |
+
if (param_key == 'device'):
|
| 64 |
+
# obtener el estado actual de los parámetros
|
| 65 |
+
# self.model.to(self.params['device']['value'])
|
| 66 |
+
pass
|
| 67 |
+
|
| 68 |
+
@property
|
| 69 |
+
def supported_tgt_list(self) -> List[str]:
|
| 70 |
+
'''
|
| 71 |
+
sólo es necesario si el soporte lingüístico del traductor es asimétrico,
|
| 72 |
+
por ejemplo, este traductor sólo admite inglés -> japonés, no japonés -> inglés.
|
| 73 |
+
'''
|
| 74 |
+
return ['English']
|
| 75 |
+
|
| 76 |
+
@property
|
| 77 |
+
def supported_src_list(self) -> List[str]:
|
| 78 |
+
'''
|
| 79 |
+
sólo es necesario si el soporte lingüístico del traductor es asimétrico.
|
| 80 |
+
'''
|
| 81 |
+
return ['日本語']
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
- Decora la clase con `@register_translator` y proporciona el nombre del traductor que se mostrará en la interfaz. En el ejemplo, el nombre pasado al decorador es `'dummy translator'`, tenga cuidado de no renombrarlo con un traductor existente.
|
| 85 |
+
- La clase debe heredar de `BaseTranslator`.
|
| 86 |
+
|
| 87 |
+
2. **Establece el atributo `concate_text`:**
|
| 88 |
+
|
| 89 |
+
```python
|
| 90 |
+
@register_translator('dummy translator')
|
| 91 |
+
class DummyTranslator(BaseTranslator):
|
| 92 |
+
concate_text = True # Si el traductor sólo acepta cadenas concatenadas
|
| 93 |
+
concate_text = False # Si el traductor acepta listas de cadenas o plantillas offline
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
- Indica si el traductor sólo acepta texto concatenado (varias frases en una sola cadena) o una lista de cadenas.
|
| 97 |
+
- Si se trata de un modelo offline o de una API que acepta listas de cadenas, establézcalo en `False`.
|
| 98 |
+
|
| 99 |
+
3. **Establezca los parámetros (opcional):**
|
| 100 |
+
|
| 101 |
+
```python
|
| 102 |
+
params: Dict = {
|
| 103 |
+
'api_key': '', # Editor de texto para la clave API
|
| 104 |
+
'device': { # Selector para CPU o CUDA
|
| 105 |
+
'type': 'selector',
|
| 106 |
+
'options': ['cpu', 'cuda'],
|
| 107 |
+
'value': 'cpu'
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
- Crea un diccionario `params` si el traductor necesita parámetros configurables por el usuario. Si no, déjelo en blanco o asígnele `None`.
|
| 113 |
+
- Las claves del diccionario son los nombres de los parámetros que se muestran en la interfaz. Si el tipo de valor correspondiente es str, se mostrará en la aplicación como un editor de texto; en el ejemplo anterior, api_key será un editor de texto con un valor por defecto vacío.
|
| 114 |
+
- Los valores pueden ser cadenas (para editores de texto) o diccionarios (en cuyo caso deben describirse mediante 'type', como en el ejemplo anterior. El parámetro 'device' se mostrará como un selector en la aplicación, las opciones válidas son 'cpu' y 'cuda).
|
| 115 |
+
|
| 116 |
+
<p align="center">
|
| 117 |
+
<img src="./src/new_translator.png">
|
| 118 |
+
</p>
|
| 119 |
+
<p align="center">
|
| 120 |
+
parámetros mostrados en el panel de configuración de la aplicación.
|
| 121 |
+
</p>
|
| 122 |
+
|
| 123 |
+
4. **Implementa el método `_setup_translator`:**
|
| 124 |
+
|
| 125 |
+
```python
|
| 126 |
+
def _setup_translator(self):
|
| 127 |
+
'''
|
| 128 |
+
configúrelo aquí.
|
| 129 |
+
las claves lang_map son las opciones de idioma que se muestran en la aplicación,
|
| 130 |
+
asigne las correspondientes claves de idioma aceptadas por la API a los idiomas soportados.
|
| 131 |
+
Aquí sólo se asignan los idiomas soportados por el traductor, este traductor sólo soporta japonés e inglés.
|
| 132 |
+
Para obtener una lista completa de idiomas, consulte LANGMAP_GLOBAL en translator.__init__.
|
| 133 |
+
'''
|
| 134 |
+
self.lang_map['日本語'] = 'ja'
|
| 135 |
+
self.lang_map['English'] = 'en'
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
- Configurar el traductor (inicialización del modelo, autenticación de la API, etc.).
|
| 139 |
+
- Asignar los idiomas mostrados en la aplicación a los códigos de idioma aceptados por la API.
|
| 140 |
+
- Consulta `LANGMAP_GLOBAL` en `translator.__init__` para ver la lista completa de idiomas.
|
| 141 |
+
|
| 142 |
+
5. **Implementa el método `_translate`:**
|
| 143 |
+
|
| 144 |
+
```python
|
| 145 |
+
def _translate(self, src_list: List[str]) -> List[str]:
|
| 146 |
+
'''
|
| 147 |
+
hacer la traducción aquí.
|
| 148 |
+
Este traductor no hace más que devolver el texto original.
|
| 149 |
+
'''
|
| 150 |
+
source = self.lang_map[self.lang_source]
|
| 151 |
+
target = self.lang_map[self.lang_target]
|
| 152 |
+
|
| 153 |
+
translation = text
|
| 154 |
+
return translation
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
- Recibe una lista de cadenas (`src_list`) para traducir.
|
| 158 |
+
- Si `concate_text` es `True`, las cadenas se concatenarán antes de pasarlas al traductor.
|
| 159 |
+
- Realiza la traducción utilizando la API o el modelo.
|
| 160 |
+
- Devuelve una lista de cadenas traducidas.
|
| 161 |
+
|
| 162 |
+
### Métodos opcionales
|
| 163 |
+
|
| 164 |
+
- **`updateParam(self, param_key: str, param_content)`:**
|
| 165 |
+
- Impleméntelo si necesita actualizar el estado del traductor inmediatamente después de que el usuario cambie los parámetros.
|
| 166 |
+
|
| 167 |
+
- **`supported_tgt_list(self) -> List[str]`:**
|
| 168 |
+
- Implementar si el soporte lingüístico del traductor es asimétrico (por ejemplo, sólo traduce del inglés al japonés).
|
| 169 |
+
|
| 170 |
+
- **`supported_src_list(self) -> List[str]`:**
|
| 171 |
+
- Aplicar si el soporte lingüístico del traductor es asimétrico.
|
| 172 |
+
|
| 173 |
+
### Pruebas
|
| 174 |
+
|
| 175 |
+
Después de implementar el traductor, pruébalo siguiendo el ejemplo de `tests/test_translators.py`.
|
doc/Manual_TuanziOCR_ES.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/团子OCR说明.md) | [pt-BR](/Manual_TuanziCR_pt_BR.md) | Español | [Français](../doc/Manual_TuanziOCR_FR.md)
|
| 2 |
+
|
| 3 |
+
## Parámetros de solicitud Referencia (Oficial)
|
| 4 |
+
|
| 5 |
+
<p align="center">
|
| 6 |
+
<img src="https://github.com/PiDanShouRouZhouXD/BallonsTranslator/assets/38401147/3c3985e9-f36e-41fb-af94-d6a8088e5ccd" width="85%" height="85%">
|
| 7 |
+
</p>
|
| 8 |
+
|
| 9 |
+
## Descripción de Tuanzi OCR
|
| 10 |
+
|
| 11 |
+
### Inicio de sesión
|
| 12 |
+
Cuando te conectes por primera vez, es posible que recibas mensajes de error sobre la contraseña. Si estás seguro de que la contraseña es correcta, marca y desmarca la opción "force_refresh_token" para forzar un nuevo inicio de sesión. Guarda la configuración y el problema debería resolverse.
|
| 13 |
+
|
| 14 |
+
### Detección de texto
|
| 15 |
+
La función de detección de texto también extrae texto, pero de forma holística (identificación completa). Por lo tanto, al utilizar TuanziOCR, recomendamos no utilizar únicamente la función de OCR, sino combinar la detección de texto de TuanziOCR con la opción "none_ocr". TuanziOCR tiene filtros integrados para onomatopeyas (Reproducción de sonidos por medio de fonemas/palabras. Algunos ejemplos: Ruidos, gritos, sonidos de animales, etc.) y otras funciones. Para conocer los ajustes detallados, consulte la "Referencia de parámetros de solicitud (oficial)" anterior.
|
doc/Manual_TuanziOCR_FR.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/团子OCR说明.md) | [pt-BR](/Manual_TuanziCR_pt_BR.md) | [Español](../doc/Manual_TuanziOCR_ES.md) | Français
|
| 2 |
+
|
| 3 |
+
## Référence des paramètres de requête (Officielle)
|
| 4 |
+
|
| 5 |
+
<p align="center">
|
| 6 |
+
<img src="https://github.com/PiDanShouRouZhouXD/BallonsTranslator/assets/38401147/3c3985e9-f36e-41fb-af94-d6a8088e5ccd" width="85%" height="85%">
|
| 7 |
+
</p>
|
| 8 |
+
|
| 9 |
+
## Description de Tuanzi OCR
|
| 10 |
+
|
| 11 |
+
### Connexion
|
| 12 |
+
Lors de votre première connexion, vous pourriez recevoir des messages d’erreur concernant le mot de passe. Si vous êtes certain que le mot de passe est correct, cochez puis décochez l’option « force_refresh_token » pour forcer une nouvelle connexion. Enregistrez les paramètres et le problème devrait être résolu.
|
| 13 |
+
|
| 14 |
+
### Détection de texte
|
| 15 |
+
La fonction de détection de texte extrait également du texte, mais de manière holistique (identification complète). Ainsi, lors de l’utilisation de TuanziOCR, il est recommandé de ne pas se limiter uniquement à la fonction OCR, mais de combiner la détection de texte de TuanziOCR avec l’option « none_ocr ». TuanziOCR dispose de filtres intégrés pour les onomatopées (reproduction de sons au moyen de phonèmes ou de mots. Exemples : bruits, cris, sons d’animaux, etc.) ainsi que d’autres fonctionnalités. Pour connaître les réglages détaillés, veuillez consulter la « Référence des paramètres de requête (officielle) » ci-dessus.
|
doc/Manual_TuanziOCR_pt-BR.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/团子OCR说明.md) | pt-BR | [Español](../doc/Manual_TuanziOCR_ES.md) | [Français](../doc/Manual_TuanziOCR_FR.md)
|
| 2 |
+
|
| 3 |
+
## Referência de Parâmetros de Solicitação (Oficial)
|
| 4 |
+
|
| 5 |
+
<p align="center">
|
| 6 |
+
<img src="https://github.com/PiDanShouRouZhouXD/BallonsTranslator/assets/38401147/3c3985e9-f36e-41fb-af94-d6a8088e5ccd" width="85%" height="85%">
|
| 7 |
+
</p>
|
| 8 |
+
|
| 9 |
+
## Descrição do Tuanzi OCR
|
| 10 |
+
|
| 11 |
+
### Login
|
| 12 |
+
Ao fazer login pela primeira vez, você pode receber mensagens de erro de senha. Se tiver certeza de que a senha está correta, marque e desmarque a opção "force_refresh_token" para forçar um novo login. Salve as configurações e o problema deve ser resolvido.
|
| 13 |
+
|
| 14 |
+
### Detecção de Texto
|
| 15 |
+
A função de detecção de texto também extrai texto, mas de forma holística (identificação completa). Portanto, ao usar o TuanziOCR, recomendamos não usar a função OCR isoladamente, mas sim combinar a detecção de texto do TuanziOCR com a opção "none_ocr". O TuanziOCR possui filtros integrados para onomatopeias (Reprodução de sons por meio de fonemas/palavras. Alguns exemplos: Ruídos, gritos, sons de animais, etc.) e outros recursos. Para configurações detalhadas, consulte a "Referência de Parâmetros de Solicitação (Oficial)" acima.
|
doc/README_ES.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
> [!IMPORTANT]
|
| 2 |
+
> **Si planeas compartir públicamente los resultados de traducción automática generados con esta herramienta, y no han sido revisados o traducidos completamente por un traductor con experiencia, por favor indícalo claramente como traducción automática en un lugar visible.**
|
| 3 |
+
|
| 4 |
+
## BallonTranslator
|
| 5 |
+
|
| 6 |
+
[Chino](/README.md) | [Inglês](/README_EN.md) | [pt-BR](../doc/README_PT-BR.md) | [Ruso](../doc/README_RU.md) | [Japonés](../doc/README_JA.md) | [Indonesio](../doc/README_ID.md) | [Vietnamita](../doc/README_VI.md) | [Koreano](../doc/README_KO.md) | Español | [Français](../doc/README_FR.md)
|
| 7 |
+
|
| 8 |
+
BallonTranslator es otra herramienta asistida por ordenador, basada en el aprendizaje profundo, para traducir cómics/manga.
|
| 9 |
+
|
| 10 |
+
<img src="../doc/src/ui0.jpg" div align=center>
|
| 11 |
+
|
| 12 |
+
<p align=center>
|
| 13 |
+
<strong>Vista previa</strong>
|
| 14 |
+
</p>
|
| 15 |
+
|
| 16 |
+
## Recursos
|
| 17 |
+
* **Traducción totalmente automática:**
|
| 18 |
+
- Detecta, reconoce, elimina y traduce textos automáticamente. El rendimiento global depende de estos módulos.
|
| 19 |
+
- La maquetación se basa en el formato estimado del texto original.
|
| 20 |
+
- Funciona bien con manga y cómics.
|
| 21 |
+
- Diseño mejorado para manga->inglés, inglés->chino (basado en la extracción de regiones de globos).
|
| 22 |
+
|
| 23 |
+
* **Edición de imágenes:**
|
| 24 |
+
- Permite editar máscaras e inpainting (similar a la herramienta Pincel recuperador de imperfecciones de Photoshop).
|
| 25 |
+
- Adaptado para imágenes con una relación de aspecto extrema, como los webtoons.
|
| 26 |
+
|
| 27 |
+
* **Edición de texto:**
|
| 28 |
+
- Admite formato de texto y [preajustes de estilo de texto](https://github.com/dmMaze/BallonsTranslator/pull/311). Los textos traducidos pueden editarse interactivamente.
|
| 29 |
+
- Buscar y reemplazar.
|
| 30 |
+
- Exportación/importación a/desde documentos Word.
|
| 31 |
+
|
| 32 |
+
## Instalación
|
| 33 |
+
|
| 34 |
+
### En Windows
|
| 35 |
+
Si no quieres instalar Python y Git manualmente y tienes acceso a Internet:
|
| 36 |
+
Descarga `BallonsTranslator_dev_src_with_gitpython.7z` desde [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) o [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing), descomprime y ejecuta `launch_win.bat`.
|
| 37 |
+
Ejecute `scripts/local_gitpull.bat` para obtener la última actualización.
|
| 38 |
+
|
| 39 |
+
### Ejecutar el código fuente
|
| 40 |
+
Instale [Python](https://www.python.org/downloads/release/python-31011) **<= 3.12** (no utilice la versión de Microsoft Store) y [Git](https://git-scm.com/downloads).
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
# Clonar este repositorio
|
| 44 |
+
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
|
| 45 |
+
|
| 46 |
+
# Iniciar la aplicación
|
| 47 |
+
$ python3 launch.py
|
| 48 |
+
|
| 49 |
+
# Actualizar la aplicación
|
| 50 |
+
$ python3 launch.py --update
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
En la primera ejecución, se instalarán las librerías necesarias y las plantillas se descargarán automáticamente. Si las descargas fallan, tendrás que descargar la carpeta **data** (o los archivos que faltan mencionados en el terminal) desde [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) o [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) y guardarla en la ruta correspondiente de la carpeta de código fuente.
|
| 54 |
+
|
| 55 |
+
## Creación de la aplicación para macOS (compatible con chips Intel y Apple Silicon)
|
| 56 |
+
[Referencia](doc/macOS_app.md)
|
| 57 |
+
Pueden ocurrir algunos problemas; por ahora, se recomienda ejecutar el código fuente directamente.
|
| 58 |
+
|
| 59 |
+
*Nota: macOS también puede ejecutar el código fuente si la aplicación no funciona.*
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
|
| 63 |
+
#### 1. Preparación
|
| 64 |
+
- Descargue las bibliotecas y plantillas de [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) o [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing).
|
| 65 |
+
|
| 66 |
+
<img width="1268" alt="截屏2023-09-08 13 44 55_7g32SMgxIf" src="https://github.com/dmMaze/BallonsTranslator/assets/134026642/40fbb9b8-a788-4a6e-8e69-0248abaee21a">
|
| 67 |
+
|
| 68 |
+
- Coloca todos los recursos descargados en una carpeta llamada `data`. La estructura final del directorio debería ser la siguiente:
|
| 69 |
+
|
| 70 |
+
```
|
| 71 |
+
data
|
| 72 |
+
├── libs
|
| 73 |
+
│ └── patchmatch_inpaint.dll
|
| 74 |
+
└── models
|
| 75 |
+
├── aot_inpainter.ckpt
|
| 76 |
+
├── comictextdetector.pt
|
| 77 |
+
├── comictextdetector.pt.onnx
|
| 78 |
+
├── lama_mpe.ckpt
|
| 79 |
+
├── manga-ocr-base
|
| 80 |
+
│ ├── README.md
|
| 81 |
+
│ ├── config.json
|
| 82 |
+
│ ├── preprocessor_config.json
|
| 83 |
+
│ ├── pytorch_model.bin
|
| 84 |
+
│ ├── special_tokens_map.json
|
| 85 |
+
│ ├── tokenizer_config.json
|
| 86 |
+
│ └── vocab.txt
|
| 87 |
+
├── mit32px_ocr.ckpt
|
| 88 |
+
├── mit48pxctc_ocr.ckpt
|
| 89 |
+
└── pkuseg
|
| 90 |
+
├── postag
|
| 91 |
+
│ ├── features.pkl
|
| 92 |
+
│ └── weights.npz
|
| 93 |
+
├── postag.zip
|
| 94 |
+
└── spacy_ontonotes
|
| 95 |
+
├── features.msgpack
|
| 96 |
+
└── weights.npz
|
| 97 |
+
|
| 98 |
+
7 directorios, 23 ficheros
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
- Instale la herramienta de línea de comandos pyenv para gestionar las versiones de Python. Se recomienda la instalación a través de Homebrew.
|
| 102 |
+
|
| 103 |
+
```
|
| 104 |
+
# Instalación mediante Homebrew
|
| 105 |
+
brew install pyenv
|
| 106 |
+
|
| 107 |
+
# Instalación mediante script oficial
|
| 108 |
+
curl https://pyenv.run | bash
|
| 109 |
+
|
| 110 |
+
# Configuración del entorno shell tras la instalación
|
| 111 |
+
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
| 112 |
+
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
| 113 |
+
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
#### 2. Creación de la aplicación
|
| 117 |
+
```
|
| 118 |
+
# Introduzca el directorio de trabajo `data`.
|
| 119 |
+
cd data
|
| 120 |
+
|
| 121 |
+
# Clonar la rama `dev` del repositorio
|
| 122 |
+
git clone -b dev https://github.com/dmMaze/BallonsTranslator.git
|
| 123 |
+
|
| 124 |
+
# Introduzca el directorio de trabajo `BallonsTranslator`.
|
| 125 |
+
cd BallonsTranslator
|
| 126 |
+
|
| 127 |
+
# Ejecute el script de construcción, que le pedirá la contraseña en el paso pyinstaller, introduzca la contraseña y pulse enter
|
| 128 |
+
sh scripts/build-macos-app.sh
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
> 📌 La aplicación empaquetada se encuentra en ./data/BallonsTranslator/dist/BallonsTranslator.app. Arrastre la aplicación a la carpeta de aplicaciones de macOS para instalarla. Listo para usar sin ajustes adicionales de Python.
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
</details>
|
| 135 |
+
|
| 136 |
+
# Utilización
|
| 137 |
+
|
| 138 |
+
**Se recomienda ejecutar el programa en un terminal en caso de que se produzca un fallo y no se proporcione información, como se muestra en el siguiente gif.**
|
| 139 |
+
<img src="../doc/src/run.gif">
|
| 140 |
+
|
| 141 |
+
- En la primera ejecución, selecciona el traductor y establece los idiomas de origen y destino haciendo clic en el icono de configuración.
|
| 142 |
+
- Abre una carpeta que contenga las imágenes del cómic (manga/manhua/manhwa) que necesites traducir haciendo clic en el icono de la carpeta.
|
| 143 |
+
- Haz clic en el botón «Ejecutar» y espera a que se complete el proceso.
|
| 144 |
+
|
| 145 |
+
Los formatos de fuente, como el tamaño y el color, son determinados automáticamente por el programa en este proceso. Puede predeterminar estos formatos cambiando las opciones correspondientes de "decidir por el programa" a "utilizar configuración global" en el panel Configuración->Diagramación. (La configuración global son los formatos que se muestran en el panel de formato de fuente de la derecha cuando no está editando ningún bloque de texto en la escena).
|
| 146 |
+
|
| 147 |
+
## Edición de imágenes
|
| 148 |
+
|
| 149 |
+
### Herramienta para pintar
|
| 150 |
+
<img src="../doc/src/imgedit_inpaint.gif">
|
| 151 |
+
<p align = "center">
|
| 152 |
+
<strong>Modo de edición de imágenes, herramienta Inpainting</strong>
|
| 153 |
+
</p>
|
| 154 |
+
|
| 155 |
+
### Herramienta rectángulo
|
| 156 |
+
<img src="../doc/src/rect_tool.gif">
|
| 157 |
+
<p align = "center">
|
| 158 |
+
<strong>Herramienta rectángulo</strong>
|
| 159 |
+
</p>
|
| 160 |
+
|
| 161 |
+
Para 'borrar' los resultados de inpainting no deseados, utilice la herramienta inpainting o la herramienta rectángulo con el **botón derecho del ratón** pulsado. El resultado depende de la precisión con la que el algoritmo ("método 1" y "método 2" en el gif) extrae la máscara de texto. El rendimiento puede ser peor con texto y fondos complejos.
|
| 162 |
+
|
| 163 |
+
## Edición de texto
|
| 164 |
+
<img src="../doc/src/textedit.gif">
|
| 165 |
+
<p align = "center">
|
| 166 |
+
<strong>Modo de edición de texto</strong>
|
| 167 |
+
</p>
|
| 168 |
+
|
| 169 |
+
<img src="../doc/src/multisel_autolayout.gif" div align=center>
|
| 170 |
+
<p align=center>
|
| 171 |
+
<strong>Formato de texto por lotes y maquetación automática</strong>
|
| 172 |
+
</p>
|
| 173 |
+
|
| 174 |
+
<img src="../doc/src/ocrselected.gif" div align=center>
|
| 175 |
+
<p align=center>
|
| 176 |
+
<strong>OCR y traducción de áreas seleccionadas</strong>
|
| 177 |
+
</p>
|
| 178 |
+
|
| 179 |
+
## Atajos
|
| 180 |
+
* `A`/`D` o `pageUp`/`Down` para pasar de página
|
| 181 |
+
* `Ctrl+Z`, `Ctrl+Shift+Z` para deshacer/rehacer la mayoría de las operaciones (la pila de deshacer se borra al pasar página).
|
| 182 |
+
* `T` para el modo de edición de texto (o el botón "T" de la barra de herramientas inferior).
|
| 183 |
+
* `W` para activar el modo de creación de bloques de texto, arrastra el ratón por la pantalla con el botón derecho pulsado para añadir un nuevo bloque de texto (ver gif de edición de texto).
|
| 184 |
+
* `P` para el modo de edición de imágenes.
|
| 185 |
+
* En el modo de edición de imágenes, utiliza el control deslizante de la esquina inferior derecha para controlar la transparencia de la imagen original.
|
| 186 |
+
* Desactivar o activar cualquier módulo automático a través de la barra de título->ejecutar. Ejecutar con todos los módulos desactivados remapeará las letras y renderizará todo el texto según la configuración correspondiente.
|
| 187 |
+
* Establece los parámetros de los módulos automáticos en el panel de configuración.
|
| 188 |
+
* `Ctrl++`/`Ctrl+-` (También `Ctrl+Shift+=`) para redimensionar la imagen.
|
| 189 |
+
* `Ctrl+G`/`Ctrl+F` para buscar globalmente/en la página actual.
|
| 190 |
+
* `0-9` para ajustar la opacidad de la capa de texto.
|
| 191 |
+
* Para editar texto: negrita - `Ctrl+B`, subrayado - `Ctrl+U`, cursiva - `Ctrl+I`.
|
| 192 |
+
* Ajuste la sombra y la transparencia del texto en el panel de estilo de texto -> Efecto.
|
| 193 |
+
* ```Alt+Arrow Keys``` o ```Alt+WASD``` (```pageDown``` o ```pageUp``` mientras estás en el modo de edición de texto) para cambiar entre bloques de texto.
|
| 194 |
+
|
| 195 |
+
<img src="../doc/src/configpanel.png">
|
| 196 |
+
|
| 197 |
+
## Modo Headless (ejecución sin interfaz gráfica)
|
| 198 |
+
|
| 199 |
+
```python
|
| 200 |
+
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
|
| 201 |
+
```
|
| 202 |
+
|
| 203 |
+
La configuración (idioma de origen, idioma de destino, modelo de inpainting, etc.) se cargará desde config/config.json. Si el tamaño de la fuente renderizada no es correcto, especifique manualmente el DPI lógico mediante `--ldpi`. Los valores típicos son 96 y 72.
|
| 204 |
+
|
| 205 |
+
## Módulos de automatización
|
| 206 |
+
Este proyecto depende en gran medida de [manga-image-translator](https://github.com/zyddnys/manga-image-translator). Los servicios en línea y la formación de modelos no son baratos, así que por favor considere hacer una donación al proyecto:
|
| 207 |
+
- Ko-fi: [https://ko-fi.com/voilelabs](https://ko-fi.com/voilelabs)
|
| 208 |
+
- Patreon: [https://www.patreon.com/voilelabs](https://www.patreon.com/voilelabs)
|
| 209 |
+
- 爱发电: [https://afdian.net/@voilelabs](https://afdian.net/@voilelabs)
|
| 210 |
+
|
| 211 |
+
El [traductor de Sugoi](https://sugoitranslator.com/) fue creado por [mingshiba](https://www.patreon.com/mingshiba).
|
| 212 |
+
|
| 213 |
+
## Detección de texto
|
| 214 |
+
* Permite detectar texto en inglés y japonés. El código de entrenamiento y más detalles en [comic-text-detector](https://github.com/dmMaze/comic-text-detector).
|
| 215 |
+
* Admite el uso de la detección de texto de [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). Es necesario rellenar el nombre de usuario y la contraseña, y el inicio de sesión automático se realizará cada vez que se inicie el programa.
|
| 216 |
+
* Para obtener instrucciones detalladas, consulte el [Manual de TuanziOCR](../doc/Manual_TuanziOCR_ES.md).
|
| 217 |
+
* Los modelos `YSGDetector` fueron entrenados por [lhj5426](https://github.com/lhj5426). Estos modelos filtran las onomatopeyas en CGs/Manga. Descarga los checkpoints desde [YSGYoloDetector](https://huggingface.co/YSGforMTL/YSGYoloDetector) y colócalos en la carpeta `data/models`.
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
## OCR
|
| 221 |
+
* Todos los modelos mit* proceden de manga-image-translator y admiten el reconocimiento en inglés, japonés y coreano, así como la extracción del color del texto.
|
| 222 |
+
* [manga_ocr](https://github.com/kha-white/manga-ocr) es de [kha-white](https://github.com/kha-white), reconocimiento de texto para japonés, centrado principalmente en el manga japonés.
|
| 223 |
+
* Admite el uso de OCR de [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). Es necesario rellenar el nombre de usuario y la contraseña, y el inicio de sesión automático se realizará cada vez que se inicie el programa.
|
| 224 |
+
* La implementación actual utiliza OCR en cada bloque de texto individualmente, lo que resulta en una velocidad más lenta y ninguna mejora significativa en la precisión. No se recomienda. Si es necesario, utilice el Detector Tuanzi.
|
| 225 |
+
* Cuando se utiliza Tuanzi Detector para la detección de texto, se recomienda configurar el OCR a none_ocr para leer el texto directamente, ahorrando tiempo y reduciendo el número de peticiones.
|
| 226 |
+
* Para obtener instrucciones detalladas, consulte el [Manual de TuanziOCR](doc/Manual_TuanziOCR_ES.md).
|
| 227 |
+
* Se añadió como un módulo opcional el soporte para PaddleOCR. En el modo Debug, verás un mensaje indicando que no está instalado. Puedes instalarlo fácilmente siguiendo las instrucciones que se muestran ahí. Si no quieres instalar el paquete manualmente, simplemente descomenta (elimina el `#`) las líneas correspondientes a paddlepaddle(gpu) y paddleocr. Hazlo bajo tu propia responsabilidad y riesgo. Si no se instaló correctamente, y genera errores; de ser así, repórtalo en Issues.
|
| 228 |
+
* Se añadió soporte para [OneOCR](https://github.com/b1tg/win11-oneocr). Es un modelo local de Windows, tomado de las aplicaciones Recortes (Snipping Tool) o Fotos `Win.PHOTOS`. Para usarlo, necesitas colocar el modelo y los archivos DLL en la carpeta 'data/models/one-ocr'. Es mejor colocar todos los archivos antes de ejecutar el programa. Puedes leer cómo encontrar y extraer los archivos DLL y del modelo aquí:
|
| 229 |
+
https://github.com/dmMaze/BallonsTranslator/discussions/859#discussioncomment-12876757. Agradecimientos a AuroraWright por el proyecto [OneOCR](https://github.com/AuroraWright/oneocr).
|
| 230 |
+
|
| 231 |
+
## Inpainting
|
| 232 |
+
* AOT es de [manga-image-translator](https://github.com/zyddnys/manga-image-translator).
|
| 233 |
+
* Todas las lama* se ajustan mediante [LaMa](https://github.com/advimman/lama).
|
| 234 |
+
* PatchMatch es un algoritmo de [PyPatchMatch](https://github.com/vacancy/PyPatchMatch). Este programa utiliza una [versión modificada](https://github.com/dmMaze/PyPatchMatchInpaint) por mí.
|
| 235 |
+
|
| 236 |
+
## Traductores disponibles
|
| 237 |
+
* **Google Translate**: El servicio de Google Translate ha sido desactivado en China. Para usarlo desde la China continental, debes configurar un proxy global y cambiar la URL en el panel de configuración a `*`.com
|
| 238 |
+
* **Caiyun**: Requiere que solicites un [token de acceso](https://dashboard.caiyunapp.com/).
|
| 239 |
+
* **Papago**: Compatible sin configuraciones adicionales.
|
| 240 |
+
* **DeepL y Sugoi (incluyendo su conversión con CT2 Translation)**: Agradecimientos a [Snowad14](https://github.com/Snowad14).
|
| 241 |
+
Si deseas usar el traductor Sugoi (solo soporta traducción del japonés al inglés), debes descargar el [modelo offline](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm) y mover la carpeta ```sugoi_translator``` dentro del directorio BallonsTranslator/ballontranslator/data/models.
|
| 242 |
+
* **Sugoi** traduce del japonés al inglés completamente sin conexión.
|
| 243 |
+
* Se admite [Sakura-13B-Galgame](https://github.com/SakuraLLM/Sakura-13B-Galgame). Si se ejecuta localmente en una sola tarjeta gráfica con poca memoria de video, puedes activar el ```low vram mode``` o Modo de bajo consumo de VRAM en el panel de configuración (activado por defecto).
|
| 244 |
+
* Para **DeepLX**, consulta [Vercel](https://github.com/bropines/Deeplx-vercel) o el [proyecto deeplx](https://github.com/OwO-Network/DeepLX).
|
| 245 |
+
* Se admiten dos versiones de traductores compatibles con **OpenAI**. Son compatibles tanto con el proveedor oficial como con proveedores de LLM de terceros que sigan la API de **OpenAI**. Es necesario configurarlo en el panel de ajustes.
|
| 246 |
+
* La versión sin sufijo consume menos tokens, pero su estabilidad en la segmentación de oraciones es ligeramente peor, lo que puede causar problemas al traducir textos largos.
|
| 247 |
+
* La versión con el sufijo **exp** consume más tokens, pero es más estable y usa técnicas tipo "jailbreak" en el prompt, adecuada para traducciones de textos largos.
|
| 248 |
+
* [m2m100](https://huggingface.co/facebook/m2m100_1.2B): Descarga y mueve la carpeta 'm2m100-1.2B-ctranslate2' al directorio 'data/models'.
|
| 249 |
+
* **Puedes encontrar información sobre los módulos de traductores [aquí](../doc/modules/translators.md)**.
|
| 250 |
+
|
| 251 |
+
Para otros modelos de traducción offline al inglés de buena calidad, consulta este [hilo de discusión](https://github.com/dmMaze/BallonsTranslator/discussions/515).
|
| 252 |
+
Para añadir un nuevo traductor, consulte [Cómo_añadir_un_nuevo_traductor](../doc/Como_añadir_un_nuevo_traductor.md). Es tan sencillo como crear una subclase de una clase base e implementar dos interfaces. Luego puedes usarla en la aplicación. Las contribuciones al proyecto son bienvenidas.
|
| 253 |
+
|
| 254 |
+
## FAQ & Varios
|
| 255 |
+
* Los ordenadores con tarjeta gráfica Nvidia o chip Apple Silicon activan por defecto la aceleración por GPU.
|
| 256 |
+
* Gracias a [bropines](https://github.com/bropines) por proporcionar la traducción al ruso.
|
| 257 |
+
* Los métodos de entrada de terceros pueden causar errores visuales en el cuadro de edición de la derecha. Véase el issue [#76](https://github.com/dmMaze/BallonsTranslator/issues/76); de momento no se planea solucionar esto.
|
| 258 |
+
* El menú flotante al seleccionar texto admite funciones como diccionarios agregados, traducción profesional palabra por palabra y [Saladict](https://saladict.crimx.com)(*Diccionario emergente profesional y traductor de páginas todo en uno*). Consulta las [instrucciones de instalación](../doc/saladict_es.md).
|
| 259 |
+
* Acelera el rendimiento si tienes un dispositivo [NVIDIA CUDA](https://pytorch.org/docs/stable/notes/cuda.html) o [AMD ROCm](https://pytorch.org/docs/stable/notes/hip.html), ya que la mayoría de los módulos utilizan [PyTorch](https://pytorch.org/get-started/locally/).
|
| 260 |
+
* Las fuentes son de tu sistema.
|
| 261 |
+
* Añadido script de exportación JSX para Photoshop por [bropines](https://github.com/bropines). Para leer las instrucciones, mejorar el código y simplemente explorar cómo funciona, vaya a `scripts/export to photoshop` -> `install_manual.md`.
|
| 262 |
+
|
| 263 |
+
<details>
|
| 264 |
+
<summary><i>Pasos para habilitar la aceleración por GPU con tarjetas gráficas AMD (ROCm6)</i></summary>
|
| 265 |
+
|
| 266 |
+
1. Actualiza el controlador de la tarjeta gráfica a la versión más reciente (se recomienda la versión 24.12.1 o superior). Descarga e instala [AMD HIP SDK 6.2](https://www.amd.com/en/developer/resources/rocm-hub/hip-sdk.html).
|
| 267 |
+
2. Descarga [ZLUDA](https://github.com/lshqqytiger/ZLUDA/releases) (versión ROCm6) y descomprímelo dentro de una carpeta llamada 'zluda'.
|
| 268 |
+
Copia esta carpeta 'zluda' al disco del sistema, por ejemplo: 'C:\zluda'.
|
| 269 |
+
3. Configura las variables de entorno del sistema (en **Windows 10**):
|
| 270 |
+
Ve a `Configuración → Propiedades del sistema → Configuración avanzada del sistema → Variables de entorno`.
|
| 271 |
+
En “Variables del sistema”, busca la variable **Path**, haz clic en editar y añade al final: `C:\zluda` y `%HIP_PATH_62%\bin`.
|
| 272 |
+
4. Sustituye los archivos de enlace dinámico de la biblioteca CUDA: Copia los siguientes archivos desde 'C:\zluda' al escritorio: `cublas.dll`, `cusparse.dll` y `nvrtc.dll`. Luego, renómbralos de acuerdo con las siguientes reglas:
|
| 273 |
+
|
| 274 |
+
**Nota: Si usas el controlador AMD 25.5.1, asegúrate de actualizar ZLUDA a la versión 3.9.5 o superior.**
|
| 275 |
+
|
| 276 |
+
```
|
| 277 |
+
Nombre original → Nuevo nombre
|
| 278 |
+
|
| 279 |
+
cublas.dll → cublas64_11.dll
|
| 280 |
+
|
| 281 |
+
cusparse.dll → cusparse64_11.dll
|
| 282 |
+
|
| 283 |
+
nvrtc.dll → nvrtc64_112_0.dll
|
| 284 |
+
```
|
| 285 |
+
Sustituye los archivos renombrados en el directorio: `BallonsTranslator\ballontrans_pylibs_win\Lib\site-packages\torch\lib\` reemplazando los archivos del mismo nombre.
|
| 286 |
+
|
| 287 |
+
5. Inicia el programa y configura el OCR y la detección de texto para que usen CUDA **(la reparación de imágenes debe seguir usando la CPU)**.
|
| 288 |
+
6. Al ejecutar OCR por primera vez, ZLUDA compilará los archivos PTX **(este proceso puede tardar entre 5 y 10 minutos dependiendo del rendimiento del CPU)**,**En las siguientes ejecuciones, no será necesario volver a compilar.**
|
| 289 |
+
</details>
|
doc/README_FR.md
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
> [!IMPORTANT]
|
| 2 |
+
> **Si vous partagez publiquement le résultat traduit et qu'aucun traducteur humain expérimenté n'a participé à la traduction ou à la relecture, veuillez indiquer clairement qu'il s'agit d'une traduction automatique.**
|
| 3 |
+
|
| 4 |
+
# BallonTranslator
|
| 5 |
+
[简体中文](/README.md) | [English](/README_EN.md) | [pt-BR](../doc/README_PT-BR.md) | [Русский](../doc/README_RU.md) | [日本語](../doc/README_JA.md) | [Indonesia](../doc/README_ID.md) | [Tiếng Việt](../doc/README_VI.md) | [한국어](../doc/README_KO.md) | [Español](../doc/README_ES.md) | Français
|
| 6 |
+
|
| 7 |
+
BallonTranslator est un autre outil assisté par ordinateur, basé sur l'apprentissage profond (deep learning), permettant de traduire des comics/mangas.
|
| 8 |
+
|
| 9 |
+
<img src="../doc/src/ui0.jpg" div align=center>
|
| 10 |
+
|
| 11 |
+
<p align=center>
|
| 12 |
+
aperçu
|
| 13 |
+
</p>
|
| 14 |
+
|
| 15 |
+
Prend en charge le formatage riche du texte et les préréglages de style. Les textes traduits peuvent être édités interactivement.
|
| 16 |
+
|
| 17 |
+
Prend en charge rechercher & remplacer
|
| 18 |
+
|
| 19 |
+
Prend en charge l’export/import vers/depuis des documents Word
|
| 20 |
+
|
| 21 |
+
# Fonctionnalités
|
| 22 |
+
* Traduction entièrement automatisée
|
| 23 |
+
- Prend en charge la détection, la reconnaissance, la suppression et la traduction automatiques du texte. Les performances globales dépendent de ces modules.
|
| 24 |
+
- La composition typographique est basée sur l'estimation du formatage du texte original.
|
| 25 |
+
- Fonctionne correctement avec les mangas et comics.
|
| 26 |
+
- Amélioration du lettrage manga->Anglais, Anglais->Chinois (basé sur l'extraction des zones de bulles).
|
| 27 |
+
|
| 28 |
+
* Édition d’image
|
| 29 |
+
- Prise en charge de l'édition et de la retouche des masques (similaire à l'outil Pinceau correcteur dans Photoshop)
|
| 30 |
+
- Adapté aux images à rapport hauteur/largeur extrême comme les webtoons
|
| 31 |
+
|
| 32 |
+
* Édition de texte
|
| 33 |
+
- Prend en charge le formatage riche du texte et les [préréglages de style](https://github.com/dmMaze/BallonsTranslator/pull/311). Les textes traduits peuvent être édités interactivement.
|
| 34 |
+
- Prend en charge rechercher & remplacer
|
| 35 |
+
- Prend en charge l’export/import vers/depuis des documents Word
|
| 36 |
+
|
| 37 |
+
# Installation
|
| 38 |
+
|
| 39 |
+
## Sous Windows
|
| 40 |
+
Si vous ne souhaitez pas installer Python et Git vous-même et que vous avez accès à Internet :
|
| 41 |
+
Téléchargez BallonsTranslator_dev_src_with_gitpython.7z depuis [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) ou [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing), décompressez et lancez launch_win.bat.
|
| 42 |
+
Exécutez scripts/local_gitpull.bat pour obtenir la dernière mise à jour.
|
| 43 |
+
Notez que ces paquets fournis ne fonctionnent pas sous Windows 7, les utilisateurs de Win7 doivent installer [Python 3.8](https://www.python.org/downloads/release/python-3810/) et exécuter le code source.
|
| 44 |
+
|
| 45 |
+
## Exécuter le code source
|
| 46 |
+
|
| 47 |
+
Installez [Python](https://www.python.org/downloads/release/python-31011) **<= 3.12** (ne pas utiliser celui du Microsoft Store) et [Git](https://git-scm.com/downloads).
|
| 48 |
+
|
| 49 |
+
```bash
|
| 50 |
+
# Clonez ce dépôt
|
| 51 |
+
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
|
| 52 |
+
|
| 53 |
+
# Lancez l'application
|
| 54 |
+
$ python3 launch.py
|
| 55 |
+
|
| 56 |
+
# Mettre à jour l'application
|
| 57 |
+
$ python3 launch.py --update
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Lors du premier lancement, le programme installera automatiquement les bibliothèques requises et téléchargera les modèles. Si les téléchargements échouent, il faudra récupérer le dossier **data** (ou les fichiers manquants indiqués dans le terminal) depuis [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) ou [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) et les placer au bon endroit dans le dossier du code source.
|
| 61 |
+
|
| 62 |
+
## Construire l'application macOS (compatible Intel et puces Apple Silicon)
|
| 63 |
+
[Reference](../doc/macOS_app.md)
|
| 64 |
+
Quelques problèmes peuvent survenir, exécuter directement le code source est pour l’instant recommandé.
|
| 65 |
+
|
| 66 |
+
<i>Remarque : macOS peut également exécuter le code source si l'application ne fonctionne pas.</i>
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
|
| 70 |
+
#### 1. Préparation
|
| 71 |
+
- Téléchargez les bibliothèques et les modèles depuis [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw "MEGA") ou [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
<img width="1268" alt="截屏2023-09-08 13 44 55_7g32SMgxIf" src="https://github.com/dmMaze/BallonsTranslator/assets/134026642/40fbb9b8-a788-4a6e-8e69-0248abaee21a">
|
| 75 |
+
|
| 76 |
+
- Placez toutes les ressources téléchargées dans un dossier nommé data. L'arborescence finale des dossiers doit ressembler à ceci :
|
| 77 |
+
|
| 78 |
+
```
|
| 79 |
+
data
|
| 80 |
+
├── libs
|
| 81 |
+
│ └── patchmatch_inpaint.dll
|
| 82 |
+
└── models
|
| 83 |
+
├── aot_inpainter.ckpt
|
| 84 |
+
├── comictextdetector.pt
|
| 85 |
+
├── comictextdetector.pt.onnx
|
| 86 |
+
├── lama_mpe.ckpt
|
| 87 |
+
├── manga-ocr-base
|
| 88 |
+
│ ├── README.md
|
| 89 |
+
│ ├── config.json
|
| 90 |
+
│ ├── preprocessor_config.json
|
| 91 |
+
│ ├── pytorch_model.bin
|
| 92 |
+
│ ├── special_tokens_map.json
|
| 93 |
+
│ ├── tokenizer_config.json
|
| 94 |
+
│ └── vocab.txt
|
| 95 |
+
├── mit32px_ocr.ckpt
|
| 96 |
+
├── mit48pxctc_ocr.ckpt
|
| 97 |
+
└── pkuseg
|
| 98 |
+
├── postag
|
| 99 |
+
│ ├── features.pkl
|
| 100 |
+
│ └── weights.npz
|
| 101 |
+
├── postag.zip
|
| 102 |
+
└── spacy_ontonotes
|
| 103 |
+
├── features.msgpack
|
| 104 |
+
└── weights.npz
|
| 105 |
+
|
| 106 |
+
7 dossiers, 23 fichiers
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
- Installez l’outil en ligne de commande pyenv pour gérer les versions de Python. Il est recommandé de l’installer via Homebrew.
|
| 110 |
+
```
|
| 111 |
+
# Installation via Homebrew
|
| 112 |
+
brew install pyenv
|
| 113 |
+
|
| 114 |
+
# Installation via le script officiel
|
| 115 |
+
curl https://pyenv.run | bash
|
| 116 |
+
|
| 117 |
+
# Configuration de l'environnement shell après installation
|
| 118 |
+
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
| 119 |
+
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
| 120 |
+
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
#### 2、Construire l'application
|
| 125 |
+
```
|
| 126 |
+
# Se placer dans le répertoire de travail `data`
|
| 127 |
+
cd data
|
| 128 |
+
|
| 129 |
+
# Cloner la branche `dev` du dépôt
|
| 130 |
+
git clone -b dev https://github.com/dmMaze/BallonsTranslator.git
|
| 131 |
+
|
| 132 |
+
# Entrer dans le répertoire `BallonsTranslator`
|
| 133 |
+
cd BallonsTranslator
|
| 134 |
+
|
| 135 |
+
# Lancer le script de construction, demandera le mot de passe lors de l'étape pyinstaller, entrez le mot de passe et validez
|
| 136 |
+
sh scripts/build-macos-app.sh
|
| 137 |
+
```
|
| 138 |
+
> 📌L'application empaquetée se trouve dans ./data/BallonsTranslator/dist/BallonsTranslator.app. Glissez l'application dans le dossier Applications de macOS pour l’installer. Prête à l’emploi sans configuration Python supplémentaire.
|
| 139 |
+
</details>
|
| 140 |
+
|
| 141 |
+
# Utilisation
|
| 142 |
+
|
| 143 |
+
**Il est conseillé de lancer le programme dans un terminal pour voir les messages en cas de plantage, voir le gif suivant.**
|
| 144 |
+
<img src="../doc/src/run.gif">
|
| 145 |
+
- La première fois que vous lancez l'application, veuillez sélectionner le traducteur et définir les langues source et cible en cliquant sur l'icône des paramètres.
|
| 146 |
+
- Ouvrez un dossier contenant les images du manga/manhua/manhwa/comic à traduire en cliquant sur l’icône dossier.
|
| 147 |
+
- Cliquez sur le bouton `Run` et attendez la fin du processus.
|
| 148 |
+
|
| 149 |
+
Les formats de police, tels que la taille et la couleur, sont déterminés automatiquement par le programme au cours de ce processus. Vous pouvez prédéfinir ces formats en modifiant les options correspondantes de « Déterminer par programme » à « Utiliser les paramètres globaux » dans le panneau de configuration -> Composition typographique. (Les paramètres globaux sont les formats affichés dans le panneau de format de police de droite lorsque vous ne modifiez aucun bloc de texte dans la scène.)
|
| 150 |
+
|
| 151 |
+
## Édition d’image
|
| 152 |
+
|
| 153 |
+
### Outil de retouche
|
| 154 |
+
<img src="../doc/src/imgedit_inpaint.gif">
|
| 155 |
+
<p align = "center">
|
| 156 |
+
Mode d'édition d'image, outil de retouche
|
| 157 |
+
</p>
|
| 158 |
+
|
| 159 |
+
### Outil Rect
|
| 160 |
+
<img src="../doc/src/rect_tool.gif">
|
| 161 |
+
<p align = "center">
|
| 162 |
+
Outil Rect
|
| 163 |
+
</p>
|
| 164 |
+
|
| 165 |
+
Pour « effacer » les résultats indésirables de la retouche, utilisez l'outil de retouche ou l'outil de correction en maintenant le **clic droit** enfoncé.
|
| 166 |
+
Le résultat dépend de la précision avec laquelle l'algorithme (méthode 1 et méthode 2 dans le gif) extrait le masque de texte. Il peut être moins performant sur des textes et des arrière-plans complexes.
|
| 167 |
+
|
| 168 |
+
## Édition de texte
|
| 169 |
+
<img src="../doc/src/textedit.gif">
|
| 170 |
+
<p align = "center">
|
| 171 |
+
Mode édition de texte
|
| 172 |
+
</p>
|
| 173 |
+
|
| 174 |
+
<img src="../doc/src/multisel_autolayout.gif" div align=center>
|
| 175 |
+
<p align=center>
|
| 176 |
+
Formatage de texte en lot & auto-mise en page
|
| 177 |
+
</p>
|
| 178 |
+
|
| 179 |
+
<img src="../doc/src/ocrselected.gif" div align=center>
|
| 180 |
+
<p align=center>
|
| 181 |
+
OCR & traduction d’une zone sélectionnée
|
| 182 |
+
</p>
|
| 183 |
+
|
| 184 |
+
## Raccourcis
|
| 185 |
+
* ```A```/```D``` ou ```pageUp```/```Down``` pour changer de page.
|
| 186 |
+
* ```Ctrl+Z```, ```Ctrl+Shift+Z``` pour annuler/rétablir la plupart des opérations. (Remarque : la pile d'annulation sera effacée après avoir changé de page.)
|
| 187 |
+
* ```T``` pour le mode édition de texte (ou le bouton "T" en bas).
|
| 188 |
+
* ```W``` pour activer le mode de création de blocs de texte, cliquez avec le clic droit de la souris sur le canevas et faites glisser la souris pour ajouter un nouveau bloc de texte. (voir le gif sur l'édition de texte)
|
| 189 |
+
* ```P``` pour le mode édition d’image.
|
| 190 |
+
* En mode édition d'image, utilisez le curseur en bas à droite pour contrôler la transparence de l'image d'origine.
|
| 191 |
+
* Désactivez ou activez les modules automatiques via la barre de titre->Exécuter. L'exécution avec tous les modules désactivés réécrira et réaffichera tout le texte en fonction des paramètres correspondants.
|
| 192 |
+
* Définissez les paramètres des modules automatiques dans le panneau de configuration.
|
| 193 |
+
* ```Ctrl++```/```Ctrl+-``` (Aussi ```Ctrl+Shift+=```) pour redimensionner l’image.
|
| 194 |
+
* ```Ctrl+G```/```Ctrl+F``` pour faire une recherche globale/dans la page actuelle.
|
| 195 |
+
* ```0-9``` pour ajuster l'opacité du calque de texte.
|
| 196 |
+
* Pour l'édition de texte : gras - ```Ctrl+B```, souligné - ```Ctrl+U```, italique - ```Ctrl+I```
|
| 197 |
+
* Définissez l'ombre et la transparence du texte dans le panneau Style de texte -> Effet.
|
| 198 |
+
* ```Alt+Touches fléchées``` ou ```Alt+WASD``` (```pageDown``` ou ```pageUp``` en mode édition de texte) pour passer d'un bloc de texte à l'autre.
|
| 199 |
+
|
| 200 |
+
<img src="../doc/src/configpanel.png">
|
| 201 |
+
|
| 202 |
+
## Mode sans interface (exécution sans interface graphique)
|
| 203 |
+
``` python
|
| 204 |
+
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
|
| 205 |
+
```
|
| 206 |
+
Notez que la configuration (langue source, langue cible, modèle de retouche, etc.) sera chargée à partir du fichier config/config.json.
|
| 207 |
+
Si la taille de la police rendue n'est pas correcte, spécifiez manuellement la résolution logique via ```--ldpi ```, les valeurs typiques sont 96 et 72.
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
# Modules d'automatisation
|
| 211 |
+
Ce projet dépend fortement de [manga-image-translator](https://github.com/zyddnys/manga-image-translator), un service en ligne et la formation des modèles n'est pas bon marché, veuillez envisager de faire un don au projet :
|
| 212 |
+
- Ko-fi: <https://ko-fi.com/voilelabs>
|
| 213 |
+
- Patreon: <https://www.patreon.com/voilelabs>
|
| 214 |
+
- 爱发电: <https://afdian.net/@voilelabs>
|
| 215 |
+
|
| 216 |
+
[Sugoi translator](https://sugoitranslator.com/) est créé par [mingshiba](https://www.patreon.com/mingshiba).
|
| 217 |
+
|
| 218 |
+
## Détection de texte
|
| 219 |
+
* Prise en charge de la détection de texte en anglais et en japonais. Le code source et plus de détails sont disponibles sur [comic-text-detector].
|
| 220 |
+
* Prise en charge de la détection de texte à partir de [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). Le nom d'utilisateur et le mot de passe doivent être renseignés, et la connexion automatique sera effectuée à chaque lancement du programme.
|
| 221 |
+
|
| 222 |
+
* Pour obtenir des instructions détaillées, consultez le [Manuel TuanziOCR](../doc/Manual_TuanziOCR_FR.md)
|
| 223 |
+
|
| 224 |
+
* Les Modèles`YSGDetector` sont entraînés par [lhj5426](https://github.com/lhj5426), filtrent les onomatopées dans CGs/mangas. Téléchargez depuis [YSGYoloDetector](https://huggingface.co/YSGforMTL/YSGYoloDetector) et placez dans `data/models`.
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
## OCR
|
| 228 |
+
* Les modèles mit* viennent de manga-image-translator, prennent en charge l’anglais, japonais, coréen et l’extraction de couleur du texte.
|
| 229 |
+
* [manga_ocr](https://github.com/kha-white/manga-ocr) est un logiciel de reconnaissance de texte japonais développé par [kha-white](https://github.com/kha-white), principalement destiné aux mangas japonais.
|
| 230 |
+
* Prise en charge de la reconnaissance optique de caractères (OCR) via [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). Le nom d'utilisateur et le mot de passe doivent être renseignés, et la connexion automatique s'effectuera à chaque lancement du programme.
|
| 231 |
+
* L’implémentation actuelle applique l’OCR sur chaque bloc, plus lente et pas plus précise, non recommandée. Préférez Tuanzi Detector.
|
| 232 |
+
* Lorsque vous utilisez le Tuanzi Detector pour la détection de texte, il est recommandé de définir OCR sur none_ocr afin de lire directement le texte, ce qui permet de gagner du temps et de réduire le nombre de requêtes.
|
| 233 |
+
* Pour obtenir des instructions détaillées, consultez le [Manuel TuanziOCR](../doc/Manual_TuanziOCR_FR.md)
|
| 234 |
+
* Ajouté en option sous forme de module PaddleOCR. En mode débogage, un message vous indiquera qu'il n'est pas présent. Vous pouvez simplement l'installer en suivant les instructions qui y sont décrites. Si vous ne souhaitez pas installer le paquet vous-même, il vous suffit de décommenter (supprimer le `#`) les lignes contenant paddlepaddle(gpu) et paddleocr. Tout cela se fait à vos propres risques et périls. Pour moi (bropines) et deux testeurs, tout s'est bien installé, mais vous pourriez rencontrer une erreur. Signalez-la dans le ticket et identifiez-moi.
|
| 235 |
+
* Ajouté [OneOCR](https://github.com/b1tg/win11-oneocr). Modèle WINDOWS local provenant des applications SnippingTOOL ou Win.PHOTOS. Pour l'utiliser, vous devez placer les fichiers du modèle et les fichiers DLL dans le dossier « data/models/one-ocr ». Avant de lancer le programme, il est préférable de copier tous les fichiers en une seule fois. Pour savoir comment trouver et obtenir les fichiers DLL et les fichiers de modèle, consultez : https://github.com/dmMaze/BallonsTranslator/discussions/859#discussioncomment-12876757 . Merci à AuroraWright pour le projet [OneOCR](https://github.com/AuroraWright/oneocr)
|
| 236 |
+
|
| 237 |
+
## Retouche
|
| 238 |
+
* AOT provient de [manga-image-translator](https://github.com/zyddnys/manga-image-translator).
|
| 239 |
+
* Tous les lama* sont affinés à l'aide de [LaMa](https://github.com/advimman/lama)
|
| 240 |
+
* PatchMatch est un algorithme issu de [PyPatchMatch](https://github.com/vacancy/PyPatchMatch), ce programme utilise une [version modifiée](https://github.com/dmMaze/PyPatchMatchInpaint)
|
| 241 |
+
|
| 242 |
+
## Traducteurs
|
| 243 |
+
|
| 244 |
+
Traducteurs disponibles : Google, DeepL, ChatGPT, Sugoi, Caiyun, Baidu, Papago et Yandex.
|
| 245 |
+
|
| 246 |
+
* Vous trouverez des informations sur les modules Traducteurs [ici](../doc/modules/translators.md). *(Anglais)*
|
| 247 |
+
|
| 248 |
+
## FAQ & Divers
|
| 249 |
+
* Si vous avez une carte Nvidia ou une puce Apple, l’accélération matérielle sera activée.
|
| 250 |
+
* Ajout de la prise en charge de [saladict](https://saladict.crimx.com) (*Dictionnaire contextuel et traducteur de pages professionnel tout-en-un*) dans le mini-menu lors de la sélection de texte. [Guide d'installation](../doc/saladict_fr.md)
|
| 251 |
+
* Accélérez les performances si vous disposez d'un périphérique [NVIDIA's CUDA](https://pytorch.org/docs/stable/notes/cuda.html) ou [AMD's ROCm](https://pytorch.org/docs/stable/notes/hip.html), car la plupart des modules utilisent [PyTorch](https://pytorch.org/get-started/locally/).
|
| 252 |
+
* Les polices proviennent des polices de votre système.
|
| 253 |
+
* Merci à [bropines](https://github.com/bropines) pour l'adaptation en russe.
|
| 254 |
+
* Ajout du script JSX « Export vers Photoshop » par [bropines](https://github.com/bropines). </br> Pour lire les instructions, améliorer le code et simplement explorer son fonctionnement, rendez-vous dans `scripts/export vers Photoshop` -> `install_manual.md`.
|
doc/README_ID.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BallonTranslator
|
| 2 |
+
[简体中文](/README.md) | [English](/README_EN.md) | [pt-BR](../doc/README_PT-BR.md) | [Русский](../doc/README_RU.md) | [日本語](../doc/README_JA.md) | Indonesia | [Tiếng Việt](../doc/README_VI.md) | [한국어](../doc/README_KO.md) | [Español](../doc/README_ES.md) | [Français](../doc/README_FR.md)
|
| 3 |
+
|
| 4 |
+
Sebuah aplikasi penerjemahan komik/manga yang dibantu oleh deep learning.
|
| 5 |
+
|
| 6 |
+
<img src="./src/ui0.jpg" div align=center>
|
| 7 |
+
|
| 8 |
+
<p align=center>
|
| 9 |
+
pratinjau
|
| 10 |
+
</p>
|
| 11 |
+
|
| 12 |
+
# Fitur
|
| 13 |
+
* Terjemahan otomatis
|
| 14 |
+
- Mendukung pendeteksian, pengenalan, penghapusan, dan penerjemahan teks secara otomatis, performa keseluruhan bergantung pada modul-modul ini.
|
| 15 |
+
- Peletakkan kata-kata berdasarkan perkiraan letak teks aslinya.
|
| 16 |
+
- Mendukung format manga dan komik.
|
| 17 |
+
- Typesetting optimal untuk manga->bahasa Inggris, bahasa Inggris->Mandarin (berdasarkan ekstraksi daerah balon.).
|
| 18 |
+
|
| 19 |
+
* Pengeditan gambar
|
| 20 |
+
- Mendukung pengeditan mask & inpainting (seperti alat content aware fill di PS)
|
| 21 |
+
- Mendukung gambar dengan rasio aspek ekstrim seperti webtoon
|
| 22 |
+
|
| 23 |
+
* Pengeditan teks
|
| 24 |
+
- Mendukung format rich text dan style teks, teks yang diterjemahkan dapat diedit secara langsung.
|
| 25 |
+
- Mendukung pencarian & penggantian kata
|
| 26 |
+
- Mendukung ekspor/impor ke/dari dokumen word
|
| 27 |
+
|
| 28 |
+
# Instalasi
|
| 29 |
+
|
| 30 |
+
**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.)
|
| 31 |
+
|
| 32 |
+
## Jalankan kode sumber
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
# Clone repo ini
|
| 36 |
+
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
|
| 37 |
+
|
| 38 |
+
# instal requirements_macOS.txt di macOS
|
| 39 |
+
$ pip install -r requirements.txt
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
Instal pytorch-cuda untuk dapat akselerasi GPU jika Anda memiliki GPU NVIDIA.
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu116
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
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
|
| 49 |
+
```bash
|
| 50 |
+
python ballontranslator
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
Untuk pengguna Linux atau MacOS, lihat [script ini](ballontranslator/scripts/download_models.sh) dan jalankan untuk mengunduh semua model
|
| 54 |
+
|
| 55 |
+
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.
|
| 56 |
+
|
| 57 |
+
# Penggunaan
|
| 58 |
+
**Disarankan untuk menjalankan program di terminal jika program ini crash dan tidak meninggalkan informasi, lihat gif berikut ini**
|
| 59 |
+
<img src="./src/run.gif">
|
| 60 |
+
|
| 61 |
+
- Pilih penerjemah yang diinginkan dan atur sumber dan target bahasa.
|
| 62 |
+
- Buka folder yang berisi gambar manga/manhua/webtoon yang ingin diterjemahkan.
|
| 63 |
+
- Klik tombol "Run" dan tunggu hingga proses selesai.
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
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)
|
| 67 |
+
|
| 68 |
+
## Image editing
|
| 69 |
+
|
| 70 |
+
### inpaint tool
|
| 71 |
+
<img src="./src/imgedit_inpaint.gif">
|
| 72 |
+
<p align = "center">
|
| 73 |
+
Mode pengeditan gambar, alat inpainting
|
| 74 |
+
</p>
|
| 75 |
+
|
| 76 |
+
### rect tool
|
| 77 |
+
<img src="./src/rect_tool.gif">
|
| 78 |
+
<p align = "center">
|
| 79 |
+
Alat rect
|
| 80 |
+
</p>
|
| 81 |
+
|
| 82 |
+
Untuk 'menghapus' hasil inpainting yang tidak diinginkan, gunakan alat inpainting atau alat rect dengan menekan **tombol kanan**.
|
| 83 |
+
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.
|
| 84 |
+
|
| 85 |
+
## Pengeditan teks
|
| 86 |
+
<img src="./src/textedit.gif">
|
| 87 |
+
<p align = "center">
|
| 88 |
+
Mode Pengeditan teks
|
| 89 |
+
</p>
|
| 90 |
+
|
| 91 |
+
<img src="./src/multisel_autolayout.gif" div align=center>
|
| 92 |
+
<p align=center>
|
| 93 |
+
pemformatan kumpulan tata letak teks secara otomatis
|
| 94 |
+
</p>
|
| 95 |
+
|
| 96 |
+
<img src="./src/ocrselected.gif" div align=center>
|
| 97 |
+
<p align=center>
|
| 98 |
+
pengenalan kata & menerjemahkan area yang dipilih
|
| 99 |
+
</p>
|
| 100 |
+
|
| 101 |
+
## Shortcuts
|
| 102 |
+
* ```A```/```D``` atau ```pageUp```/```Down``` untuk pindah halaman.
|
| 103 |
+
* ```Ctrl+Z```, ```Ctrl+Shift+Z``` untuk undo/redo.(catatan: sejarah undo akan dihapus setelah pindah halaman)
|
| 104 |
+
* ```T``` untuk masuk mode text-editting (atau tombol "T" di toolbar bagian bawah).
|
| 105 |
+
*```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)
|
| 106 |
+
* ```P``` untuk mode edit gambar.
|
| 107 |
+
* Di mode edit gambar, gunakan penggeser di bagian kanan bawah untuk mengontrol transparansi gambar asli.
|
| 108 |
+
* Tombol "OCR" dan "A" di toolbar bagian bawah dapat mengaktifkan OCR dan penerjemahan, jika Anda menonaktifkannya, program hanya akan melakukan deteksi dan penghapusan teks.
|
| 109 |
+
* Mengatur parameter modul otomatis di panel konfigurasi.
|
| 110 |
+
* ```Ctrl++```/```Ctrl+-``` untuk mengubah ukuran gambar
|
| 111 |
+
* ```Ctrl+G```/```Ctrl+F``` untuk mencari secara global/dalam halaman saat ini.
|
| 112 |
+
|
| 113 |
+
<img src="./src/configpanel.png">
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
# Modul otomasi
|
| 117 |
+
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:
|
| 118 |
+
- Ko-fi: <https://ko-fi.com/voilelabs>
|
| 119 |
+
- Patreon: <https://www.patreon.com/voilelabs>
|
| 120 |
+
- 爱发电: <https://afdian.net/@voilelabs>
|
| 121 |
+
|
| 122 |
+
Sugoi translator dibuat oleh [mingshiba](https://www.patreon.com/mingshiba).
|
| 123 |
+
|
| 124 |
+
## Deteksi teks
|
| 125 |
+
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)
|
| 126 |
+
|
| 127 |
+
## OCR
|
| 128 |
+
* Model pengenalan teks mit_32px berasal dari manga-image-translator, mendukung pengenalan teks bahasa Inggris dan Jepang dan warna teks.
|
| 129 |
+
* Model pengenalan teks mit_48px berasal dari manga-image-translator, mendukung pengenalan teks bahasa Inggris, Jepang, dan Korea serta warna teks.
|
| 130 |
+
* [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.
|
| 131 |
+
|
| 132 |
+
## Inpainting
|
| 133 |
+
* AOT berasal dari manga-image-translator.
|
| 134 |
+
* patchmatch adalah sebuah algoritma dari [PyPatchMatch](https://github.com/vacancy/PyPatchMatch), program ini menggunakan [versi dimodifikasi](https://github.com/dmMaze/PyPatchMatchInpaint) dari saya.
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
## Penerjemah
|
| 138 |
+
|
| 139 |
+
* <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.
|
| 140 |
+
* Penerjemah Caiyun perlu memerlukan [token] (https://dashboard.caiyunapp.com/).
|
| 141 |
+
* Papago.
|
| 142 |
+
* DeepL & Sugoi translator (dan konversi CT2 Translation-nya), terima kasih kepada [Snowad14](https://github.com/Snowad14).
|
| 143 |
+
|
| 144 |
+
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.
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
## Hal lain
|
| 148 |
+
* 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.
|
| 149 |
+
* Terima kasih kepada [bropines] (https://github.com/bropines) untuk lokalisasi bahasa Rusia.
|
| 150 |
+
* 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)
|
doc/README_JA.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BallonTranslator
|
| 2 |
+
[简体中文](/README.md) | [English](/README_EN.md) | [pt-BR](../doc/README_PT-BR.md) | [Русский](../doc/README_RU.md) | 日本語 | [Indonesia](../doc/README_ID.md) | [Tiếng Việt](../doc/README_VI.md) | [한국어](../doc/README_KO.md) | [Español](../doc/README_ES.md) | [Français](../doc/README_FR.md)
|
| 3 |
+
|
| 4 |
+
ディープラーニングを活用したマンガ翻訳支援ツール。
|
| 5 |
+
|
| 6 |
+
<img src="./src/ui0.jpg" div align=center>
|
| 7 |
+
|
| 8 |
+
<p align=center>
|
| 9 |
+
プレビュー
|
| 10 |
+
</p>
|
| 11 |
+
|
| 12 |
+
# 特徴
|
| 13 |
+
* 完全自動翻訳
|
| 14 |
+
- 自動テキスト検出、認識、削除、翻訳をサポートし、全体的な性能はこれらのモジュールに依存します。
|
| 15 |
+
- 文字配置は、原文の書式推定に基づいています。
|
| 16 |
+
- 漫画やコミックでまともに動作します。
|
| 17 |
+
- マンガ->英語、英語->中国語の組版が改善されました(バルーン領域の抽出に基づく)。
|
| 18 |
+
|
| 19 |
+
* 画像編集
|
| 20 |
+
マスク編集とインペイントのサポート(PSのスポットヒーリングブラシツールのようなもの)
|
| 21 |
+
|
| 22 |
+
* テキストの編集
|
| 23 |
+
リッチテキストフォーマットをサポートし、翻訳されたテキストはインタラクティブに編集することができます。
|
| 24 |
+
|
| 25 |
+
# 使用方法
|
| 26 |
+
|
| 27 |
+
Windowsユーザーは、[腾讯云](https://share.weiyun.com/xoRhz9i4)または[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.)
|
| 28 |
+
|
| 29 |
+
## ソースコードの実行
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
# このリポジトリのクローン
|
| 33 |
+
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
|
| 34 |
+
|
| 35 |
+
# macOSの場合、requirements_macOS.txtをインストール
|
| 36 |
+
$ pip install -r requirements.txt
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
NVIDIA GPUをお持ちの場合、GPUアクセラレーションを有効にするためにpytorch-cudaをインストールします。
|
| 40 |
+
|
| 41 |
+
```bash
|
| 42 |
+
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu116
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
[MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) or [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) から **data** フォルダをダウンロードし、BallonsTranslator/ballontranslatorに移動して、最後に以下を実行します
|
| 46 |
+
```bash
|
| 47 |
+
python ballontranslator
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
Sugoi Translator(日英のみ)を使用するには、[オフラインモデル](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm)をダウンロードし、"sugoi_translator"をBallonsTranslator/ballontranslator/data/modelsに移動してください。
|
| 52 |
+
|
| 53 |
+
## 完全自動翻訳
|
| 54 |
+
**万が一、プログラムがクラッシュして情報が残らなかった場合に備えて、以下のgifを参考に、ターミナルで実行することをお勧めします。**また、初回実行時に希望するトランスレータを選択し、ソース言語とターゲット言語を設定してください。翻訳が必要な画像が入ったフォルダを開き、
|
| 55 |
+
「実行」ボタンをクリックして処理が完了するのを待ちます。
|
| 56 |
+
<img src="./src/run.gif">
|
| 57 |
+
|
| 58 |
+
このとき、フォントサイズや色などのフォントフォーマットはプログラムによって自動的に決定されますが、panel->Letteringで、対応するオプションを"decide by program"から"use global setting"に変更すれば、これらのフォーマットを事前に決定できます(グローバル設定とは、シーン内の
|
| 59 |
+
テキストブロックを編集していないときに右フォントフォーマットパネルで表示されるフォーマットのことです)。
|
| 60 |
+
|
| 61 |
+
## 画像編集
|
| 62 |
+
|
| 63 |
+
### 修復ツール
|
| 64 |
+
<img src="./src/imgedit_inpaint.gif">
|
| 65 |
+
<p align = "center">
|
| 66 |
+
画像編集モード、修復ツール
|
| 67 |
+
</p>
|
| 68 |
+
|
| 69 |
+
### 長方形ツール
|
| 70 |
+
<img src="./src/rect_tool.gif">
|
| 71 |
+
<p align = "center">
|
| 72 |
+
長方形ツール
|
| 73 |
+
</p>
|
| 74 |
+
|
| 75 |
+
不要なインペイント結果を"消去"するには、**右ボタン**を押した状態でインペイントツールまたは矩形ツールを使用します。
|
| 76 |
+
結果はアルゴリズム(gifの"方法1"と"方法2")がどれだけ正確にテキストマスクを抽出するかに依存します。複雑なテキストと背景の場合、パフォーマンスが低下する可能性があります。
|
| 77 |
+
|
| 78 |
+
## テキスト編集
|
| 79 |
+
<img src="./src/textedit.gif">
|
| 80 |
+
<p align = "center">
|
| 81 |
+
テキスト編集モード
|
| 82 |
+
</p>
|
| 83 |
+
|
| 84 |
+
<img src="./src/multisel_autolayout.gif" div align=center>
|
| 85 |
+
<p align=center>
|
| 86 |
+
テキストの一括書式設定と自動レイアウト
|
| 87 |
+
</p>
|
| 88 |
+
|
| 89 |
+
## ショートカット
|
| 90 |
+
* A/D または pageUp/Down でページをめくります。
|
| 91 |
+
* Ctrl+Z, Ctrl+Y でほとんどの操作を元に戻す/やり直すことができます。
|
| 92 |
+
* T でテキスト編集モード、(または下部のツールバーの「T」ボタン)W を押してテキストブロック作成モードを起動し、右ボタンをクリックしたままキャンバス上でマウスをドラッグすると、新しいテキストブロックが追加されます。(テキスト編集のgifを参照)。
|
| 93 |
+
* Pで画像編集モードへ。
|
| 94 |
+
* 画像編集モードでは、右下のスライダーでオリジナル画像の透明度を調整します。
|
| 95 |
+
* 下のツールバーの「OCR」と「A」ボタンは、OCRと翻訳を有効にするかどうかを制御し、それらを無効にした場合、プログラムはテキストの検出と削除を行いますだけです。
|
| 96 |
+
* 設定パネルで自動モジュールのパラメータを設定します。
|
| 97 |
+
* 画像のサイズを変更するには、Ctrl + +/。
|
| 98 |
+
|
| 99 |
+
<img src="./src/configpanel.png">
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
# Automation modules
|
| 103 |
+
このプロジェクトは[manga-image-translator](https://github.com/zyddnys/manga-image-translator)に大きく依存しており、オンラインサービスやモデルトレーニングは安くないので、プロジェクトの寄付を検討してください:
|
| 104 |
+
- Ko-fi: <https://ko-fi.com/voilelabs>
|
| 105 |
+
- Patreon: <https://www.patreon.com/voilelabs>
|
| 106 |
+
- 爱发电: <https://afdian.net/@voilelabs>
|
| 107 |
+
|
| 108 |
+
Sugoi translatorは、[mingshiba](https://www.patreon.com/mingshiba)によって作成されています。
|
| 109 |
+
|
| 110 |
+
## 文字検出
|
| 111 |
+
英語と日本語のテキスト検出をサポートし、学習コードと詳細は[comic-text-detector](https://github.com/dmMaze/comic-text-detector)に掲載されています
|
| 112 |
+
|
| 113 |
+
## OCR
|
| 114 |
+
* mit_32pxのテキスト認識モデルは、manga-image-translatorのもので、英語と日本語の認識とテキスト色の抽出をサポートしています。
|
| 115 |
+
* mit_48pxのテキスト認識モデルは、manga-image-translatorのもので、英語、日本語、韓国語の認識とテキストカラーの抽出をサポートしています。
|
| 116 |
+
* [manga_ocr](https://github.com/kha-white/manga-ocr)は[kha-white](https://github.com/kha-white)からです、
|
| 117 |
+
|
| 118 |
+
## 修復
|
| 119 |
+
* AOTは、manga-image-translatorからです
|
| 120 |
+
* patchmatchは[PyPatchMatch](https://github.com/vacancy/PyPatchMatch)のnondl algrithomで、このプログラムは私による[修正版](https://github.com/dmMaze/PyPatchMatchInpaint)を使用しています。
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
## 翻訳者
|
| 124 |
+
|
| 125 |
+
* GFW によってブロックされていない場合は、goolge トランスレータの URL を *.cn から *.com に変更してください。
|
| 126 |
+
* Caiyunの翻訳者は[token](https://dashboard.caiyunapp.com/)を必要とします
|
| 127 |
+
* papago
|
| 128 |
+
* DeepL & Sugoi translator(およびCT2変換)、[Snowad14](https://github.com/Snowad14)に感謝します
|
| 129 |
+
|
| 130 |
+
新しいトランスレータを追加するには、[how_to_add_new_translator](doc/how_to_add_new_translator.md)を参照してください。これはBaseClassをサブクラスにして、2つのインターフェースを実装するだけでアプリケーションで使用できますので、プロジェクトへのコントリビュートは歓迎します。
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
## その他
|
| 134 |
+
* あなたのコンピュータにNvidia GPUがある場合、プログラムはデフォルトですべてのモデルのcudaアクセラレーションを有効にし、およそ6G GPUメモリを必要とします。
|
| 135 |
+
* ロシア語のローカライズを担当した[bropines](https://github.com/bropines)に感謝します。
|
doc/README_KO.md
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
> [!IMPORTANT]
|
| 2 |
+
> **번역 결과물을 공개적으로 공유할 때 숙련된 번역가가 번역이나 교정에 참여하지 않았다면, 기계 번역임을 잘 보이는 곳에 표시해 주세요.**
|
| 3 |
+
|
| 4 |
+
# BallonTranslator
|
| 5 |
+
[简体中文](/README.md) | [English](/README_EN.md) | [pt-BR](../doc/README_PT-BR.md) | [Русский](../doc/README_RU.md) | [日本語](../doc/README_JA.md) | [Indonesia](../doc/README_ID.md) | [Tiếng Việt](../doc/README_VI.md) | 한국어 | [Español](../doc/README_ES.md) | [Français](../doc/README_FR.md)
|
| 6 |
+
|
| 7 |
+
딥러닝으로 구동되는 또 다른 컴퓨터 지원 만화/만화 번역 툴.
|
| 8 |
+
|
| 9 |
+
<img src="./src/ui0.jpg" div align=center>
|
| 10 |
+
|
| 11 |
+
<p align=center>
|
| 12 |
+
미리보기
|
| 13 |
+
</p>
|
| 14 |
+
|
| 15 |
+
# 특징
|
| 16 |
+
* 완전 자동화된 번역
|
| 17 |
+
- 자동 텍스트 감지, 인식, 제거 및 번역을 지원합니다. 전반적인 성능은 이러한 모듈에 따라 좌우집니다.
|
| 18 |
+
- 대사는 원본 텍스트의 서식 추정치를 기반으로 합니다.
|
| 19 |
+
- 망가와 코믹스 등을 작업할 수 있습니다.
|
| 20 |
+
- 영어-중국어 및 일본어-영어 조판이 최적화되었습니다. 텍스트 레이아웃은 추출된 배경 풍선을 기반으로 합니다. 중국어 문장은 pkuseg를 기반으로 분할됩니다. 일본어 번역의 세로 레이아웃이 개선되었습니다.
|
| 21 |
+
|
| 22 |
+
* 이미지 편집
|
| 23 |
+
- 마스크 편집 & 인페인팅 지원 (PS에 있는 스팟 힐링 브러쉬 툴 같이)
|
| 24 |
+
- 웹툰과 같은 길다란 이미지도 편집 가능합니다
|
| 25 |
+
|
| 26 |
+
* 텍스트 편집
|
| 27 |
+
- 풍부한 텍스트 포맷 지원 [텍스트 스타일 프리셋](https://github.com/dmMaze/BallonsTranslator/pull/311) 및, 번역된 텍스트는 대화형으로 편집할 수 있습니다.
|
| 28 |
+
- 찾기 & 바꾸기 지원
|
| 29 |
+
- 워드 문서를 불러오기/내보내기 지원
|
| 30 |
+
|
| 31 |
+
# 설치
|
| 32 |
+
|
| 33 |
+
## Windows에서
|
| 34 |
+
Python 및 Git을 직접 설치하고 싶지 않으며 인터넷이 가능하다면:
|
| 35 |
+
다음 링크에서 BallonsTranslator_dev_src_with_gitpython.7z 를 다운로드 하세요. [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) or [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) 그 후 launch_win.bat 를 실행합니다.
|
| 36 |
+
scripts/local_gitpull.bat를 실행하여 최신 업데이트를 받으세요.
|
| 37 |
+
이 제공된 패키지는 Windows 7에서 실행할 수 없습니다. Win 7 사용자는 [Python 3.8](https://www.python.org/downloads/release/python-3810/)를 설치하고 소스 코드를 실행해야합니다.
|
| 38 |
+
|
| 39 |
+
## 소스 코드를 실행
|
| 40 |
+
|
| 41 |
+
[Python] 설치 (https://www.python.org/downloads/release/python-31011) **<= 3.12** (Microsoft 스토어에서 설치 한 것을 사용하지 마세요) 및 [Git](https://git-scm.com/downloads).
|
| 42 |
+
|
| 43 |
+
```bash
|
| 44 |
+
# 이 레포 복사
|
| 45 |
+
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
|
| 46 |
+
|
| 47 |
+
# 앱 실행
|
| 48 |
+
$ python3 launch.py
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
처음 시작하면 필요한 라이브러리 및 모델을 자동으로 다운로드 하여 설치합니다. 다운로드가 실패한 경우, 다음 링크에서 **data** 폴더(또는 터미널에 표기된 누락된 파일)를 다운로드해야 합니다. [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) 또는 [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) 그리고 해당되는 소스코드 폴더에 저장하세요.
|
| 52 |
+
|
| 53 |
+
## macOS 애플리케이션 빌드 (Intel 및 Apple 실리콘 칩 모두 호환)
|
| 54 |
+
<i>Note macOS는 작동하지 않을 경우 소스 코드를 실행할 수 있습니다.</i>
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
|
| 58 |
+
#### 1. 준비
|
| 59 |
+
- 다음 링크에서 라이브러리 및 모델을 다운로드 합니다. [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw "MEGA") 또는 [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing)
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
<img width="1268" alt="截屏2023-09-08 13 44 55_7g32SMgxIf" src="https://github.com/dmMaze/BallonsTranslator/assets/134026642/40fbb9b8-a788-4a6e-8e69-0248abaee21a">
|
| 63 |
+
|
| 64 |
+
- 다운로드한 모든 리소스를 data 폴더에 넣습니다. 최종 디렉터리 트리 구조는 다음과 같습니다:
|
| 65 |
+
|
| 66 |
+
```
|
| 67 |
+
data
|
| 68 |
+
├── libs
|
| 69 |
+
│ └── patchmatch_inpaint.dll
|
| 70 |
+
└── models
|
| 71 |
+
├── aot_inpainter.ckpt
|
| 72 |
+
├── comictextdetector.pt
|
| 73 |
+
├── comictextdetector.pt.onnx
|
| 74 |
+
├── lama_mpe.ckpt
|
| 75 |
+
├── manga-ocr-base
|
| 76 |
+
│ ├── README.md
|
| 77 |
+
│ ├── config.json
|
| 78 |
+
│ ├── preprocessor_config.json
|
| 79 |
+
│ ├── pytorch_model.bin
|
| 80 |
+
│ ├── special_tokens_map.json
|
| 81 |
+
│ ├── tokenizer_config.json
|
| 82 |
+
│ └── vocab.txt
|
| 83 |
+
├── mit32px_ocr.ckpt
|
| 84 |
+
├── mit48pxctc_ocr.ckpt
|
| 85 |
+
└── pkuseg
|
| 86 |
+
├── postag
|
| 87 |
+
│ ├── features.pkl
|
| 88 |
+
│ └── weights.npz
|
| 89 |
+
├── postag.zip
|
| 90 |
+
└── spacy_ontonotes
|
| 91 |
+
├── features.msgpack
|
| 92 |
+
└── weights.npz
|
| 93 |
+
|
| 94 |
+
7 디렉토리, 23 파일
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
- 파이썬 버전들을 관리하기 위해 pyenv 명령줄 도구를 설치합니다. 홈브류를 통해 설치하는 것을 추천합니다.
|
| 98 |
+
```
|
| 99 |
+
# 홈브류를 통해 설치합니다.
|
| 100 |
+
brew install pyenv
|
| 101 |
+
|
| 102 |
+
# 공식 스크립트를 통해 설치합니다.
|
| 103 |
+
curl https://pyenv.run | bash
|
| 104 |
+
|
| 105 |
+
# 설치 후 셀 환경변수를 설정합니다.
|
| 106 |
+
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
| 107 |
+
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
| 108 |
+
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
#### 2、응용 프로그램 빌드
|
| 113 |
+
```
|
| 114 |
+
# 작업 경로인 `data` 입력
|
| 115 |
+
cd data
|
| 116 |
+
|
| 117 |
+
# 레포의 `dev` 브렌치를 복제합니다
|
| 118 |
+
git clone -b dev https://github.com/dmMaze/BallonsTranslator.git
|
| 119 |
+
|
| 120 |
+
# 작업 경로인 `BallonsTranslator` 를 입력합니다
|
| 121 |
+
cd BallonsTranslator
|
| 122 |
+
|
| 123 |
+
# 빌드 스크립트를 실행하면, pyinstaller 단계에서 비밀번호를 물어봅니다. 비밀번호를 입력하고 엔터를 누릅니다.
|
| 124 |
+
sh scripts/build-macos-app.sh
|
| 125 |
+
```
|
| 126 |
+
> 📌패키지 응용 프로그램은 ./data/BallonsTranslator/dist/BallonsTranslator.app 에 있으며, macOS 애플리케이션 폴더에 앱을 드래그하여 설치합니다. 추가 Python config 없이 사용할 수 있습니다.
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
</details>
|
| 130 |
+
|
| 131 |
+
# 사용법
|
| 132 |
+
|
| 133 |
+
**충돌시 관련 정보를 남기기 위해 터미널 에서 프로그램을 실행하는 것이 좋습니다. 다음 GIF를 참조하십시오.**
|
| 134 |
+
<img src="./src/run.gif">
|
| 135 |
+
- 프로그램을 처음 실행하는 경우, 설정 아이콘을 클릭하여 번역기를 선택하고 소스 및 대상 언어를 설정하십시오.
|
| 136 |
+
- 폴더 아이콘을 클릭하여 번역이 필요한 만화(코믹,망가 등)의 이미지를 포함하는 폴더를 엽니다.
|
| 137 |
+
- '실행`버튼을 클릭하고 프로세스를 완료합니다.
|
| 138 |
+
|
| 139 |
+
이 과정에서 글꼴 크기 및 색상과 같은 글꼴 형식은 프로그램에 의해 자동으로 결정되며, 설정 패널->글꼴 설정에서 해당 옵션을 “프로그램이 결정”에서 “전역 설정 사용”으로 변경하여 해당 형식을 미리 결정할 수 있습니다. (전역 설정은 장면에서 텍스트 블록을 편집하지 않을 때 오른쪽 글꼴 형식 패널에 표시되는 스타일 입니다.)
|
| 140 |
+
<img src="./src/global_font_format.png">
|
| 141 |
+
|
| 142 |
+
## 이미지 편집
|
| 143 |
+
|
| 144 |
+
### 인페인트 도구
|
| 145 |
+
<img src="./src/imgedit_inpaint.gif">
|
| 146 |
+
<p align = "center">
|
| 147 |
+
이미지 편집 모드, 인페인팅 도구
|
| 148 |
+
</p>
|
| 149 |
+
|
| 150 |
+
### 글상자 도구
|
| 151 |
+
<img src="./src/rect_tool.gif">
|
| 152 |
+
<p align = "center">
|
| 153 |
+
글상자 도구
|
| 154 |
+
</p>
|
| 155 |
+
|
| 156 |
+
원하지 않는 칠한 결과를 '지우려면' **오른쪽 버튼**을 누른 상태에서 인페인팅 도구 또는 글상자 도구를 사용합니다.
|
| 157 |
+
결과는 알고리즘('방법 1' 및 '방법 2'의 GIF)이 텍스트 마스크를 얼마나 정확하게 추출하는지에 따라 달라집니다. 복잡한 텍스트 및 배경에서는 성능이 저하될 수 있습니다.
|
| 158 |
+
|
| 159 |
+
## 텍스트 편집
|
| 160 |
+
<img src="./src/textedit.gif">
|
| 161 |
+
<p align = "center">
|
| 162 |
+
텍스트 편집 모드
|
| 163 |
+
</p>
|
| 164 |
+
|
| 165 |
+
<img src="./src/multisel_autolayout.gif" div align=center>
|
| 166 |
+
<p align=center>
|
| 167 |
+
일괄 텍스트 포맷팅 및 자동 레이아웃
|
| 168 |
+
</p>
|
| 169 |
+
|
| 170 |
+
<img src="./src/ocrselected.gif" div align=center>
|
| 171 |
+
<p align=center>
|
| 172 |
+
선택 영역 OCR 및 번역
|
| 173 |
+
</p>
|
| 174 |
+
|
| 175 |
+
## 단축키
|
| 176 |
+
* ```A```/```D``` 및 ```pageUp```/```Down``` 으로 페이지를 이동합니다.
|
| 177 |
+
* ```Ctrl+Z```, ```Ctrl+Shift+Z``` 로 대부분의 작업을 취소합니다. (페이지를 이동하면 작업을 취소할 수 없음에 유의하세요)
|
| 178 |
+
* ```T``` 를 눌러 텍스트 편집 모드로 전환합니다(또는 하단 도구 모음의 “T” 버튼).
|
| 179 |
+
* ```W``` 를 눌러 텍스트 블록 생성 모드를 활성화 합니다. 오른쪽 버튼을 클릭한 상태에서 마우스를 캔버스 위로 드래그하여 새 텍스트 블록을 추가합니다. (텍스트 편집 GIF 참조)
|
| 180 |
+
* ```P``` 를 눌러 이미지 편집 모드로 전환합니다.
|
| 181 |
+
* 이미지 편집 모드에서 오른쪽 하단의 슬라이더를 사용하여 원본 이미지의 투명도를 조절합니다.
|
| 182 |
+
* 제목 표시줄->실행에서 자동 모듈을 활성화하거나 비활성화할 수 있으며, 모든 모듈을 비활성화한 상태로 실행하면 해당 설정에 따라 모든 텍스트가 다시 레터링되고 다시 렌더링됩니다.
|
| 183 |
+
* 설정 패널에서 자동 모듈의 매개변수를 설정합니다.
|
| 184 |
+
* ```Ctrl++```/```Ctrl+-``` (또는 ```Ctrl+Shift+=```) 로 이미지 크기를 조절합니다
|
| 185 |
+
* ```Ctrl+G```/```Ctrl+F``` 로 모든페이지 혹은 현재페이지 내에서 검색합니다.
|
| 186 |
+
* ```0-9``` 로 텍스트 레이어의 불투명도를 조정합니다.
|
| 187 |
+
* 텍스트 스타일: 두껍게 - ```Ctrl+B```, 밑줄 - ```Ctrl+U```, 이탤릭 - ```Ctrl+I```
|
| 188 |
+
* 텍스트 스타일 패널 -> 효과에서 텍스트 그림자 및 투명도를 설정합니다.
|
| 189 |
+
* ```Alt+Arrow Keys``` 및 ```Alt+WASD``` (또는 텍스��� 편집 모드에서 ```pageDown``` 및 ```pageUp```) 로 텍스트 블록 사이를 전환합니다.
|
| 190 |
+
|
| 191 |
+
<img src="./src/configpanel.png">
|
| 192 |
+
|
| 193 |
+
## 헤드리스 모드 (GUI 없이 실행)
|
| 194 |
+
``` python
|
| 195 |
+
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
|
| 196 |
+
```
|
| 197 |
+
메모: 설정(원본 언어, 목표 언어, 인페인트 모델 등등)은 config/config.json에서 로드합니다.
|
| 198 |
+
렌더링 된 글꼴 크기가 맞지 않다면, ```--ldpi ```를 통해 DPI를 수동으로 지정하세요. 보편적인 값은 96 및 72입니다.
|
| 199 |
+
|
| 200 |
+
|
| 201 |
+
# 자동화 모듈
|
| 202 |
+
이 프로젝트는 [manga-image-translator](https://github.com/zyddnys/manga-image-translator)에 크게 의존합니다. 온라인 서비스 및 모델 교육은 저렴하지 않으며 프로젝트 기부를 고려하십시오.
|
| 203 |
+
- Ko-fi: <https://ko-fi.com/voilelabs>
|
| 204 |
+
- Patreon: <https://www.patreon.com/voilelabs>
|
| 205 |
+
- 爱发电: <https://afdian.net/@voilelabs>
|
| 206 |
+
|
| 207 |
+
[Sugoi translator](https://sugoitranslator.com/)는 [mingshiba](https://www.patreon.com/mingshiba)에 의해 개발되었습니다.
|
| 208 |
+
|
| 209 |
+
## 텍스트 검출
|
| 210 |
+
* 영어 및 일본어의 텍스트 감지를 지원하며, 훈련 코드 및 자세한 내용은 [comic-text-detector](https://github.com/dmMaze/comic-text-detector)에서 확인할 수 있습니다.
|
| 211 |
+
* [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/)의 텍스트 감지를 지원합니다. 사용자 이름과 비밀번호는 입력해야 하며, 매 프로그램 실행 시 자동으로 로그인 됩니다.
|
| 212 |
+
|
| 213 |
+
* 자세한 지침에 대해서는 **Tuanzi OCR 지침**: ([Chinese](./团子OCR说明.md) & [Brazilian Portuguese](./Manual_TuanziOCR_pt-BR.md) 만)
|
| 214 |
+
## OCR
|
| 215 |
+
* 모든 mit* 모델은 manga-image-translator 에 기반하며, 영어, 일본어 및 한국어의 인식 및 텍스트 색상 추출을 지원합니다.
|
| 216 |
+
* [kha-white](https://github.com/kha-white) 의 [manga_ocr](https://github.com/kha-white/manga-ocr) 는 , 일본어의 텍스트 인식을 수행하며, 일본어 만화의 초점을 맞췄습니다.
|
| 217 |
+
* [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/) 를 사용한 텍스트 감지를 지원합니다. 사용자 이름과 비밀번호는 입력해야 하며, 매 프로그램 실행 시 자동으로 로그인 됩니다.
|
| 218 |
+
* 현재 구현은 각 텍스트 블록에 OCR을 개별적으로 사용하며, 속도가 느리고 정확도가 크게 향상되지 않습니다. 추천되지 않습니다. 필요한 경우, 대신 Tuanzi Detector를 사용하십시오.
|
| 219 |
+
* 텍스트 감지에 대한 Tuanzi 검출기를 사용하는 경우, OCR을 none_ocr로 설정하여 텍스트, 저장 시간을 직접 읽고 요청의 수를 줄이는 것이 좋습니다.
|
| 220 |
+
* 자세한 지침에 대해서는 **Tuanzi OCR 지침**: ([Chinese](./团子OCR说明.md) & [Brazilian Portuguese](./Manual_TuanziOCR_pt-BR.md) 만)
|
| 221 |
+
* “선택적” PaddleOCR 모듈이 추가되었습니다. 디버그 모드에서는 이 모듈이 없다는 메시지가 표시됩니다. 여기에 설명된 지침에 따라 간단히 설치할 수 있습니다. 패키지를 직접 설치하지 않으려면 paddlepaddle(gpu) 및 paddleocr 줄의 주석(`#` 제거)을 해제하면 됩니다. 자신의 위험과 위험을 감수하고 모든 것을 베팅하세요. 저(브로핀)와 두 명의 테스터에게는 모든 것이 정상적으로 설치되었으므로 오류가 있을 수 있습니다. 이슈에 글을 작성하고 저를 태그하세요.
|
| 222 |
+
|
| 223 |
+
## 소개
|
| 224 |
+
* AOT는 [manga-image-translator](https://github.com/zyddnys/manga-image-translator) 에 기반합니다.
|
| 225 |
+
* 모든 lama*는 [LaMa](https://github.com/advimman/lama) 를 사용하여 파인튜닝 되었습니다.
|
| 226 |
+
* PatchMatch는 [PyPatchMatch](https://github.com/vacancy/PyPatchMatch) 의 알고리즘입니다. 이 프로그램은 [modified version](https://github.com/dmMaze/PyPatchMatchInpaint)을 사용합니다.
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
## 번역기
|
| 230 |
+
가능한 번역기: Google, DeepL, ChatGPT, Sugoi, Caiyun, Baidu. Papago 및 Yandex.
|
| 231 |
+
* Google은 중국의 번역 서비스를 종료하였으니, 설정 패널에서 해당 'URL'을 *.com으로 설정하세요.
|
| 232 |
+
* [Caiyun](https://dashboard.caiyunapp.com/), [ChatGPT](https://platform.openai.com/playground), [Yandex](https://yandex.com/dev/translate/), [Baidu](http://developers.baidu.com/), 및 [DeepL](https://www.deepl.com/docs-api/api-access) 번역기는 토큰 혹은 api 키를 요구합니다.
|
| 233 |
+
* DeepL & Sugoi 번역기 (그리고 그것은 CT2 번역 변환입니다) [Snowad14](https://github.com/Snowad14) 에게 감사를 표합니다.
|
| 234 |
+
* Sugoi는 완전히 오프라인으로 일본어를 영어로 번역합니다. [오프라인 모델](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm) 을 다운로드 하고, "sugoi_translator"를 BallonsTranslator/ballontranslator/data/models 에 이동시키세요.
|
| 235 |
+
* [Sakura-13B-Galgame](https://github.com/SakuraLLM/Sakura-13B-Galgame), 로컬 장치로 실행할 때 vram OOM 으로 인한 충돌이 발생하는 경우 설정 패널에서 ```low vram mode``` 를 설정하세요. (기본으로 활성화됨)
|
| 236 |
+
* DeepLX: [Vercel](https://github.com/bropines/Deeplx-vercel) 또는 [deeplx](https://github.com/OwO-Network/DeepLX)를 참조하시기 바랍니다.
|
| 237 |
+
* [Translators](https://github.com/UlionTse/translators) 라이브러리를 추가하여 api 키 없이 일부 번역 서비스에 액세스할 수 있습니다. 지원되는 서비스에 대해 찾을 수 있습니다 [참고](https://github.com/UlionTse/translators#supported-translation-services).
|
| 238 |
+
* OpenAI API와 호환되는 공식 또는 제3자 LLM 제공 업체와 함께 작동하는 두 가지 버전의 OpenAI-compliant 번역기를 지원하며, 설정 패널에서 몇가지 설정을 필요로 합니다.
|
| 239 |
+
* Non-suffix 버전은 토큰을 더 적게 사용하지만 문장 분할 안정성이 약간 약해 긴 텍스트 번역에 문제가 발생할 수 있습니다.
|
| 240 |
+
* 'exp' suffix 버전은 더 많은 토큰을 사용하지만 안정성이 더 뛰어나고 프롬프트에 '탈옥'이 포함되어 있어 긴 텍스트 번역에 적합합니다.
|
| 241 |
+
|
| 242 |
+
다른 좋은 오프라인 영어 번역기를 추가하려면, 다음을 참조하시기 바랍니다 [스레드](https://github.com/dmMaze/BallonsTranslator/discussions/515).
|
| 243 |
+
새로운 번역기를 추가하려면 [how_to_add_new_translator](./how_to_add_new_translator.md)를 참조하시기 바랍니다. BaseClass의 하위 클래스로 두 개의 인터페이스를 구현하는 것처럼 간단합니다. 그런 다음 애플리케이션에서 이를 사용할 수 있으며, 프로젝트에 기여할 수 있습니다.
|
| 244 |
+
|
| 245 |
+
|
| 246 |
+
## FAQ 및 기타
|
| 247 |
+
* 만약 Nvidia GPU 또는 Apple silicon을 가지고 있다면, 프로그램은 하드웨어 가속을 가능하게합니다.
|
| 248 |
+
* 텍스트 선택의 미니 메뉴에서 [saladict](https://saladict.crimx.com)(*All-in-one 전문적인 팝업사전과 페이지 번역기*)에 대한 지원 추가. [설치 안내](./saladict.md)
|
| 249 |
+
* 대부분의 모듈이 [PyTorch](https://pytorch.org/get-started/locally/) 을 사용하므로 [NVIDIA's CUDA](https://pytorch.org/docs/stable/notes/cuda.html) 또는 [AMD's ROCm](https://pytorch.org/docs/stable/notes/hip.html) 장치가 있는 경우 성능을 가속화하세요.
|
| 250 |
+
* 폰트는 시스템에 설치된 폰트입니다.
|
| 251 |
+
* 러시아 현지화를 진행한 [브로핀](https://github.com/bropines) 에 감사드립니다.
|
| 252 |
+
* [bropines](https://github.com/bropines) 에 의해 Photoshop JSX 스크립트로 내보내기를 추가했습니다. </br> 지침을 읽고 코드를 개선한 후 어떻게 작동하는지 확인하려면 'scripts/export to photoshop' -> 'install_manual.md'로 이동하면 됩니다.
|
doc/README_PT-BR.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## BallonTranslator
|
| 2 |
+
|
| 3 |
+
[Chinês](/README.md) | [Inglês](/README_EN.md) | pt-BR | [Russo](../doc/README_RU.md) | [Japonês](../doc/README_JA.md) | [Indonésio](../doc/README_ID.md) | [Vietnamita](../doc/README_VI.md) | [한국어](../doc/README_KO.md) | [Español](../doc/README_ES.md) | [Français](../doc/README_FR.md)
|
| 4 |
+
|
| 5 |
+
BallonTranslator é mais uma ferramenta auxiliada por computador, alimentada por deep learning, para a tradução de quadrinhos/mangás.
|
| 6 |
+
|
| 7 |
+
<img src="../doc/src/ui0.jpg" div align=center>
|
| 8 |
+
|
| 9 |
+
<p align=center>
|
| 10 |
+
**Pré-Visualização**
|
| 11 |
+
</p>
|
| 12 |
+
|
| 13 |
+
## Recursos
|
| 14 |
+
* **Tradução totalmente automatizada:**
|
| 15 |
+
- Detecta, reconhece, remove e traduz textos automaticamente. O desempenho geral depende desses módulos.
|
| 16 |
+
- A diagramação é baseada na estimativa de formatação do texto original.
|
| 17 |
+
- Funciona bem com mangás e quadrinhos.
|
| 18 |
+
- Diagramação aprimorada para mangás->inglês, inglês->chinês (baseado na extração de regiões de balões).
|
| 19 |
+
|
| 20 |
+
* **Edição de imagem:**
|
| 21 |
+
- Permite editar máscaras e inpainting (similar à ferramenta Pincel de Recuperação para Manchas no Photoshop).
|
| 22 |
+
- Adaptado para imagens com proporção de aspecto extrema, como webtoons.
|
| 23 |
+
|
| 24 |
+
* **Edição de texto:**
|
| 25 |
+
- Suporta formatação de texto e [predefinições de estilo de texto](https://github.com/dmMaze/BallonsTranslator/pull/311). Textos traduzidos podem ser editados interativamente.
|
| 26 |
+
- Permite localizar e substituir.
|
| 27 |
+
- Permite exportar/importar para/de documentos do Word.
|
| 28 |
+
|
| 29 |
+
## Instalação
|
| 30 |
+
|
| 31 |
+
### No Windows
|
| 32 |
+
Se você não deseja instalar o Python e o Git manualmente e tem acesso à Internet:
|
| 33 |
+
Baixe o BallonsTranslator_dev_src_with_gitpython.7z do [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) ou [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing), descompacte e execute launch_win.bat.
|
| 34 |
+
Execute scripts/local_gitpull.bat para obter a atualização mais recente.
|
| 35 |
+
|
| 36 |
+
### Executando o código-fonte
|
| 37 |
+
Instale o [Python](https://www.python.org/downloads/release/python-31011) **<= 3.12** (não utilize a versão da Microsoft Store) e o [Git](https://git-scm.com/downloads).
|
| 38 |
+
|
| 39 |
+
```bash
|
| 40 |
+
# Clone este repositório
|
| 41 |
+
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
|
| 42 |
+
|
| 43 |
+
# Inicie o aplicativo
|
| 44 |
+
$ python3 launch.py
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
Na primeira execução, as bibliotecas necessárias serão instaladas e os modelos serão baixados automaticamente. Se os downloads falharem, você precisará baixar a pasta **data** (ou os arquivos ausentes mencionados no terminal) do [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) ou [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) e salvá-la no caminho correspondente na pasta do código-fonte.
|
| 48 |
+
|
| 49 |
+
## Construindo o aplicativo para macOS (compatível com chips Intel e Apple Silicon)
|
| 50 |
+
|
| 51 |
+
*Observação: o macOS também pode executar o código-fonte caso o aplicativo não funcione.*
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
|
| 55 |
+
#### 1. Preparação
|
| 56 |
+
- Baixe as bibliotecas e modelos do [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) ou [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing).
|
| 57 |
+
|
| 58 |
+
<img width="1268" alt="截屏2023-09-08 13 44 55_7g32SMgxIf" src="https://github.com/dmMaze/BallonsTranslator/assets/134026642/40fbb9b8-a788-4a6e-8e69-0248abaee21a">
|
| 59 |
+
|
| 60 |
+
- Coloque todos os recursos baixados em uma pasta chamada `data`. A estrutura final do diretório deve ser semelhante a esta:
|
| 61 |
+
|
| 62 |
+
```
|
| 63 |
+
data
|
| 64 |
+
├── libs
|
| 65 |
+
│ └── patchmatch_inpaint.dll
|
| 66 |
+
└── models
|
| 67 |
+
├── aot_inpainter.ckpt
|
| 68 |
+
├── comictextdetector.pt
|
| 69 |
+
├── comictextdetector.pt.onnx
|
| 70 |
+
├── lama_mpe.ckpt
|
| 71 |
+
├── manga-ocr-base
|
| 72 |
+
│ ├── README.md
|
| 73 |
+
│ ├── config.json
|
| 74 |
+
│ ├── preprocessor_config.json
|
| 75 |
+
│ ├── pytorch_model.bin
|
| 76 |
+
│ ├── special_tokens_map.json
|
| 77 |
+
│ ├── tokenizer_config.json
|
| 78 |
+
│ └── vocab.txt
|
| 79 |
+
├── mit32px_ocr.ckpt
|
| 80 |
+
├── mit48pxctc_ocr.ckpt
|
| 81 |
+
└── pkuseg
|
| 82 |
+
├── postag
|
| 83 |
+
│ ├── features.pkl
|
| 84 |
+
│ └── weights.npz
|
| 85 |
+
├── postag.zip
|
| 86 |
+
└── spacy_ontonotes
|
| 87 |
+
├── features.msgpack
|
| 88 |
+
└── weights.npz
|
| 89 |
+
|
| 90 |
+
7 diretórios, 23 arquivos
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
- Instale a ferramenta de linha de comando pyenv para gerenciar as versões do Python. Recomenda-se a instalação via Homebrew.
|
| 94 |
+
|
| 95 |
+
```
|
| 96 |
+
# Instalar via Homebrew
|
| 97 |
+
brew install pyenv
|
| 98 |
+
|
| 99 |
+
# Instalar via script oficial
|
| 100 |
+
curl https://pyenv.run | bash
|
| 101 |
+
|
| 102 |
+
# Configurar o ambiente shell após a instalação
|
| 103 |
+
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
| 104 |
+
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
| 105 |
+
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
#### 2. Construindo o aplicativo
|
| 109 |
+
```
|
| 110 |
+
# Entre no diretório de trabalho `data`
|
| 111 |
+
cd data
|
| 112 |
+
|
| 113 |
+
# Clone o branch `dev` do repositório
|
| 114 |
+
git clone -b dev https://github.com/dmMaze/BallonsTranslator.git
|
| 115 |
+
|
| 116 |
+
# Entre no diretório de trabalho `BallonsTranslator`
|
| 117 |
+
cd BallonsTranslator
|
| 118 |
+
|
| 119 |
+
# Execute o script de construção, que solicitará a senha na etapa pyinstaller, insira a senha e pressione enter
|
| 120 |
+
sh scripts/build-macos-app.sh
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
> 📌 O aplicativo empacotado está em ./data/BallonsTranslator/dist/BallonsTranslator.app. Arraste o aplicativo para a pasta de aplicativos do macOS para instalar. Pronto para usar sem configurações extras do Python.
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
</details>
|
| 127 |
+
|
| 128 |
+
Para usar o Sugoi translator (apenas japonês-inglês), baixe o [modelo offline](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm) e mova a pasta "sugoi_translator" para BallonsTranslator/ballontranslator/data/models.
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
# Utilização
|
| 132 |
+
|
| 133 |
+
**É recomendado executar o programa em um terminal caso ocorra alguma falha e não sejam fornecidas informações, como mostrado no gif a seguir.**
|
| 134 |
+
<img src="../doc/src/run.gif">
|
| 135 |
+
|
| 136 |
+
- Na primeira execução, selecione o tradutor e defina os idiomas de origem e destino clicando no ícone de configurações.
|
| 137 |
+
- Abra uma pasta contendo as imagens do quadrinho (mangá/manhua/manhwa) que precisa de tradução clicando no ícone de pasta.
|
| 138 |
+
- Clique no botão `Run` e aguarde a conclusão do processo.
|
| 139 |
+
|
| 140 |
+
Os formatos de fonte, como tamanho e cor, são determinados automaticamente pelo programa neste processo. Você pode pré-determinar esses formatos alterando as opções correspondentes de "decidir pelo programa" para "usar configuração global" no painel de configurações->Diagramação. (As configurações globais são os formatos exibidos no painel de formatação de fonte à direita quando você não está editando nenhum bloco de texto na cena.)
|
| 141 |
+
|
| 142 |
+
## Edição de Imagem
|
| 143 |
+
|
| 144 |
+
### Ferramenta de Inpainting
|
| 145 |
+
<img src="../doc/src/imgedit_inpaint.gif">
|
| 146 |
+
<p align = "center">
|
| 147 |
+
**Modo de edição de imagem, ferramenta de Inpainting**
|
| 148 |
+
</p>
|
| 149 |
+
|
| 150 |
+
### Ferramenta Retângulo
|
| 151 |
+
<img src="../doc/src/rect_tool.gif">
|
| 152 |
+
<p align = "center">
|
| 153 |
+
**Ferramenta Retângulo**
|
| 154 |
+
</p>
|
| 155 |
+
|
| 156 |
+
Para 'apagar' resultados indesejados de inpainting, use a ferramenta de inpainting ou a ferramenta retângulo com o **botão direito do mouse** pressionado. O resultado depende da precisão com que o algoritmo ("método 1" e "método 2" no gif) extrai a máscara de texto. O desempenho pode ser pior em textos e fundos complexos.
|
| 157 |
+
|
| 158 |
+
## Edição de Texto
|
| 159 |
+
<img src="../doc/src/textedit.gif">
|
| 160 |
+
<p align = "center">
|
| 161 |
+
**Modo de edição de texto**
|
| 162 |
+
</p>
|
| 163 |
+
|
| 164 |
+
<img src="../doc/src/multisel_autolayout.gif" div align=center>
|
| 165 |
+
<p align=center>
|
| 166 |
+
**Formatação de texto em lote e layout automático**
|
| 167 |
+
</p>
|
| 168 |
+
|
| 169 |
+
<img src="../doc/src/ocrselected.gif" div align=center>
|
| 170 |
+
<p align=center>
|
| 171 |
+
**OCR e tradução de área selecionada**
|
| 172 |
+
</p>
|
| 173 |
+
|
| 174 |
+
## Atalhos
|
| 175 |
+
* `A`/`D` ou `pageUp`/`Down` para virar a página
|
| 176 |
+
* `Ctrl+Z`, `Ctrl+Shift+Z` para desfazer/refazer a maioria das operações (a pilha de desfazer é limpa ao virar a página).
|
| 177 |
+
* `T` para o modo de edição de texto (ou o botão "T" na barra de ferramentas inferior).
|
| 178 |
+
* `W` para ativar o modo de criação de bloco de texto, arraste o mouse na tela com o botão direito pressionado para adicionar um novo bloco de texto (veja o gif de edição de texto).
|
| 179 |
+
* `P` para o modo de edição de imagem.
|
| 180 |
+
* No modo de edição de imagem, use o controle deslizante no canto inferior direito para controlar a transparência da imagem original.
|
| 181 |
+
* Desative ou ative qualquer módulo automático através da barra de título->executar. Executar com todos os módulos desativados irá refazer as letras e renderizar todo o texto de acordo com as configurações correspondentes.
|
| 182 |
+
* Defina os parâmetros dos módulos automáticos no painel de configuração.
|
| 183 |
+
* `Ctrl++`/`Ctrl+-` (Também `Ctrl+Shift+=`) para redimensionar a imagem.
|
| 184 |
+
* `Ctrl+G`/`Ctrl+F` para pesquisar globalmente/na página atual.
|
| 185 |
+
* `0-9` para ajustar a opacidade da camada de texto.
|
| 186 |
+
* Para edição de texto: negrito - `Ctrl+B`, sublinhado - `Ctrl+U`, itálico - `Ctrl+I`.
|
| 187 |
+
* Defina a sombra e a transparência do texto no painel de estilo de texto -> Efeito.
|
| 188 |
+
|
| 189 |
+
<img src="../doc/src/configpanel.png">
|
| 190 |
+
|
| 191 |
+
## Modo Headless (Executar sem interface gráfica)
|
| 192 |
+
|
| 193 |
+
```python
|
| 194 |
+
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
A configuração (idioma de origem, idioma de destino, modelo de inpainting, etc.) será carregada de config/config.json. Se o tamanho da fonte renderizada não estiver correto, especifique o DPI lógico manualmente através de `--ldpi`. Os valores típicos são 96 e 72.
|
| 198 |
+
|
| 199 |
+
## Módulos de Automação
|
| 200 |
+
Este projeto depende fortemente do [manga-image-translator](https://github.com/zyddnys/manga-image-translator). Serviços online e treinamento de modelos não são baratos, considere fazer uma doação ao projeto:
|
| 201 |
+
- Ko-fi: [https://ko-fi.com/voilelabs](https://ko-fi.com/voilelabs)
|
| 202 |
+
- Patreon: [https://www.patreon.com/voilelabs](https://www.patreon.com/voilelabs)
|
| 203 |
+
- 爱发电: [https://afdian.net/@voilelabs](https://afdian.net/@voilelabs)
|
| 204 |
+
|
| 205 |
+
O [Sugoi translator](https://sugoitranslator.com/) foi criado por [mingshiba](https://www.patreon.com/mingshiba).
|
| 206 |
+
|
| 207 |
+
## Detecção de Texto
|
| 208 |
+
* Suporta detecção de texto em inglês e japonês. O código de treinamento e mais detalhes podem ser encontrados em [comic-text-detector](https://github.com/dmMaze/comic-text-detector).
|
| 209 |
+
* Suporta o uso de detecção de texto do [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). O nome de usuário e a senha precisam ser preenchidos, e o login automático será realizado a cada vez que o programa for iniciado.
|
| 210 |
+
* Para instruções detalhadas, consulte [Manual do TuanziOCR](../doc/Manual_TuanziOCR_pt-BR.md).
|
| 211 |
+
|
| 212 |
+
## OCR
|
| 213 |
+
* Todos os modelos mit* são do manga-image-translator e suportam reconhecimento de inglês, japonês e coreano, além da extração da cor do texto.
|
| 214 |
+
* [manga_ocr](https://github.com/kha-white/manga-ocr) é de [kha-white](https://github.com/kha-white), reconhecimento de texto para japonês, com foco principal em mangás japoneses.
|
| 215 |
+
* Suporta o uso de OCR do [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). O nome de usuário e a senha precisam ser preenchidos, e o login automático será realizado a cada vez que o programa for iniciado.
|
| 216 |
+
* A implementação atual usa OCR em cada bloco de texto individualmente, resultando em velocidade mais lenta e sem melhoria significativa na precisão. Não é recomendado. Se necessário, use o Tuanzi Detector.
|
| 217 |
+
* Ao usar o Tuanzi Detector para detecção de texto, recomenda-se definir o OCR como none_ocr para ler o texto diretamente, economizando tempo e reduzindo o número de solicitações.
|
| 218 |
+
* Para instruções detalhadas, consulte [Manual do TuanziOCR](../doc/Manual_TuanziOCR_pt-BR.md).
|
| 219 |
+
|
| 220 |
+
## Inpainting
|
| 221 |
+
* O AOT é do [manga-image-translator](https://github.com/zyddnys/manga-image-translator).
|
| 222 |
+
* Todos os lama* são ajustados usando o [LaMa](https://github.com/advimman/lama).
|
| 223 |
+
* PatchMatch é um algoritmo do [PyPatchMatch](https://github.com/vacancy/PyPatchMatch). Este programa usa uma [versão modificada](https://github.com/dmMaze/PyPatchMatchInpaint) por mim.
|
| 224 |
+
|
| 225 |
+
## Tradutores
|
| 226 |
+
Tradutores disponíveis: Google, DeepL, ChatGPT, Sugoi, Caiyun, Baidu, Papago e Yandex.
|
| 227 |
+
* O Google desativou o serviço de tradução na China, defina a 'url' correspondente no painel de configuração para *.com.
|
| 228 |
+
* Os tradutores [Caiyun](https://dashboard.caiyunapp.com/), [ChatGPT](https://platform.openai.com/playground), [Yandex](https://yandex.com/dev/translate/), [Baidu](http://developers.baidu.com/) e [DeepL](https://www.deepl.com/docs-api/api-access) exigem um token ou chave de API.
|
| 229 |
+
* DeepL e Sugoi translator (e sua conversão CT2 Translation) graças a [Snowad14](https://github.com/Snowad14).
|
| 230 |
+
* Sugoi traduz do japonês para o inglês completamente offline.
|
| 231 |
+
* [Sakura-13B-Galgame](https://github.com/SakuraLLM/Sakura-13B-Galgame)
|
| 232 |
+
|
| 233 |
+
Para adicionar um novo tradutor, consulte [Como_add_um_novo_tradutor](../doc/Como_add_um_novo_tradutor.md). É simples como criar uma subclasse de uma classe base e implementar duas interfaces. Em seguida, você pode usá-lo no aplicativo. Contribuições para o projeto são bem-vindas.
|
| 234 |
+
|
| 235 |
+
## FAQ & Diversos
|
| 236 |
+
* Se o seu computador tiver uma GPU Nvidia ou Apple Silicon, o programa habilitará a aceleração de hardware.
|
| 237 |
+
* Adicione suporte para [saladict](https://saladict.crimx.com) (*Dicionário pop-up profissional e tradutor de páginas tudo-em-um*) no mini menu ao selecionar o texto. [Guia de instalação](../doc/saladict_pt-br.md).
|
| 238 |
+
* Acelere o desempenho se você tiver um dispositivo [NVIDIA CUDA](https://pytorch.org/docs/stable/notes/cuda.html) ou [AMD ROCm](https://pytorch.org/docs/stable/notes/hip.html), pois a maioria dos módulos usa o [PyTorch](https://pytorch.org/get-started/locally/).
|
| 239 |
+
* As fontes são do seu sistema.
|
| 240 |
+
* Agradecimentos a [bropines](https://github.com/bropines) pela localização para o russo.
|
| 241 |
+
* Adicionado script JSX de exportação para o Photoshop por [bropines](https://github.com/bropines). Para ler as instruções, melhorar o código e apenas explorar como funciona, vá para `scripts/export to photoshop` -> `install_manual.md`.
|
doc/README_RU.md
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
> [!IMPORTANT]
|
| 2 |
+
> **Если вы публично делитесь переведенным результатом, и опытный переводчик-человек не участвовал в тщательном переводе или проверке, пожалуйста, отметьте его как машинный перевод в заметном месте. Если на нормальном русском. Если вы не способны сделать минимальную проверку качества, перед публикацией, или вы не умеете в тайп, то укажите в описании к загражуемой манге, что это "машинный" перевод. Большинство русских сервисов тупо забанит вам аккаунт после попытки залива "машинного" перевода. Уделите хоть каплю внимания редактуре.**
|
| 3 |
+
|
| 4 |
+
# BallonTranslator
|
| 5 |
+
[简体中文](/README.md) | [English](/README_EN.md) | [pt-BR](../doc/README_PT-BR.md) | Русский | [日本語](../doc/README_JA.md) | [Indonesia](../doc/README_ID.md) | [Tiếng Việt](../doc/README_VI.md) | [한국어](../doc/README_KO.md) | [Español](../doc/README_ES.md) | [Français](../doc/README_FR.md)
|
| 6 |
+
|
| 7 |
+
Еще один инструмент для компьютерного перевода комиксов/манги на основе глубокого обучения.
|
| 8 |
+
|
| 9 |
+
<img src="src/ui0.jpg" div align=center>
|
| 10 |
+
|
| 11 |
+
<p align=center>
|
| 12 |
+
предпросмотр
|
| 13 |
+
</p>
|
| 14 |
+
|
| 15 |
+
# Особенности
|
| 16 |
+
* Полностью автоматизированный перевод
|
| 17 |
+
- Поддерживает автоматическое обнаружение текста, распознавание, удаление и перевод. Общая производительность зависит от этих модулей.
|
| 18 |
+
- Верстка основана на оценке форматирования оригинального текста.
|
| 19 |
+
- Хорошо работает с мангой и комиксами.
|
| 20 |
+
- Улучшенная верстка манга->английский, английский->китайский (на основе выделения областей баллонов).
|
| 21 |
+
|
| 22 |
+
* Редактирование изображений
|
| 23 |
+
- Поддерживает редактирование масок и ретушь (что-то вроде инструмента точечного восстановления в Photoshop)
|
| 24 |
+
- Адаптирован для изображений с экстремальным соотношением сторон, таких как веб-комиксы
|
| 25 |
+
|
| 26 |
+
* Редактирование текста
|
| 27 |
+
- Поддерживает богатое форматирование текста и [пресеты стилей текста](https://github.com/dmMaze/BallonsTranslator/pull/311), переведенные тексты можно редактировать интерактивно.
|
| 28 |
+
- Поддерживает поиск и замену
|
| 29 |
+
- Поддерживает экспорт/импорт в/из документов Word
|
| 30 |
+
|
| 31 |
+
# Установка
|
| 32 |
+
|
| 33 |
+
## На Windows
|
| 34 |
+
Если вы не хотите устанавливать Python и Git самостоятельно и у вас есть доступ к Интернету:
|
| 35 |
+
Скачайте BallonsTranslator_dev_src_with_gitpython.7z с [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) или [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing), распакуйте его и запустите launch_win.bat.
|
| 36 |
+
Запустите scripts/local_gitpull.bat, чтобы получить последнее обновление.
|
| 37 |
+
|
| 38 |
+
## Запуск исходного кода
|
| 39 |
+
|
| 40 |
+
Установите [Python](https://www.python.org/downloads/release/python-31011) **<= 3.12** (не используйте версию, установленную из Microsoft Store) и [Git](https://git-scm.com/downloads).
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
# Клонируйте этот репозиторий
|
| 44 |
+
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
|
| 45 |
+
|
| 46 |
+
# Запустите приложение
|
| 47 |
+
$ python3 launch.py
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
Обратите внимание, что при первом запуске будут автоматически установлены необходимые библиотеки и загружены модели. Если загрузки не удались, вам нужно будет скачать папку **data** (или отсутствующие файлы, упомянутые в терминале) с [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) или [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) и сохранить ее в соответствующем пути в папке с исходным кодом.
|
| 51 |
+
|
| 52 |
+
## Сборка приложения для macOS (совместимо как с процессорами Intel, так и с Apple Silicon)
|
| 53 |
+
<i>Обратите внимание, что macOS также может запускать исходный код, если это не работает.</i>
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
|
| 57 |
+
#### 1. Подготовка
|
| 58 |
+
- Загрузите библиотеки и модели с [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw "MEGA") или [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
<img width="1268" alt="скриншот 2023-09-08 13 44 55_7g32SMgxIf" src="https://github.com/dmMaze/BallonsTranslator/assets/134026642/40fbb9b8-a788-4a6e-8e69-0248abaee21a">
|
| 62 |
+
|
| 63 |
+
- Поместите все загруженные ресурсы в папку с названием data, конечная структура каталога должна выглядеть так:
|
| 64 |
+
|
| 65 |
+
```
|
| 66 |
+
data
|
| 67 |
+
├── libs
|
| 68 |
+
│ └── patchmatch_inpaint.dll
|
| 69 |
+
└── models
|
| 70 |
+
├── aot_inpainter.ckpt
|
| 71 |
+
├── comictextdetector.pt
|
| 72 |
+
├── comictextdetector.pt.onnx
|
| 73 |
+
├── lama_mpe.ckpt
|
| 74 |
+
├── manga-ocr-base
|
| 75 |
+
│ ├── README.md
|
| 76 |
+
│ ├── config.json
|
| 77 |
+
│ ├── preprocessor_config.json
|
| 78 |
+
│ ├── pytorch_model.bin
|
| 79 |
+
│ ├── special_tokens_map.json
|
| 80 |
+
│ ├── tokenizer_config.json
|
| 81 |
+
│ └── vocab.txt
|
| 82 |
+
├── mit32px_ocr.ckpt
|
| 83 |
+
├── mit48pxctc_ocr.ckpt
|
| 84 |
+
└── pkuseg
|
| 85 |
+
├── postag
|
| 86 |
+
│ ├── features.pkl
|
| 87 |
+
│ └── weights.npz
|
| 88 |
+
├── postag.zip
|
| 89 |
+
└── spacy_ontonotes
|
| 90 |
+
├── features.msgpack
|
| 91 |
+
└── weights.npz
|
| 92 |
+
|
| 93 |
+
7 директорий, 23 файла
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
- Установите инструмент командной строки pyenv для управления версиями Python. Рекомендуется установка через Homebrew.
|
| 97 |
+
```
|
| 98 |
+
# Установка через Homebrew
|
| 99 |
+
brew install pyenv
|
| 100 |
+
|
| 101 |
+
# Установка через официальный скрипт
|
| 102 |
+
curl https://pyenv.run | bash
|
| 103 |
+
|
| 104 |
+
# Настройка окружения оболочки после установки
|
| 105 |
+
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
| 106 |
+
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
| 107 |
+
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
#### 2. Сборка приложения
|
| 112 |
+
```
|
| 113 |
+
# Перейдите в рабочую директорию `data`
|
| 114 |
+
cd data
|
| 115 |
+
|
| 116 |
+
# Клонируйте ветку `dev` репозитория
|
| 117 |
+
git clone -b dev https://github.com/dmMaze/BallonsTranslator.git
|
| 118 |
+
|
| 119 |
+
# Перейдите в рабочую директорию `BallonsTranslator`
|
| 120 |
+
cd BallonsTranslator
|
| 121 |
+
|
| 122 |
+
# Запустите скрипт сборки, на этапе pyinstaller потребуется ввести пароль, введите пароль и нажмите enter
|
| 123 |
+
sh scripts/build-macos-app.sh
|
| 124 |
+
```
|
| 125 |
+
> 📌Упакованное приложение находится в ./data/BallonsTranslator/dist/BallonsTranslator.app, перетащите приложение в папку приложений macOS для установки. Готово к использованию без дополнительной настройки Python.
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
</details>
|
| 129 |
+
|
| 130 |
+
# Использование
|
| 131 |
+
|
| 132 |
+
**Рекомендуется запускать программу в терминале на случай, если она аварийно завершится и не оставит никакой информации, см. следующий gif.**
|
| 133 |
+
<img src="doc/src/run.gif">
|
| 134 |
+
- При первом запуске приложения, пожалуйста, выберите переводчик и установите исходный и целевой языки, нажав на значок настроек.
|
| 135 |
+
- Откройте папку, содержащую изображения комикса (манги/маньхуа/манхвы), которые нуждаются в переводе, нажав на значок папки.
|
| 136 |
+
- Нажмите кнопку `Run` и дождитесь завершения процесса.
|
| 137 |
+
|
| 138 |
+
Форматы шрифта, такие как размер и цвет, определяются программой автоматически в этом процессе. Вы можете предопределить эти форматы, изменив соответствующие опции с "decide by program" на "use global setting" в панели конфигурации->Typesetting. (глобальные настройки - это те форматы, которые отображаются на правой панели форматирования шрифта, когда вы не редактируете ни один текстовый блок на сцене)
|
| 139 |
+
|
| 140 |
+
## Редактирование изображений
|
| 141 |
+
|
| 142 |
+
### Инструмент ретуши
|
| 143 |
+
<img src="src/imgedit_inpaint.gif">
|
| 144 |
+
<p align = "center">
|
| 145 |
+
Режим редактирования изображения, инструмент ретуши
|
| 146 |
+
</p>
|
| 147 |
+
|
| 148 |
+
### Инструмент прямоугольника
|
| 149 |
+
<img src="src/rect_tool.gif">
|
| 150 |
+
<p align = "center">
|
| 151 |
+
Инструмент прямоугольника
|
| 152 |
+
</p>
|
| 153 |
+
|
| 154 |
+
Чтобы 'стереть' нежелательные результаты ретуши, используйте инструмент ретуши или инструмент прямоугольника с нажатой **правой кнопкой** мыши.
|
| 155 |
+
Результат зависит от того, насколько точно алгоритм ("метод 1" и "метод 2" на gif) извлекает маску текста. Он может работать хуже на сложном тексте и фоне.
|
| 156 |
+
|
| 157 |
+
## Редактирование текста
|
| 158 |
+
<img src="src/textedit.gif">
|
| 159 |
+
<p align = "center">
|
| 160 |
+
Режим редактирования текста
|
| 161 |
+
</p>
|
| 162 |
+
|
| 163 |
+
<img src="src/multisel_autolayout.gif" div align=center>
|
| 164 |
+
<p align=center>
|
| 165 |
+
Пакетное форматирование текста и автоматическая компоновка
|
| 166 |
+
</p>
|
| 167 |
+
|
| 168 |
+
<img src="src/ocrselected.gif" div align=center>
|
| 169 |
+
<p align=center>
|
| 170 |
+
OCR и перевод выбранной области
|
| 171 |
+
</p>
|
| 172 |
+
|
| 173 |
+
## Горячие клавиши
|
| 174 |
+
* ```A```/```D``` или ```pageUp```/```Down``` для перелистывания страниц
|
| 175 |
+
* ```Ctrl+Z```, ```Ctrl+Shift+Z``` для отмены/повтора большинства операций. (обратите внимание, что стек отмены будет очищен после перелистывания страницы)
|
| 176 |
+
* ```T``` для режима редактирования текста (или кнопка "T" на нижней панели инструментов).
|
| 177 |
+
* ```W``` для активации режима создания текстового блока, затем перетащите мышь по холсту с нажатой правой кнопкой, чтобы добавить новый текстовый блок. (см. gif редактирования текста)
|
| 178 |
+
* ```P``` для режима редактирования изображения.
|
| 179 |
+
* В режиме редактирования изображения используйте ползунок в правом нижнем углу для управления прозрачностью исходного изображения.
|
| 180 |
+
* Отключите или включите любые автоматические модули через строку заголовка->run, запуск со всеми отключенными модулями пересоздаст и перерисует весь текст в соответствии с соответствующими настройками.
|
| 181 |
+
* Установите параметры автоматических модулей на панели конфигурации.
|
| 182 |
+
* ```Ctrl++```/```Ctrl+-``` (Также ```Ctrl+Shift+=```) для изменения размера изображения.
|
| 183 |
+
* ```Ctrl+G```/```Ctrl+F``` для глобального поиска/поиска на текущей странице.
|
| 184 |
+
* ```0-9``` для настройки прозрачности текстового слоя
|
| 185 |
+
* Для редактирования текста: жирный - ```Ctrl+B```, подчеркнутый - ```Ctrl+U```, курсив - ```Ctrl+I```
|
| 186 |
+
* Установите тень текста и прозрачность на панели стиля текста -> Effect.
|
| 187 |
+
* ```Alt+Стрелки``` или ```Alt+WASD``` (```pageDown``` или ```pageUp``` в режиме редактирования текста) для переключения между текстовыми блоками.
|
| 188 |
+
|
| 189 |
+
<img src="src/configpanel.png">
|
| 190 |
+
|
| 191 |
+
## Режим без графического интерфейса (Запуск без GUI)
|
| 192 |
+
``` python
|
| 193 |
+
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
|
| 194 |
+
```
|
| 195 |
+
Обратите внимание, что конфигурация (исходный язык, целевой язык, модель ретуши и т.д.) будет загружена из config/config.json.
|
| 196 |
+
Если отрисованный размер шрифта неправильный, укажите логическое DPI вручную через ```--ldpi ```, типичные значения - 96 и 72.
|
| 197 |
+
|
| 198 |
+
|
| 199 |
+
# Модули автоматизации
|
| 200 |
+
Этот проект сильно зависит от [manga-image-translator](https://github.com/zyddnys/manga-image-translator), онлайн-сервис и обучение моделей недешевы, пожалуйста, рассмотрите возможность пожертвования проекту:
|
| 201 |
+
- Ko-fi: <https://ko-fi.com/voilelabs>
|
| 202 |
+
- Patreon: <https://www.patreon.com/voilelabs>
|
| 203 |
+
- 爱发电: <https://afdian.net/@voilelabs>
|
| 204 |
+
|
| 205 |
+
[Sugoi translator](https://sugoitranslator.com/) создан [mingshiba](https://www.patreon.com/mingshiba).
|
| 206 |
+
|
| 207 |
+
## Обнаружение текста
|
| 208 |
+
* Поддерживает обнаружение английского и японского текста, код обучения и подробности можно найти в [comic-text-detector](https://github.com/dmMaze/comic-text-detector)
|
| 209 |
+
* Поддерживает использование обнаружения текста из [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). Необходимо заполнить имя пользователя и пароль, автоматический вход будет выполняться при каждом запуске программы.
|
| 210 |
+
|
| 211 |
+
* Для подробных инструкций см. **Инструкции по использованию Tuanzi OCR**: (только на [китайском](doc/团子OCR说明.md) и [бразильском португальском](doc/Manual_TuanziOCR_pt-BR.md))
|
| 212 |
+
|
| 213 |
+
## OCR
|
| 214 |
+
* Все модели mit* взяты из manga-image-translator, поддерживают распознавание английского, японского и корейского языков и извлечение цвета текста.
|
| 215 |
+
* [manga_ocr](https://github.com/kha-white/manga-ocr) от [kha-white](https://github.com/kha-white), распознавание текста для японского языка, с основным фокусом на японской манге.
|
| 216 |
+
* Поддерживает использование OCR из [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). Необходимо заполнить имя пользователя и пароль, автоматический вход будет выполняться при каждом запуске программы.
|
| 217 |
+
* Текущая реализация использует OCR для каждого текстового блока отдельно, что приводит к более медленной скорости и не дает значительного улучшения точности. Это не рекомендуется. При необходимости используйте вместо этого Tuanzi Detector.
|
| 218 |
+
* При использовании Tuanzi Detector для обнаружения текста рекомендуется установить OCR в none_ocr для прямого чтения текста, экономя время и уменьшая количество запросов.
|
| 219 |
+
* Для подробных инструкций см. **Инструкции по использованию Tuanzi OCR**: (только на [китайском](doc/团子OCR说明.md) и [бразильском португальском](doc/Manual_TuanziOCR_pt-BR.md))
|
| 220 |
+
|
| 221 |
+
## Ретушь
|
| 222 |
+
* AOT взят из [manga-image-translator](https://github.com/zyddnys/manga-image-translator).
|
| 223 |
+
* Все lama* дообучены с использованием [LaMa](https://github.com/advimman/lama)
|
| 224 |
+
* PatchMatch - это алгоритм из [PyPatchMatch](https://github.com/vacancy/PyPatchMatch), эта программа использует [модифицированную версию](https://github.com/dmMaze/PyPatchMatchInpaint) от меня.
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
## Переводчики
|
| 228 |
+
Доступные переводчики: Google, DeepL, ChatGPT, Sugoi, Caiyun, Baidu. Papago и Yandex.
|
| 229 |
+
* Google закрыл сервис перевода в Китае, пожалуйста, установите соответствующий 'url' в панели конфигурации на *.com.
|
| 230 |
+
* [Caiyun](https://dashboard.caiyunapp.com/), [ChatGPT](https://platform.openai.com/playground), [Yandex](https://yandex.com/dev/translate/), [Baidu](http://developers.baidu.com/) и [DeepL](https://www.deepl.com/docs-api/api-access) переводчики требуют токен или API-ключ.
|
| 231 |
+
* DeepL & Sugoi переводчик (и его преобразование CT2 Translation) благодаря [Snowad14](https://github.com/Snowad14).
|
| 232 |
+
* Sugoi переводит с японского на английский полностью оффлайн. Скачайте [оффлайн модель](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm), переместите "sugoi_translator" в BallonsTranslator/ballontranslator/data/models.
|
| 233 |
+
* [Sakura-13B-Galgame](https://github.com/SakuraLLM/Sakura-13B-Galgame), отметьте ```low vram mode``` в панели конфигурации, если вы запускаете его локально на одном устройстве и столкнулись с сбоем из-за нехватки vram (включено по умолчанию).
|
| 234 |
+
* DeepLX: По��алуйста, обратитесь к [Vercel](https://github.com/bropines/Deeplx-vercel) или [deeplx](https://github.com/OwO-Network/DeepLX)
|
| 235 |
+
* Добавлена библиотека [Translators](https://github.com/UlionTse/translators) которая поддерживает доступ к некоторым сервисам переводчиков без api ключей. О поддерживаемых сервисах можете узнать [тут](https://github.com/UlionTse/translators#supported-translation-services).
|
| 236 |
+
|
| 237 |
+
Для других хороших оффлайн английских переводчиков, пожалуйста, обратитесь к этой [ветке обсуждения](https://github.com/dmMaze/BallonsTranslator/discussions/515).
|
| 238 |
+
Чтобы добавить новый переводчик, пожалуйста, обратитесь к [how_to_add_new_translator](doc/how_to_add_new_translator.md), это просто как создание подкласса BaseClass и реализация двух интерфейсов, затем вы можете использовать его в приложении, вы можете внести свой вклад в проект.
|
| 239 |
+
|
| 240 |
+
|
| 241 |
+
## FAQ и прочее
|
| 242 |
+
* Если ваш компьютер имеет GPU NVIDIA или Apple Silicon, программа включит аппаратное ускорение.
|
| 243 |
+
* Добавлена поддержка [saladict](https://saladict.crimx.com) (*Универсальный профессиональный всплывающий словарь и переводчик страниц*) в мини-меню при выделении текста. [Руководство по установке](doc/saladict.md)
|
| 244 |
+
* Ускорение производительности, если у вас есть устройство [NVIDIA's CUDA](https://pytorch.org/docs/stable/notes/cuda.html) или [AMD's ROCm](https://pytorch.org/docs/stable/notes/hip.html), так как большинство модулей использует [PyTorch](https://pytorch.org/get-started/locally/).
|
| 245 |
+
* Шрифты берутся из системных шрифтов вашей системы.
|
| 246 |
+
* Благодарность [bropines](https://github.com/bropines) за русскую локализацию.
|
| 247 |
+
* Добавлен экспорт в скрипт JSX для Photoshop от [bropines](https://github.com/bropines). </br> Чтобы прочитать инструкции, улучшить код и просто покопаться, чтобы увидеть, как это работает, вы можете перейти в `scripts/export to photoshop` -> `install_manual.md`.
|
doc/README_VI.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BallonTranslator
|
| 2 |
+
[简体中文](/README.md) | [English](/README_EN.md) | [pt-BR](../doc/README_PT-BR.md) | [Русский](../doc/README_RU.md) | [日本語](../doc/README_JA.md) | [Indonesia](../doc/README_ID.md) | Tiếng Việt | [한국어](../doc/README_KO.md) | [Español](../doc/README_ES.md) | [Français](../doc/README_FR.md)
|
| 3 |
+
|
| 4 |
+
Lại thêm một công cụ, phần mềm dịch truyện siu xịn khác có áp dụng ML/AI.
|
| 5 |
+
|
| 6 |
+
<img src="./src/ui0.jpg" div align=center>
|
| 7 |
+
|
| 8 |
+
<p align=center>
|
| 9 |
+
preview
|
| 10 |
+
</p>
|
| 11 |
+
|
| 12 |
+
# Đặc trưng
|
| 13 |
+
* Dịch hoàn toàn tự động
|
| 14 |
+
- Hỗ trợ phát hiện văn bản tự động, nhận dạng, loại bỏ và dịch thuật. Các tính năng xoay quanh hầu hết phụ thuộc vào các đặc tính này.
|
| 15 |
+
- Font, kích thức chữ được ước tính dựa trên định dạng của văn bản gốc.
|
| 16 |
+
- Hoạt động tốt với manga và comics.
|
| 17 |
+
- Dùng siu xịn khi mà Manga -> Tiếng Anh, Tiếng Anh -> tiếng Trung (Zì app này các pháp sư Trung Hoa làm mà :> ).
|
| 18 |
+
|
| 19 |
+
* Chỉnh sửa hình ảnh
|
| 20 |
+
- Hỗ trợ Chỉnh sửa & Inpainting (na ná brush tool trong Photoshop)
|
| 21 |
+
- Thích nghi với hình ảnh có tỷ lệ khung hình cực cao như Webtoons (?? hem hỉu lém, nhưng mà nói chung sài được với cả webtoons)
|
| 22 |
+
|
| 23 |
+
* Chỉnh sửa văn bản
|
| 24 |
+
- Hỗ trợ RTF (rich text formatting) zà [TSP (text style presets)](https://github.com/dmMaze/BallonsTranslator/pull/311), có thể chỉnh sửa lại các văn bản đã được dịch đó lun nè.
|
| 25 |
+
- Hỗ trợ Tìm kiếm & Thay thế
|
| 26 |
+
- Hỗ trợ cả import từ dạng word hoặc export ra dạng đó nữa
|
| 27 |
+
|
| 28 |
+
# Cài đặt
|
| 29 |
+
|
| 30 |
+
## Trên Windows
|
| 31 |
+
|
| 32 |
+
Nếu bạn lười cài Python và Git nhưng vẫn có thể truy cập vào Internet, thì có thể tải BallonsTranslator_dev_src_with_gitpython.7z từ [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) hoặc nà [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing), unzip nó rùi chạy ```launch_win.bat```.
|
| 33 |
+
Chạy file ```scripts/local_gitpull.bat``` để cập nhật bản mới nhất nhoa.
|
| 34 |
+
|
| 35 |
+
## Chạy mã nguồn (từ github)
|
| 36 |
+
|
| 37 |
+
*Phù hợp cho mấy bạn sài linux như tui hehe.*
|
| 38 |
+
|
| 39 |
+
Cài [Python](https://www.python.org/downloads/release/python-31011) **<= 3.12** (Đừng cóa mà sài cái bản có sẵn trên Microsoft Store) và [Git](https://git-scm.com/downloads).
|
| 40 |
+
|
| 41 |
+
```bash
|
| 42 |
+
# Clone this repo
|
| 43 |
+
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
|
| 44 |
+
|
| 45 |
+
# Launch the app
|
| 46 |
+
$ python3 launch.py
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
**Lưu ý:** Lần đầu tiên khởi chạy, app sẽ tự động cài đặt các thư viện và tải xuống các models. Nếu tải xuống không thành công, bạn sẽ cần tải xuống thư mục **data** (hoặc các tệp bị thiếu được báo lỗi trong terminal) từ [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) hoặc [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) rùi lưu nó ở đường dẫn tương ứng trong thư mục mã nguồn.
|
| 50 |
+
|
| 51 |
+
## Chạy ứng dụng trên MacOS (tương thích với cả chip Intel và Apple Silicon)
|
| 52 |
+
<i>Lưu ý MacOS cũng có thể chạy cách bên trên nếu cách này không hoạt động.</i>
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
|
| 56 |
+
#### 1. Chuẩn bị
|
| 57 |
+
- Tải libs và models từ [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw "MEGA") hoặc [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
<img width="1268" alt="截屏2023-09-08 13 44 55_7g32SMgxIf" src="https://github.com/dmMaze/BallonsTranslator/assets/134026642/40fbb9b8-a788-4a6e-8e69-0248abaee21a">
|
| 61 |
+
|
| 62 |
+
- Chuyển tất cả các tài nguyên đã tải xuống vào thư mục ```data``` (chưa có thì tự tạo nhá), cấu trúc cây thư mục cuối cùng sẽ trông như nè:
|
| 63 |
+
|
| 64 |
+
```
|
| 65 |
+
data
|
| 66 |
+
├── libs
|
| 67 |
+
│ └── patchmatch_inpaint.dll
|
| 68 |
+
└── models
|
| 69 |
+
├── aot_inpainter.ckpt
|
| 70 |
+
├── comictextdetector.pt
|
| 71 |
+
├── comictextdetector.pt.onnx
|
| 72 |
+
├── lama_mpe.ckpt
|
| 73 |
+
├── manga-ocr-base
|
| 74 |
+
│ ├── README.md
|
| 75 |
+
│ ├── config.json
|
| 76 |
+
│ ├── preprocessor_config.json
|
| 77 |
+
│ ├── pytorch_model.bin
|
| 78 |
+
│ ├── special_tokens_map.json
|
| 79 |
+
│ ├── tokenizer_config.json
|
| 80 |
+
│ └── vocab.txt
|
| 81 |
+
├── mit32px_ocr.ckpt
|
| 82 |
+
├── mit48pxctc_ocr.ckpt
|
| 83 |
+
└── pkuseg
|
| 84 |
+
├── postag
|
| 85 |
+
│ ├── features.pkl
|
| 86 |
+
│ └── weights.npz
|
| 87 |
+
├── postag.zip
|
| 88 |
+
└── spacy_ontonotes
|
| 89 |
+
├── features.msgpack
|
| 90 |
+
└── weights.npz
|
| 91 |
+
|
| 92 |
+
7 directories, 23 files
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
- Cài đặt pyenv command line tool để quản lý các phiên bản Python. Nên cài qua Homebrew.
|
| 96 |
+
```
|
| 97 |
+
# Install via Homebrew
|
| 98 |
+
brew install pyenv
|
| 99 |
+
|
| 100 |
+
# Install via official script
|
| 101 |
+
curl https://pyenv.run | bash
|
| 102 |
+
|
| 103 |
+
# Set shell environment after install
|
| 104 |
+
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
| 105 |
+
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
| 106 |
+
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
#### 2. Chạy ứng dụng
|
| 111 |
+
```
|
| 112 |
+
# Enter the `data` working directory
|
| 113 |
+
cd data
|
| 114 |
+
|
| 115 |
+
# Clone the `dev` branch of the repo
|
| 116 |
+
git clone -b dev https://github.com/dmMaze/BallonsTranslator.git
|
| 117 |
+
|
| 118 |
+
# Enter the `BallonsTranslator` working directory
|
| 119 |
+
cd BallonsTranslator
|
| 120 |
+
|
| 121 |
+
# Run the build script, will ask for password at pyinstaller step, enter password and press enter
|
| 122 |
+
sh scripts/build-macos-app.sh
|
| 123 |
+
```
|
| 124 |
+
> 📌 Ứng dụng được build ra file chạy ở đường dẫn ```./data/BallonsTranslator/dist/BallonsTranslator.app```, kéo cái ```BallonsTranslator.app``` vô thư mục macOS application để cài đặt. Sẵn sàng sử dụng lun mà không cần cấu hình thêm cho Python.
|
| 125 |
+
|
| 126 |
+
</details>
|
| 127 |
+
|
| 128 |
+
Để sài Sugoi translator(Japanese-English only), tải [offline model](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm), chuyển "sugoi_translator" vào ```BallonsTranslator/ballontranslator/data/models```.
|
| 129 |
+
|
| 130 |
+
# Cách sử dụng
|
| 131 |
+
|
| 132 |
+
**Bạn nên chạy chương trình trong terminal trong trường hợp nó bị crashed và không để lại log, hãy xem gif sau.**
|
| 133 |
+
<img src="./src/run.gif">
|
| 134 |
+
|
| 135 |
+
- Lần đầu tiên chạy ứng dụng, hãy chọn Chương trình dịch, cài Ngôn ngữ gốc và Ngôn ngữ dịch bằng cách nhấp vào biểu tượng Cài đặt.
|
| 136 |
+
- Mở một thư mục chứa hình ảnh của truyện cần dịch (Manga/Manhua/Manhwa) bằng cách nhấp vào biểu tượng Thư mục.
|
| 137 |
+
- Nhấp vào nút `Run` và chờ quá trình hoàn thành.
|
| 138 |
+
|
| 139 |
+
Các định dạng phông chữ như kích thước và màu phông chữ được xác định tự động bởi chương trình, bạn có thể xác định trước các định dạng đó bằng cách thay đổi tùy chọn tương ứng từ "decide by program" sang "use global setting" trong Bảng cấu hình (Config Panel) -> Lettering. (Global setting, cấu hình toàn bộ, là những định dạng được hiển thị ở bảng định dạng phía bên phải màn hình, khi bạn đang không chỉnh sửa bất kỳ văn bản nào trong textblock).
|
| 140 |
+
|
| 141 |
+
## Chỉnh sửa hình ảnh
|
| 142 |
+
|
| 143 |
+
### Inpaint Tool
|
| 144 |
+
<img src="./src/imgedit_inpaint.gif">
|
| 145 |
+
<p align = "center">
|
| 146 |
+
Chế độ Chỉnh sửa hình ảnh, Inpainting Tool
|
| 147 |
+
</p>
|
| 148 |
+
|
| 149 |
+
### rect tool
|
| 150 |
+
<img src="./src/rect_tool.gif">
|
| 151 |
+
<p align = "center">
|
| 152 |
+
Chế độ Chỉnh sửa hình ảnh, Rect Tool
|
| 153 |
+
</p>
|
| 154 |
+
|
| 155 |
+
Để 'Xóa' những phần đã được inpainted không mong muốn, sử dụng Inpainting tool hoặc Rect tool trong khi đang bấm **chuổt phải**.
|
| 156 |
+
Kết quả sẽ phụ thuộc vào độ chính xác của thuật toán trích xuất ra text mask (lớp mask chữ) (theo "Phương pháp 1" và "Phương pháp 2" trong GIF). Nếu văn bản & nền phức tạp thì kết quả tách có thể chưa tốt lắm.
|
| 157 |
+
|
| 158 |
+
## Chỉnh sửa văn bản
|
| 159 |
+
<img src="./src/textedit.gif">
|
| 160 |
+
<p align = "center">
|
| 161 |
+
Chế độ Chỉnh sửa văn bản
|
| 162 |
+
</p>
|
| 163 |
+
|
| 164 |
+
<img src="./src/multisel_autolayout.gif" div align=center>
|
| 165 |
+
<p align=center>
|
| 166 |
+
Định dạng văn bản hàng loạt & Bố cục tự động
|
| 167 |
+
</p>
|
| 168 |
+
|
| 169 |
+
<img src="./src/ocrselected.gif" div align=center>
|
| 170 |
+
<p align=center>
|
| 171 |
+
OCR & Chỉ dịch văn bản đã chọn
|
| 172 |
+
</p>
|
| 173 |
+
|
| 174 |
+
## Shortcuts
|
| 175 |
+
* ```A```/```D``` hoặc ```pageUp```/```pageDown``` : Chuyển trang
|
| 176 |
+
* ```Ctrl+Z```, ```Ctrl+Shift+Z``` : Undo/redo hầu hết các hoạt động. (Lưu ý rằng list hoạt động có thể undo sẽ bị xóa sau khi bạn chuyển trang)
|
| 177 |
+
* ```T``` : Để chuyển sang chế độ chỉnh sửa văn bản (hoặc phím "T" ở thanh công cụ bên dưới).
|
| 178 |
+
* ```W``` : Để kích hoạt chế độ tạo khung văn bản, sau đó bấm chuột phải để thêm khung chữ mới trên canvas. (Xem GIF chỉnh sửa văn bản)
|
| 179 |
+
* ```P``` : Để sang chế độ chỉnh sửa hình ảnh.
|
| 180 |
+
* Trong Chế độ Chỉnh sửa hình ảnh, sử dụng thanh trượt ở phía dưới bên phải để chỉnh sửa độ trong suốt của hình ảnh gốc.
|
| 181 |
+
* Tắt hoặc bật bất kỳ modules tự động nào qua titlebar->run, chạy chương trình khi mà tất cả modules bị vô hiệu sẽ làm lại việc soạn và render tất cả văn bản tùy theo cài đặt tương ứng.
|
| 182 |
+
* Đặt tham số cho các module tự động trong Bảng cấu hình.
|
| 183 |
+
* ```Ctrl++```/```Ctrl+-``` (hoặc ```Ctrl+Shift+=```) Để thay đổi kích thước hình ảnh.
|
| 184 |
+
* ```Ctrl+G```/```Ctrl+F``` Để tìm kiếm trên tất cả hoặc trong trang hiện tại.
|
| 185 |
+
* ```0-9``` Để điều chỉnh độ trong suốt của lớp chữ
|
| 186 |
+
* Trong chỉnh sửa văn bản: **bold** - ```Ctrl+B```, <u>underline</u> - ```Ctrl+U```, *italics* - ```Ctrl+I```
|
| 187 |
+
* Cài đặt đổ bóng và độ trong suốt chữ ở text style panel -> Effect.
|
| 188 |
+
|
| 189 |
+
<img src="./src/configpanel.png">
|
| 190 |
+
|
| 191 |
+
## Headless mode (Run without GUI)
|
| 192 |
+
``` python
|
| 193 |
+
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
|
| 194 |
+
```
|
| 195 |
+
**Lưu ý:** Cấu hình (ngôn ngữ nguồn, ngôn ngữ đích, mô hình InPaint, v.v.) sẽ tải từ config/config.json.
|
| 196 |
+
Nếu kích thước phông chữ được render không đúng, hãy chỉ định DPI thủ công theo cách sau: ```--ldpi```, các giá trị thường dùng là 96 và 72.
|
| 197 |
+
|
| 198 |
+
|
| 199 |
+
# Các modules tự động
|
| 200 |
+
Dự án này phụ thuộc rất nhiều vào [manga-image-translator](https://github.com/zyddnys/manga-image-translator), Các dịch vụ trực tuyến và model training không rẻ, nếu được thì donate các dự án nè nha (Xin cám mơn :3):
|
| 201 |
+
- Ko-fi: <https://ko-fi.com/voilelabs>
|
| 202 |
+
- Patreon: <https://www.patreon.com/voilelabs>
|
| 203 |
+
- 爱发电: <https://afdian.net/@voilelabs>
|
| 204 |
+
|
| 205 |
+
[Sugoi translator](https://sugoitranslator.com/) is created by [mingshiba](https://www.patreon.com/mingshiba).
|
| 206 |
+
|
| 207 |
+
## Xác định văn bản
|
| 208 |
+
* Hỗ trợ phát hiện văn bản tiếng Anh và tiếng Nhật [comic-text-detector](https://github.com/dmMaze/comic-text-detector)
|
| 209 |
+
* Hỗ trợ Sử dụng phát hiện văn bản [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). Cần điền username và password, việc đăng nhập tự động sẽ được thực hiện mỗi khi chương trình được khởi chạy.
|
| 210 |
+
* Hướng dẫn chi tiết, [Tuanzi OCR Instructions (Chinese only)](doc/Tuanzi_OCR_Instructions.md)
|
| 211 |
+
|
| 212 |
+
## OCR
|
| 213 |
+
* Tất cả các mô hình MIT* đều từ manga-image-translator, hỗ trợ nhận dạng tiếng Anh, Nhật Bản và Hàn Quốc và trích xuất màu văn bản.
|
| 214 |
+
* [manga_ocr](https://github.com/kha-white/manga-ocr) từ [kha-white](https://github.com/kha-white), Nhận dạng văn bản cho tiêng Nhật, tập trung vào manga.
|
| 215 |
+
* Support áp dụng OCR [Starriver Cloud (Tuanzi Manga OCR)](https://cloud.stariver.org.cn/). Cần điền username và password, việc đăng nhập tự động sẽ được thực hiện mỗi khi chương trình được khởi chạy.
|
| 216 |
+
* Phiên bản hiện tại sử dụng OCR trên mỗi textblock riêng, dẫn đến tốc độ chậm hơn và độ chính xác không được cải thiện tốt. Điều này khum được khuyến khích (thì khum tối ưu mà :<). Nếu cần, hãy sử dụng Tuanzi Detector thay thế.
|
| 217 |
+
* Khi sài Tuanzi Detector cho việc xác định văn bản, nên đặt OCR thành none_ocr để có thể đọc trực tiếp văn bản, tiết kiệm thời gian và giảm số lượng yêu cầu.
|
| 218 |
+
* Cụ thể đọc thêm tại đây [Tuanzi OCR Instructions (Chinese only)](doc/Tuanzi_OCR_Instructions.md)
|
| 219 |
+
|
| 220 |
+
## Inpainting
|
| 221 |
+
* AOT [manga-image-translator](https://github.com/zyddnys/manga-image-translator).
|
| 222 |
+
* Tất cả lama* đều là finetuned [LaMa](https://github.com/advimman/lama)
|
| 223 |
+
* PatchMatch là một thuật toán từ [PyPatchMatch](https://github.com/vacancy/PyPatchMatch), Phần mềm này sử dụng [phiên bản đã được tu luyện (modified version)](https://github.com/dmMaze/PyPatchMatchInpaint) bởi *me*.
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
## Dịch thụât
|
| 227 |
+
Trình dịch có sẵn: Google, DeepL, ChatGPT, Sugoi, Caiyun, Baidu. Papago, and Yandex.
|
| 228 |
+
* Google không cung cấp dịch vụ dịch tại Trung Quốc, vui lòng đặt 'URL' tương ứng trong bảng điều khiển thành *.com.
|
| 229 |
+
* [Caiyun](https://dashboard.caiyunapp.com/), [ChatGPT](https://platform.openai.com/playground), [Yandex](https://yandex.com/dev/translate/), [Baidu](http://developers.baidu.com/), èn [DeepL](https://www.deepl.com/docs-api/api-access). Các trình dịch cần có token hoặc api key.
|
| 230 |
+
* DeepL & Sugoi translator (and it's CT2 Translation conversion) thanks to [Snowad14](https://github.com/Snowad14).
|
| 231 |
+
* Sugoi có thể dịch từ Japanese sang English kể cả khi ngoại tuyến (hong có kết nối mạng).
|
| 232 |
+
* [Sakura-13B-Galgame](https://github.com/SakuraLLM/Sakura-13B-Galgame)
|
| 233 |
+
|
| 234 |
+
Để thêm một trình dịch mới, xem chi tiết hơn ở đây [how_to_add_new_translator](doc/how_to_add_new_translator.md), hiểu đơn giản thì nó như phân lớp của BaseClass và triển khai hai giao diện, sau đó bạn có thể sử dụng trong ứng dụng, rấc welcome đóng góp cho dự án nhe.
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
## FAQ & Misc
|
| 238 |
+
* Nếu máy tính của bạn có GPU NVIDIA hoặc Apple Silicon, chương trình sẽ có thể kích hoạt việc tăng tốc phần cứng.
|
| 239 |
+
* Thêm hỗ trợ cho [saladict](https://saladict.crimx.com) (*All-in-one professional pop-up dictionary and page translator*) trong mini menu về lựa chọn text. [Installation guide](doc/saladict.md)
|
| 240 |
+
* Tăng tốc hiệu suất nếu bạn có [NVIDIA's CUDA](https://pytorch.org/docs/stable/notes/cuda.html) hoặc [AMD's ROCm](https://pytorch.org/docs/stable/notes/hip.html) thiết bị, hầu hết các module sử dụng [PyTorch](https://pytorch.org/get-started/locally/).
|
| 241 |
+
* Fonts được lấy từ fonts có trong máy.
|
| 242 |
+
* Gửi lời cảm ơn tới [bropines](https://github.com/bropines) cho việc Nga hóa.
|
| 243 |
+
* Thêm Export to photoshop JSX bởi [bropines](https://github.com/bropines).
|
| 244 |
+
Để đọc các hướng dẫn, cải thiện code hoặc nà tò mò vọc quanh quanh để xem cách hoạt động, zô `scripts/export to photoshop` -> `install_manual.md`.
|
doc/add_translator_ru.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/加别的翻译器.md) | [English](../doc/how_to_add_new_translator.md) | [pt-BR](../doc/Como_add_um_novo_tradutor.md) | Русский
|
| 2 |
+
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
Если у вас есть базовые знания программирования на python, вы будете знать, как использовать python для вызова необходимого api переводчика или модели перевода, Напишите класс в dl/translators.__init__.py следующим образом, чтобы использовать его непосредственно в программе.
|
| 6 |
+
Следующий пример DummyTranslator закомментирован в dl/translator/__init__.py, и его можно не комментировать, чтобы увидеть результат в программе.
|
| 7 |
+
|
| 8 |
+
``` python
|
| 9 |
+
@register_translator('dummy translator')
|
| 10 |
+
class DummyTranslator(BaseTranslator):
|
| 11 |
+
concate_text = True
|
| 12 |
+
|
| 13 |
+
# parameters showed in the config panel.
|
| 14 |
+
# keys are parameter names, if value type is str, it will be a text editor(required key)
|
| 15 |
+
# if value type is dict, you need to spicify the 'type' of the parameter,
|
| 16 |
+
# following 'device' is a selector, options a cpu and cuda, default is cpu
|
| 17 |
+
params: Dict = {
|
| 18 |
+
'required_key': '',
|
| 19 |
+
'device': {
|
| 20 |
+
'type': 'selector',
|
| 21 |
+
'options': ['cpu', 'cuda'],
|
| 22 |
+
'value': 'cpu'
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
def _setup_translator(self):
|
| 27 |
+
'''
|
| 28 |
+
do the setup here.
|
| 29 |
+
keys of lang_map are those languages options showed in the app,
|
| 30 |
+
assign corresponding language keys accepted by API to supported languages.
|
| 31 |
+
This translator only supports Chinese, Japanese, and English.
|
| 32 |
+
'''
|
| 33 |
+
self.lang_map['简体中文'] = 'zh'
|
| 34 |
+
self.lang_map['日本語'] = 'ja'
|
| 35 |
+
self.lang_map['English'] = 'en'
|
| 36 |
+
|
| 37 |
+
def _translate(self, src_list: List[str]) -> List[str]:
|
| 38 |
+
'''
|
| 39 |
+
do the translation here.
|
| 40 |
+
This translator do nothing but return the original text.
|
| 41 |
+
'''
|
| 42 |
+
source = self.lang_map[self.lang_source]
|
| 43 |
+
target = self.lang_map[self.lang_target]
|
| 44 |
+
return 'translate ' + text + f'from {source} to target'
|
| 45 |
+
|
| 46 |
+
def updateParam(self, param_key: str, param_content):
|
| 47 |
+
'''
|
| 48 |
+
required only if some state need to be updated immediately after user change the translator params,
|
| 49 |
+
for example, if this translator is a pytorch model, you can convert it to cpu/gpu here.
|
| 50 |
+
'''
|
| 51 |
+
super().updateParam(param_key, param_content)
|
| 52 |
+
if param_key == 'device':
|
| 53 |
+
# self.model.to(self.params['device']['value'])
|
| 54 |
+
pass
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
Во-первых, переводчик должен быть декорирован с помощью register_translator и наследоваться от базового класса BaseTranslator, параметр 'dummy translator' внутри декоратора - это имя переводчика, которое будет отображаться в интерфейсе, будьте осторожны, чтобы не дублировать имя существующего переводчика.
|
| 58 |
+
Сохраните concate_text на потом.
|
| 59 |
+
``` python
|
| 60 |
+
@register_translator('dummy translator')
|
| 61 |
+
class DummyTranslator(BaseTranslator):
|
| 62 |
+
concate_text = True
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
Если новый переводчик требует настраиваемых пользователем параметров, создайте словарь params, как показано ниже, в противном случае оставьте его в покое или присвойте значение None.
|
| 66 |
+
Ключом в params является соответствующее имя параметра, отображаемое в интерфейсе, значение может быть str, api_key ниже будет текстовый редактор с пустым значением по умолчанию в интерфейсе.
|
| 67 |
+
Значение параметра также может быть словарем, но должно быть указано как тип 'type', который будет показан как селектор в интерфейсе, следующее устройство является селектором, либо cpu, либо cuda, по умолчанию cpu.
|
| 68 |
+
|
| 69 |
+
``` python
|
| 70 |
+
params: Dict = {
|
| 71 |
+
'api_key': '',
|
| 72 |
+
'device': {
|
| 73 |
+
'type': 'selector',
|
| 74 |
+
'options': ['cpu', 'cuda'],
|
| 75 |
+
'value': 'cpu'
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
<p align = "center">
|
| 81 |
+
<img src="./src/new_translator.png">
|
| 82 |
+
</p>
|
| 83 |
+
<p align = "center">
|
| 84 |
+
Результат вышеуказанного словаря параметров в панели настроек интерфейса
|
| 85 |
+
</p>
|
| 86 |
+
|
| 87 |
+
Переводчик должен реализовать _setup_translator, который выполняет инициализацию здесь. Ключ словаря lang_map - это языковая опция, отображаемая в интерфейсе, и присваивается языковому ключевому слову, принятому API, например, 'zh' для упрощенного китайского языка Google Translate. Здесь указаны только языки, поддерживаемые переводчиком, полный список языков см. в LANGMAP_GLOBAL в translator.__init__.
|
| 88 |
+
|
| 89 |
+
``` python
|
| 90 |
+
def _setup_translator(self):
|
| 91 |
+
self.lang_map['简体中文'] = 'zh'
|
| 92 |
+
self.lang_map['日本語'] = 'ja'
|
| 93 |
+
self.lang_map['English'] = 'en'
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
Переводчику также необходимо реализовать _translate, где lang_source и lang_target - это языки, выбранные в интерфейсе на данном этапе, а соответствующие ключевые слова api можно получить из предыдущей lang_map, чтобы сшить вместе параметры api и отправить запрос.
|
| 97 |
+
Обратите внимание, что если предыдущий параметр concate_text имеет значение False, то переданный сюда текст будет представлять собой таблицу строк, соответствующую оригинальному содержимому каждого текстового блока на текущей странице перевода, и переведенный результат также должен представлять собой таблицу переведенного текста один к одному. Если установлено значение True, входящий текст будет представлять собой обычную строку всех текстовых блоков, а выходной текст должен быть переведенной строкой.
|
| 98 |
+
Слишком медленно посылать запрос для каждого текстового блока, поэтому вся страница сшивается и переводится. concate_text настроен на автоматическое сшивание/разделение, и по умолчанию сшивает весь блок вместе с '\n###\n' в качестве разделителя, а затем разделяет переведенный текст обратно в текстовую таблицу с помощью '####'. Это работает для большинства проверенных мной переводчиков, но некоторые из них избавляются от #, поэтому вы можете отключить перевод concate_text блок за блоком или реализовать свой собственный метод сшивания.
|
| 99 |
+
Некоторые апи, такие как Caiyun, поддерживают прямые текстовые таблицы в сообщениях, поэтому можно установить значение False.
|
| 100 |
+
``` python
|
| 101 |
+
def _translate(self, src_list: List[str]) -> List[str]:
|
| 102 |
+
api_key = self.params['api_key'] # 如此获取用户修改过的api_key
|
| 103 |
+
source = self.lang_map[self.lang_source]
|
| 104 |
+
target = self.lang_map[self.lang_target]
|
| 105 |
+
return text
|
| 106 |
+
```
|
| 107 |
+
Фиктивный переводчик не делает ничего, кроме возвращения оригинального текста.
|
| 108 |
+
После внедрения переводчика рекомендуется написать собственный тест переводчика для проверки правильности вывода, следуя примеру в tests/test_translators.py. Как только тест пройден, вы можете использовать его в своем приложении.
|
| 109 |
+
|
| 110 |
+
Наконец, updateParam выше будет вызываться автоматически, когда пользователь изменит параметр, по умолчанию он будет изменять только значение в params, такое как api_key выше. Обычно это можно игнорировать, но если вам нужно изменить состояние транслятора, например, если это локальная модель трансляции, которая может переключаться между cuda и cpu, вы можете сделать это здесь.
|
doc/how_to_add_new_translator.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/加别的翻译器.md) | English | [pt-BR](../doc/Como_add_um_novo_tradutor.md) | [Русский](../doc/add_translator_ru.md)
|
| 2 |
+
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
If you know how to to call the target translator api or translation model in python, implement a class in ballontranslator/dl/translators.__init__.py as follows to use it in the app.
|
| 6 |
+
|
| 7 |
+
The following example DummyTranslator is commented out of ballontranslator/dl/translator/__init__.py and can be uncommented to test in the program.
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
``` python
|
| 11 |
+
|
| 12 |
+
# "dummy translator" is the name showed in the app
|
| 13 |
+
@register_translator('dummy translator')
|
| 14 |
+
class DummyTranslator(BaseTranslator):
|
| 15 |
+
|
| 16 |
+
concate_text = True
|
| 17 |
+
|
| 18 |
+
# parameters showed in the config panel.
|
| 19 |
+
# keys are parameter names, if value type is str, it will be a text editor(required key)
|
| 20 |
+
# if value type is dict, you need to spicify the 'type' of the parameter,
|
| 21 |
+
# following 'device' is a selector, options a cpu and cuda, default is cpu
|
| 22 |
+
params: Dict = {
|
| 23 |
+
'api_key': '',
|
| 24 |
+
'device': {
|
| 25 |
+
'type': 'selector',
|
| 26 |
+
'options': ['cpu', 'cuda'],
|
| 27 |
+
'value': 'cpu'
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
def _setup_translator(self):
|
| 32 |
+
'''
|
| 33 |
+
do the setup here.
|
| 34 |
+
keys of lang_map are those languages options showed in the app,
|
| 35 |
+
assign corresponding language keys accepted by API to supported languages.
|
| 36 |
+
Only the languages supported by the translator are assigned here, this translator only supports Japanese, and English.
|
| 37 |
+
For a full list of languages see LANGMAP_GLOBAL in translator.__init__
|
| 38 |
+
'''
|
| 39 |
+
self.lang_map['日本語'] = 'ja'
|
| 40 |
+
self.lang_map['English'] = 'en'
|
| 41 |
+
|
| 42 |
+
def _translate(self, src_list: List[str]) -> List[str]:
|
| 43 |
+
'''
|
| 44 |
+
do the translation here.
|
| 45 |
+
This translator do nothing but return the original text.
|
| 46 |
+
'''
|
| 47 |
+
source = self.lang_map[self.lang_source]
|
| 48 |
+
target = self.lang_map[self.lang_target]
|
| 49 |
+
|
| 50 |
+
translation = text
|
| 51 |
+
return translation
|
| 52 |
+
|
| 53 |
+
def updateParam(self, param_key: str, param_content):
|
| 54 |
+
'''
|
| 55 |
+
required only if some state need to be updated immediately after user change the translator params,
|
| 56 |
+
for example, if this translator is a pytorch model, you can convert it to cpu/gpu here.
|
| 57 |
+
'''
|
| 58 |
+
super().updateParam(param_key, param_content)
|
| 59 |
+
if param_key == 'device':
|
| 60 |
+
# get current state from params
|
| 61 |
+
# self.model.to(self.params['device']['value'])
|
| 62 |
+
pass
|
| 63 |
+
|
| 64 |
+
@property
|
| 65 |
+
def supported_tgt_list(self) -> List[str]:
|
| 66 |
+
'''
|
| 67 |
+
required only if the translator's language supporting is asymmetric,
|
| 68 |
+
for example, this translator only supports English -> Japanese, no Japanese -> English.
|
| 69 |
+
'''
|
| 70 |
+
return ['English']
|
| 71 |
+
|
| 72 |
+
@property
|
| 73 |
+
def supported_src_list(self) -> List[str]:
|
| 74 |
+
'''
|
| 75 |
+
required only if the translator's language supporting is asymmetric.
|
| 76 |
+
'''
|
| 77 |
+
return ['日本語']
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
First the translator must be decorated with register_translator and inherit from the base class BaseTranslator, the 'dummy translator' passed to the decorator is the name of the translator that will be displayed in the interface, be careful not to rename it with an existing translator.
|
| 81 |
+
This ```concate_text``` will be explained later, **set it to False if this translator is a offline model or target api accept str list**.
|
| 82 |
+
``` python
|
| 83 |
+
@register_translator('dummy translator')
|
| 84 |
+
class DummyTranslator(BaseTranslator):
|
| 85 |
+
concate_text = True
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
If the new translator requires user-configurable parameters, construct a dictionary named params as below, otherwise leave it alone or assign None to it.
|
| 89 |
+
|
| 90 |
+
The keys in params is the corresponding parameter names displayed in the interface, if the corresponding value type is str, it will show in app as a text editor, in following example, the api_key be a text editor with an empty default value.
|
| 91 |
+
The value of the parameter can also be a dictionary, in which case it must be described by 'type', in following example, the 'device' parameter will be shown as a selector in app, valid options are 'cpu' and 'cuda.
|
| 92 |
+
``` python
|
| 93 |
+
params: Dict = {
|
| 94 |
+
'api_key': '',
|
| 95 |
+
'device': {
|
| 96 |
+
'type': 'selector',
|
| 97 |
+
'options': ['cpu', 'cuda'],
|
| 98 |
+
'value': 'cpu'
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
```
|
| 102 |
+
<p align = "center">
|
| 103 |
+
<img src="./src/new_translator.png">
|
| 104 |
+
</p>
|
| 105 |
+
<p align = "center">
|
| 106 |
+
params displayed in the app's config panel.
|
| 107 |
+
</p>
|
| 108 |
+
|
| 109 |
+
Implement ```_setup_translator```: initialized the translator here.
|
| 110 |
+
|
| 111 |
+
``` python
|
| 112 |
+
def _setup_translator(self):
|
| 113 |
+
'''
|
| 114 |
+
do the setup here.
|
| 115 |
+
keys of lang_map are those languages options showed in the app,
|
| 116 |
+
assign corresponding language keys accepted by API to supported languages.
|
| 117 |
+
Only the languages supported by the translator are assigned here, this translator only supports Japanese, and English.
|
| 118 |
+
For a full list of languages see LANGMAP_GLOBAL in translator.__init__
|
| 119 |
+
'''
|
| 120 |
+
self.lang_map['日本語'] = 'ja'
|
| 121 |
+
self.lang_map['English'] = 'en'
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
Implement ```_translate```, the following lang_source and lang_target are the languages selected in the interface at this point, you can use the previous lang_map to get the corresponding api language keywords and make a request or process text & feed into model here.
|
| 125 |
+
If prementioned ```concate_text``` is set to False, input could be str list(all text recognized in a page) or str, else the input could be concated text of a str list (['text1', 'text2'] -> 'text1 \n###\n text2'), set it to True only if this translator is a online api and don't accept str list to make fewer requests.
|
| 126 |
+
|
| 127 |
+
``` python
|
| 128 |
+
def _translate(self, src_list: List[str]) -> List[str]:
|
| 129 |
+
'''
|
| 130 |
+
do the translation here.
|
| 131 |
+
This translator do nothing but return the original text.
|
| 132 |
+
'''
|
| 133 |
+
source = self.lang_map[self.lang_source]
|
| 134 |
+
target = self.lang_map[self.lang_target]
|
| 135 |
+
|
| 136 |
+
translation = text
|
| 137 |
+
return translation
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
Re-implement ```updateParam```, ```supported_tgt_list```, ```supported_src_list``` if necessary, please refer to their comments for further details.
|
| 141 |
+
|
| 142 |
+
Once the translator is implemented, it is recommended to test it following the example in tests/test_translators.py.
|
doc/macOS_app.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<i>Note macOS can also run the source code if it didn't work.</i>
|
| 2 |
+
|
| 3 |
+

|
| 4 |
+
|
| 5 |
+
#### 1. Preparation
|
| 6 |
+
- Download libs and models from [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw "MEGA") or [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing)
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
<img width="1268" alt="截屏2023-09-08 13 44 55_7g32SMgxIf" src="https://github.com/dmMaze/BallonsTranslator/assets/134026642/40fbb9b8-a788-4a6e-8e69-0248abaee21a">
|
| 10 |
+
|
| 11 |
+
- Put all the downloaded resources into a folder called data, the final directory tree structure should look like:
|
| 12 |
+
|
| 13 |
+
```
|
| 14 |
+
data
|
| 15 |
+
├── libs
|
| 16 |
+
│ └── patchmatch_inpaint.dll
|
| 17 |
+
└── models
|
| 18 |
+
├── aot_inpainter.ckpt
|
| 19 |
+
├── comictextdetector.pt
|
| 20 |
+
├── comictextdetector.pt.onnx
|
| 21 |
+
├── lama_mpe.ckpt
|
| 22 |
+
├── manga-ocr-base
|
| 23 |
+
│ ├── README.md
|
| 24 |
+
│ ├── config.json
|
| 25 |
+
│ ├── preprocessor_config.json
|
| 26 |
+
│ ├── pytorch_model.bin
|
| 27 |
+
│ ├── special_tokens_map.json
|
| 28 |
+
│ ├── tokenizer_config.json
|
| 29 |
+
│ └── vocab.txt
|
| 30 |
+
├── mit32px_ocr.ckpt
|
| 31 |
+
├── mit48pxctc_ocr.ckpt
|
| 32 |
+
└── pkuseg
|
| 33 |
+
├── postag
|
| 34 |
+
│ ├── features.pkl
|
| 35 |
+
│ └── weights.npz
|
| 36 |
+
├── postag.zip
|
| 37 |
+
└── spacy_ontonotes
|
| 38 |
+
├── features.msgpack
|
| 39 |
+
└── weights.npz
|
| 40 |
+
|
| 41 |
+
7 directories, 23 files
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
- Install pyenv command line tool for managing Python versions. Recommend installing via Homebrew.
|
| 45 |
+
```
|
| 46 |
+
# Install via Homebrew
|
| 47 |
+
brew install pyenv
|
| 48 |
+
|
| 49 |
+
# Install via official script
|
| 50 |
+
curl https://pyenv.run | bash
|
| 51 |
+
|
| 52 |
+
# Set shell environment after install
|
| 53 |
+
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
| 54 |
+
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
| 55 |
+
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
#### 2、Build the application
|
| 60 |
+
```
|
| 61 |
+
# Enter the `data` working directory
|
| 62 |
+
cd data
|
| 63 |
+
|
| 64 |
+
# Clone the `dev` branch of the repo
|
| 65 |
+
git clone -b dev https://github.com/dmMaze/BallonsTranslator.git
|
| 66 |
+
|
| 67 |
+
# Enter the `BallonsTranslator` working directory
|
| 68 |
+
cd BallonsTranslator
|
| 69 |
+
|
| 70 |
+
# Run the build script, will ask for password at pyinstaller step, enter password and press enter
|
| 71 |
+
sh scripts/build-macos-app.sh
|
| 72 |
+
```
|
| 73 |
+
> 📌The packaged app is at ./data/BallonsTranslator/dist/BallonsTranslator.app, drag the app to macOS application folder to install. Ready to use out of box without extra Python config.
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
</details>
|
doc/macOS_app_CN.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<i>如果构建不成功也可以直接跑源码</i>
|
| 2 |
+
|
| 3 |
+

|
| 4 |
+
|
| 5 |
+
```
|
| 6 |
+
# 第1步:打开终端并确保当前终端窗口的Python大版本号是3.12,可以用下面的命令确认版本号
|
| 7 |
+
python3 -V
|
| 8 |
+
# 如果没有安装Python 3.12,可以通过Homebrew安装
|
| 9 |
+
brew install python@3.12 python-tk@3.12
|
| 10 |
+
|
| 11 |
+
# 第2步:克隆仓库并进入仓库工作目录
|
| 12 |
+
git clone -b dev https://github.com/dmMaze/BallonsTranslator.git
|
| 13 |
+
cd BallonsTranslator
|
| 14 |
+
|
| 15 |
+
# 第3步:创建和启用 Python 3.12 虚拟环境
|
| 16 |
+
python3 -m venv venv
|
| 17 |
+
source venv/bin/activate
|
| 18 |
+
|
| 19 |
+
# 第4步:安装依赖
|
| 20 |
+
pip3 install -r requirements.txt
|
| 21 |
+
|
| 22 |
+
# 第5步:源码运行程序,会自动下载 data 文件,每个文件在20-400MB左右,合计大约1.67GB,需要比较稳定的网络,如果下载报错,请重复运行下面的命令直至不再下载报错并启动程序
|
| 23 |
+
# 下载完毕后运行下面的命令,如果正常运行且未报错,则继续进入打包应用程序的步骤
|
| 24 |
+
python3 launch.py
|
| 25 |
+
|
| 26 |
+
# 第6步:下载macos_arm64_patchmatch_libs.7z到项目根目录下的'.btrans_cache'隐藏文件夹
|
| 27 |
+
# 该步骤是为了防止打包好的应用程序首次启动时重新下载macos_arm64_patchmatch_libs.7z导致启动失败(大概率)
|
| 28 |
+
mkdir ./.btrans_cache
|
| 29 |
+
curl -L https://github.com/dmMaze/PyPatchMatchInpaint/releases/download/v1.0/macos_arm64_patchmatch_libs.7z -o ./.btrans_cache/macos_arm64_patchmatch_libs.7z
|
| 30 |
+
|
| 31 |
+
# 第7步:下载微软雅黑字体并放到fonts文件夹下,该步骤为可选项,不影响打包,只影响字体报错信息
|
| 32 |
+
|
| 33 |
+
# 第8步:构建 macOS 应用程序中途 sudo 命令需要输入开机密码授予权限
|
| 34 |
+
# 安装打包工具pyinstaller
|
| 35 |
+
pip3 install pyinstaller
|
| 36 |
+
# 删除MacOS下特有的.DS_Store文件,这些文件可能导致打包失败(中概率)
|
| 37 |
+
sudo find ./ -name '.DS_Store' -delete
|
| 38 |
+
# 开始打包.app应用程序
|
| 39 |
+
sudo pyinstaller launch.spec
|
| 40 |
+
```
|
| 41 |
+
> 📌打包好的应用在`./data/BallonsTranslator/dist/BallonsTranslator.app`,将应用拖到 macOS 的应用程序文件夹即完成安装,开箱即用,不需要另外配置 Python 环境。
|
doc/modules/translators.md
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ballon Translator: Translation Modules
|
| 2 |
+
|
| 3 |
+
* Available translators: Google, DeepL, ChatGPT, Sugoi, Caiyun, Baidu, Papago, and Yandex.
|
| 4 |
+
|
| 5 |
+
[**Table of Contents**](#table-of-contents)
|
| 6 |
+
- [Ballon Translator: Translation Modules](#ballon-translator-translation-modules)
|
| 7 |
+
- [LLM (Large Language Models)](#llm-large-language-models)
|
| 8 |
+
- [ChatGPT](#chatgpt)
|
| 9 |
+
- [ChatGPT (Experimental)](#chatgpt-experimental)
|
| 10 |
+
- [Text Generation WebUI (TGW)](#text-generation-webui-tgw)
|
| 11 |
+
- [Sakura](#sakura)
|
| 12 |
+
- [LLM (General Module)](#llm-general-module)
|
| 13 |
+
- [Other Translators](#other-translators)
|
| 14 |
+
- [Paid Translators](#paid-translators)
|
| 15 |
+
- [Baidu](#baidu)
|
| 16 |
+
- [Caiyun](#caiyun)
|
| 17 |
+
- [DeepL (Official API)](#deepl-official-api)
|
| 18 |
+
- [Youdao API](#youdao-api)
|
| 19 |
+
- [Yandex (Official API)](#yandex-official-api)
|
| 20 |
+
- [Free Translators](#free-translators)
|
| 21 |
+
- [DeepL Free](#deepl-free)
|
| 22 |
+
- [DeepLX API](#deeplx-api)
|
| 23 |
+
- [EzTrans](#eztrans)
|
| 24 |
+
- [Google](#google)
|
| 25 |
+
- [M2M100 (Facebook)](#m2m100-facebook)
|
| 26 |
+
- [Papago](#papago)
|
| 27 |
+
- [Sugoi](#sugoi)
|
| 28 |
+
- [Translators](#translators)
|
| 29 |
+
- [Yandex Free](#yandex-free)
|
| 30 |
+
- [Additional Resources](#additional-resources)
|
| 31 |
+
- [Acknowledgments](#acknowledgments)
|
| 32 |
+
- [Contributing to the Project](#contributing-to-the-project)
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## LLM (Large Language Models)
|
| 37 |
+
|
| 38 |
+
*Includes ChatGPT, Google Gemini, Text Generation WebUI, Sakura, and others.*
|
| 39 |
+
|
| 40 |
+
#### ChatGPT
|
| 41 |
+
|
| 42 |
+
For detailed setup instructions and using other OpenAI-compatible APIs, please refer to this [Discussion(We'll write soon.)](link-to-discussion-about-chatgpt-setup-here). *(Please replace 'link-to-discussion-about-chatgpt-setup-here' with the actual link to a relevant discussion about ChatGPT setup and alternative APIs)*
|
| 43 |
+
|
| 44 |
+
**Settings Fields:**
|
| 45 |
+
|
| 46 |
+
* **api key:** API Key for accessing the OpenAI API. You need to obtain an API key from the OpenAI platform ([https://platform.openai.com/playground](https://platform.openai.com/playground)).
|
| 47 |
+
* **model:** Model selection. Choose the desired OpenAI model from the dropdown list. Available options include: `gpt-4o`, `gpt-4-turbo`, `gpt3`, `gpt35-turbo`, `gpt4`. `gpt-4o` is recommended for the best performance.
|
| 48 |
+
* **3rd party api url:** 3rd party API URL (Endpoint). If you are using a third-party OpenAI-compatible API, enter its URL here. Leave blank to use the official OpenAI API endpoint (`https://api.openai.com/v1`).
|
| 49 |
+
* **override model:** Override Model. Optionally, specify a model name here to override the selected model. This is useful for testing specific models or using models not listed in the dropdown.
|
| 50 |
+
* **max tokens:** Maximum tokens. Sets the maximum number of tokens for the response from the API.
|
| 51 |
+
* **temperature:** Temperature. Controls the randomness of the output. Higher values (e.g., 0.7) make the output more random and creative, while lower values (e.g., 0.2) make it more focused and deterministic.
|
| 52 |
+
* **top p:** Top P. Another way to control the randomness of the output, similar to temperature.
|
| 53 |
+
|
| 54 |
+
#### ChatGPT (Experimental)
|
| 55 |
+
|
| 56 |
+
For detailed setup instructions and using other OpenAI-compatible APIs, please refer to this [Discussion(We'll write soon.)](link-to-discussion-about-chatgpt-exp-setup-here). *(Please replace 'link-to-discussion-about-chatgpt-exp-setup-here' with the actual link to a relevant discussion about ChatGPT (Experimental) setup and alternative APIs)*
|
| 57 |
+
|
| 58 |
+
* This is another version of the OpenAI-compatible translator. It may require more tokens to produce results, but it could be more accurate and reliable.
|
| 59 |
+
* Two versions of OpenAI API-compatible translators are supported, working with official or third-party LLM providers, requiring configuration in the settings panel:
|
| 60 |
+
* The non-suffix version (ChatGPT) consumes fewer tokens but has slightly weaker sentence splitting stability, which may cause issues with long text translations.
|
| 61 |
+
* The 'exp' suffix version (ChatGPT (Experimental)) uses more tokens but has better stability and includes "jailbreaking" in the Prompt, making it suitable for long text translations.
|
| 62 |
+
|
| 63 |
+
**Settings Fields:**
|
| 64 |
+
|
| 65 |
+
* **api key:** API Key for accessing the OpenAI API. You need to obtain an API key from the OpenAI platform ([https://platform.openai.com/playground](https://platform.openai.com/playground)).
|
| 66 |
+
* **model:** Model selection. Choose the desired OpenAI model from the dropdown list. Available options include: `gpt-4o`, `gpt-4-turbo`, `gpt-4o-mini`. `gpt-4o` is recommended for the best performance.
|
| 67 |
+
* **3rd party api url:** 3rd party API URL (Endpoint). If you are using a third-party OpenAI-compatible API, enter its URL here. Leave blank to use the official OpenAI API endpoint (`https://api.openai.com/v1`).
|
| 68 |
+
* **override model:** Override Model. Optionally, specify a model name here to override the selected model. This is useful for testing specific models or using models not listed in the dropdown.
|
| 69 |
+
* **max tokens:** Maximum tokens. Sets the maximum number of tokens for the response from the API.
|
| 70 |
+
* **temperature:** Temperature. Controls the randomness of the output. Higher values (e.g., 0.7) make the output more random and creative, while lower values (e.g., 0.2) make it more focused and deterministic.
|
| 71 |
+
* **top p:** Top P. Another way to control the randomness of the output, similar to temperature.
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
#### Text Generation WebUI (TGW)
|
| 75 |
+
|
| 76 |
+
This module is recommended only for users who can easily set up their own [TGW](https://github.com/oobabooga/text-generation-webui) server. If you cannot, please use other translation methods.
|
| 77 |
+
|
| 78 |
+
#### Sakura
|
| 79 |
+
|
| 80 |
+
**Sakura-13B-Galgame: [GitHub Repository](https://github.com/SakuraLLM/Sakura-13B-Galgame)**
|
| 81 |
+
|
| 82 |
+
* When running locally on a single device and encountering crashes due to VRAM OOM (Out Of Memory), it is recommended to enable ```low vram mode``` in the settings panel (enabled by default).
|
| 83 |
+
|
| 84 |
+
**Settings Fields:**
|
| 85 |
+
|
| 86 |
+
* **low vram mode:** Low VRAM mode. If checked (true), the Sakura module will use less video memory.
|
| 87 |
+
* **api baseurl:** API base URL to access the Sakura server. Default is `http://127.0.0.1:8080/v1/`. Change this if your Sakura server is running on a different address or port.
|
| 88 |
+
* **dict path:** Dictionary path for Sakura. Improves translation quality.
|
| 89 |
+
* **version:** Model version for Sakura. Choose from the list of available versions.
|
| 90 |
+
* **retry attempts:** Retry attempts in case of an error.
|
| 91 |
+
* **timeout:** Timeout for server response in milliseconds.
|
| 92 |
+
* **max tokens:** Maximum tokens in the response. Limits the length of the translation.
|
| 93 |
+
* **repeat detect threshold:** Repeat detection threshold. Decoding algorithm parameter.
|
| 94 |
+
* **force apply dict:** Force apply dictionary.
|
| 95 |
+
* **do enlarge small kana:** Enlarge small kana. Option for the Japanese language.
|
| 96 |
+
|
| 97 |
+
### LLM (General Module)
|
| 98 |
+
|
| 99 |
+
Temporary module. Essentially carries the functionality of ChatGPT, but with a preset for Google. Created as a temporary solution until a clear and working guide is written on how to use it within ChatGPT and ChatGPT (Experimental), and until proxy support is added.
|
| 100 |
+
|
| 101 |
+
---
|
| 102 |
+
|
| 103 |
+
## Other Translators
|
| 104 |
+
|
| 105 |
+
* **The following translators may require a token or API key to function:** [Caiyun](https://dashboard.caiyunapp.com/), [ChatGPT](https://platform.openai.com/playground), [Yandex](https://yandex.com/dev/translate/), [Baidu](http://developers.baidu.com/), and [DeepL](https://www.deepl.com/docs-api/api-access).
|
| 106 |
+
|
| 107 |
+
---
|
| 108 |
+
|
| 109 |
+
### Paid Translators
|
| 110 |
+
|
| 111 |
+
#### Baidu
|
| 112 |
+
|
| 113 |
+
**Settings Fields:**
|
| 114 |
+
|
| 115 |
+
* **token:** In this case, likely refers to the Secret Key for accessing the Baidu Translate API. **How to obtain (along with appId):**
|
| 116 |
+
1. Go to [Baidu AI开放平台 (Baidu AI Open Platform)](https://ai.baidu.com/tech/translate/translation_http). (Website in Chinese).
|
| 117 |
+
2. Register or log in to your Baidu account.
|
| 118 |
+
3. Navigate to the "产品服务" (Products and Services) section and find "翻译开放平台" (Open Translation Platform).
|
| 119 |
+
4. Create a new translation application or activate the translation service.
|
| 120 |
+
5. In your application settings, you will find **`AppID`** and **`API Key` (or `Secret Key`)**. Enter the `Secret Key` value in the `token` field and the `AppID` in the `appId` field. *The Baidu AI website is also in Chinese and may require a page translator.*
|
| 121 |
+
* **appId:** Application ID (AppID), obtained along with the Secret Key when registering for the Baidu Translate API. Required for authenticating requests to the Baidu API.
|
| 122 |
+
* **delay:** Delay in seconds between requests to the translation service. Used to control the frequency of requests.
|
| 123 |
+
|
| 124 |
+
#### Caiyun
|
| 125 |
+
|
| 126 |
+
**Settings Fields:**
|
| 127 |
+
|
| 128 |
+
* **token:** Access token for the Caiyun API. **How to obtain:**
|
| 129 |
+
1. Go to the [Caiyunfanyi](https://fanyi.caiyunapp.com/) website. (Website in Chinese)
|
| 130 |
+
2. Register or log in to your account.
|
| 131 |
+
3. Find the developer or API section (usually in profile settings or at the bottom of the page).
|
| 132 |
+
4. Create an application or get API access to obtain a **token**. *Please note that the website is in Chinese, and the token acquisition process may require using an online translator.*
|
| 133 |
+
* **delay:** Delay in seconds between requests to the translation service. Used to control the frequency of requests.
|
| 134 |
+
|
| 135 |
+
#### DeepL (Official API)
|
| 136 |
+
|
| 137 |
+
**Settings Fields:**
|
| 138 |
+
|
| 139 |
+
* **api_key:** API Key to access the DeepL API. **How to obtain:**
|
| 140 |
+
1. Go to the [DeepL for developers](https://www.deepl.com/pro-api) website.
|
| 141 |
+
2. Register and subscribe to the DeepL API (paid service).
|
| 142 |
+
3. After registration, you will receive an API key, which you need to enter in this field.
|
| 143 |
+
* **formality:** Allows controlling the formality level of the translation. For example, the value `less` will make the translation less formal and more conversational. Available options depend on the DeepL API.
|
| 144 |
+
* **context:** Field to add context to the text being translated. Providing context can improve translation quality, especially for ambiguous phrases. Enter additional information here to help DeepL understand the meaning of the text.
|
| 145 |
+
* **preserve_formatting:** Option to preserve the formatting of the original text during translation. If `enabled` is selected, DeepL will try to preserve formatting such as bold, italics, etc.
|
| 146 |
+
* **delay:** Delay in seconds between requests to the translation service. Used to control the frequency of requests to avoid blocking or exceeding API limits. A value of `0.0` (no delay) is usually sufficient, or use a small value if you encounter issues.
|
| 147 |
+
|
| 148 |
+
#### Youdao API
|
| 149 |
+
|
| 150 |
+
**Settings Fields:**
|
| 151 |
+
|
| 152 |
+
* **api_key:** API Key for accessing the Youdao Translate API. **How to obtain:**
|
| 153 |
+
1. Go to [Youdao智云 (Youdao Zhiyun - Youdao Intelligent Cloud)](https://ai.youdao.com/). (Website in Chinese).
|
| 154 |
+
2. Register or log in to your Youdao account.
|
| 155 |
+
3. Find the "自然语言翻译" (Natural Language Translation) or "机器翻译" (Machine Translation) section in the product list.
|
| 156 |
+
4. Create a new "应用" (application) for translation.
|
| 157 |
+
5. In the settings of the created application, you will get **`应用ID (App ID)`** and **`应用密钥 (App Secret)`**. Use the `应用ID` value as `api_key` and the `应用密钥` as `app_secret`. *The Youdao Zhiyun website is in Chinese and may require a page translator.*
|
| 158 |
+
* **app_secret:** App Secret, obtained along with the API Key when registering for the Youdao Translate API. Used for authenticating requests.
|
| 159 |
+
|
| 160 |
+
#### Yandex (Official API)
|
| 161 |
+
|
| 162 |
+
**Settings Fields:**
|
| 163 |
+
|
| 164 |
+
* **api_key:** API key to access the Yandex Translate API. **How to obtain:**
|
| 165 |
+
1. Go to [Yandex Cloud](https://cloud.yandex.ru/en/).
|
| 166 |
+
2. Register or log in to your Yandex Cloud account.
|
| 167 |
+
3. Create a "Service Account" and obtain an "API key" for this account. Ensure the service account has permissions to use the Yandex Translate API.
|
| 168 |
+
4. Copy the obtained **API key** and paste it into this field. *Yandex Cloud is a paid service but may offer a free trial period.*
|
| 169 |
+
* **delay:** Delay in seconds between requests to the translation service. Used to control the frequency of requests.
|
| 170 |
+
|
| 171 |
+
* Attention! If you previously used the [v1.5](https://translate.yandex.com/developers) version of the API, it has been closed and moved to Yandex Cloud. Therefore, if you have an old key, it will work if there are funds remaining in your balance. Once they run out, your key will become invalid.
|
| 172 |
+
|
| 173 |
+
---
|
| 174 |
+
|
| 175 |
+
### Free Translators
|
| 176 |
+
|
| 177 |
+
#### DeepL Free
|
| 178 |
+
|
| 179 |
+
**Settings Fields:**
|
| 180 |
+
|
| 181 |
+
* **delay:** Delay in seconds between requests. It's useful to set a value greater than `0`, for example, `3` seconds, to avoid overloading the free service and prevent temporary blocking.
|
| 182 |
+
* **proxy:** Field to enter the proxy server address if you want to use a proxy to access DeepL Free. The input format depends on the proxy type (HTTP, SOCKS, etc.). Leave the field blank if no proxy is needed.
|
| 183 |
+
|
| 184 |
+
#### DeepLX API
|
| 185 |
+
|
| 186 |
+
**DeepLX: Repositories:** [Vercel ver.](https://github.com/bropines/Deeplx-vercel) or [Self-host ver.](https://github.com/OwO-Network/DeepLX)
|
| 187 |
+
|
| 188 |
+
**Settings Fields:**
|
| 189 |
+
|
| 190 |
+
* **api_url:** API URL for DeepLX. Instructions on how to install and run DeepLX can be found in the project repositories listed at the beginning of this section.
|
| 191 |
+
|
| 192 |
+
* **delay:** Delay in seconds between requests to the translation service. Used to control the frequency of requests.
|
| 193 |
+
|
| 194 |
+
#### EzTrans
|
| 195 |
+
|
| 196 |
+
**Installation instructions for ezTrans XP can be found, for example, in this blog:** [Naver Blog - WaltherP38 (Korean)](https://blog.naver.com/waltherp38/221062272423)
|
| 197 |
+
|
| 198 |
+
**Settings Fields:**
|
| 199 |
+
|
| 200 |
+
* **path_dat:** Path to the Dat folder of your installed ezTrans XP program. This is usually the folder containing ezTrans data files needed for translation. **Example path:** `C:\Program Files (x86)\ChangShinSoft\ezTrans XP\Dat`. **Important:** Make sure the path leads to the correct `Dat` folder of your ezTrans XP installation.
|
| 201 |
+
* **path_j2k:** Path to the J2KEngine.dll file from your ezTrans XP installation. This file is the main library for Japanese to Korean (J2K) translation. **Example path:** `C:\Program Files (x86)\ChangShinSoft\ezTrans XP\J2KEngine.dll`.
|
| 202 |
+
* **path_k2j (Optional):** Path to the ehnd-kor.dll file from your ezTrans XP installation. This file is used for Korean to Japanese (K2J) translation. **Optional field:** required only if you need Korean to Japanese translation. **Example path:** `C:\Program Files (x86)\ChangShinSoft\ezTrans XP\ehnd-kor.dll`.
|
| 203 |
+
|
| 204 |
+
#### Google
|
| 205 |
+
|
| 206 |
+
**Attention:** Google Translate service has ceased operations in China. If you are in China, you may need to use a VPN or proxy server to access Google Translate.
|
| 207 |
+
|
| 208 |
+
* **delay:** Delay in seconds between requests to the translation service. Used to control the frequency of requests. A value of `0.0` is usually sufficient.
|
| 209 |
+
|
| 210 |
+
#### M2M100 (Facebook)
|
| 211 |
+
|
| 212 |
+
**Settings Fields:**
|
| 213 |
+
|
| 214 |
+
* **device:** Device for running the M2M100 model. Choose `CPU` to use the processor or `CUDA` to use an NVIDIA graphics card (if supported and configured). Using `CUDA` usually provides faster performance.
|
| 215 |
+
|
| 216 |
+
**To use the M2M100 module, you need to download the model:**
|
| 217 |
+
|
| 218 |
+
1. **Download the M2M100 1.2B model in CTranslate2 format.** Pre-converted models can be found [this.](https://huggingface.co/facebook/m2m100_1.2B)
|
| 219 |
+
2. **Place the downloaded model in the `data/models/m2m100-1.2B-ctranslate2` folder** (or the path specified as `CT_MODEL_PATH` in the `m2m100` module code). Make sure that the CTranslate2 model files (e.g., `model.bin`, `config.json`, `vocabulary.txt`) are in this folder.
|
| 220 |
+
|
| 221 |
+
#### Papago
|
| 222 |
+
|
| 223 |
+
**Settings Fields:**
|
| 224 |
+
|
| 225 |
+
* **delay:** Delay in seconds between requests to the translation service. Used to control the frequency of requests. A value of `0.0` is usually sufficient.
|
| 226 |
+
|
| 227 |
+
#### Sugoi
|
| 228 |
+
|
| 229 |
+
**Sugoi Translator: Japanese-English translation completely offline.**
|
| 230 |
+
|
| 231 |
+
* **Download the offline model:** [Google Drive](https://drive.google.com/drive/folders/1KnDlfUM9zbnYFTo6iCbnBaBKabXfnVJm) and move the "sugoi_translator" folder to `BallonsTranslator/ballontranslator/data/models`.
|
| 232 |
+
|
| 233 |
+
**Settings Fields:**
|
| 234 |
+
|
| 235 |
+
* **device:** Device for running the Sugoi Translator model. Choose `CPU` to use the processor or `CUDA` to use an NVIDIA graphics card (if supported and configured). Using `CUDA` usually provides faster performance.
|
| 236 |
+
|
| 237 |
+
#### Translators
|
| 238 |
+
|
| 239 |
+
**Translators library:** [GitHub Repository](https://github.com/UlionTse/translators).
|
| 240 |
+
* Supports access to some translation services without API keys. You can find out about supported services [here](https://github.com/UlionTse/translators#supported-translation-services).
|
| 241 |
+
|
| 242 |
+
**Settings Fields:**
|
| 243 |
+
|
| 244 |
+
* **translator provider:** Dropdown menu to select the translation provider from the `Translators Pack` library ([https://pypi.org/project/translators/](https://pypi.org/project/translators/)). `Translators Pack` integrates many different translation services (Bing, Yandex, Google, and others). Select the desired service from the list (e.g., `bing`, `google_v2`, `yandex`).
|
| 245 |
+
* **sleep_seconds:** Delay in seconds between requests. Similar to the `delay` field in other modules, used to control the frequency of requests.
|
| 246 |
+
|
| 247 |
+
#### Yandex Free
|
| 248 |
+
|
| 249 |
+
**Settings Fields:**
|
| 250 |
+
|
| 251 |
+
* **endpoint:** Endpoint URL to access Yandex Free Translate. Currently, only a self-hosted solution is available. You can find more details about the installation [here](https://github.com/FOSWLY/translate-backend)
|
| 252 |
+
* **delay:** Delay in seconds between requests.
|
| 253 |
+
|
| 254 |
+
---
|
| 255 |
+
|
| 256 |
+
### Additional Resources
|
| 257 |
+
|
| 258 |
+
* Other good offline English translators can be found or suggested in this [discussion thread](https://github.com/dmMaze/BallonsTranslator/discussions/515).
|
| 259 |
+
|
| 260 |
+
---
|
| 261 |
+
|
| 262 |
+
## Acknowledgments
|
| 263 |
+
|
| 264 |
+
* DeepL and Sugoi translators (and their CT2 Translation conversion) are developed thanks to [Snowad14](https://github.com/Snowad14).
|
| 265 |
+
|
| 266 |
+
---
|
| 267 |
+
|
| 268 |
+
## Contributing to the Project
|
| 269 |
+
|
| 270 |
+
* To add a new translator, please refer to the [instructions](doc/how_to_add_new_translator.md). It's as simple as subclassing a BaseClass and implementing two interfaces. You are welcome to contribute to the project.
|
doc/saladict.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/saladict_chs.md) | English | [pt-BR](../doc/saladict_pt-br.md) | [한국어](../doc/saladict_ko.md) | [Español](../doc/saladict_es.md) | [Français](../doc/saladict_fr.md)
|
| 2 |
+
|
| 3 |
+
Note it only work with browsers that offer global shortcuts for extensions(Currently only Firefox does no support global shortcuts)
|
| 4 |
+
|
| 5 |
+
1. Installation: https://saladict.crimx.com/download.html
|
| 6 |
+
2. In Saladict options, enable "Keep in Background", enable "Permissions" - 'Read Clipboard".
|
| 7 |
+
3. In browser(edge://extensions/shortcuts or chrome://extensions/shortcuts), set a **global** shortcut for ```Search clipboard content in Standalone Panel```:
|
| 8 |
+
|
| 9 |
+
<img src="./src/saladictglobalshortcut.jpg" div align=center>
|
| 10 |
+
|
| 11 |
+
**Note the shortcut in browser should be the same as in the ballonstranslator**, with "ALT+S" by default:
|
| 12 |
+
|
| 13 |
+
<img src="./src/saladictglobalshortcut2.jpg" div align=center>
|
doc/saladict_chs.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
简体中文 | [English](../doc/saladict.md) | [pt-BR](../doc/saladict_pt-br.md) | [한국어](../doc/saladict_ko.md) | [Español](../doc/saladict_es.md) | [Français](../doc/saladict_fr.md)
|
| 2 |
+
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
需要浏览器支持为扩展设置全局快捷键(火狐尚未支持)
|
| 6 |
+
|
| 7 |
+
1. 安装: https://saladict.crimx.com/download.html
|
| 8 |
+
2. 在沙拉查词扩展选项中, 开启「后台保持运行」, 允许「权限管理」-「读取剪贴板」
|
| 9 |
+
3. 浏览器里为沙拉查词设置**全局**快捷键(打开edge://extensions/shortcuts或者chrome://extensions/shortcuts):
|
| 10 |
+
|
| 11 |
+
<img src="./src/saladictglobalshortcut.jpg" div align=center>
|
| 12 |
+
|
| 13 |
+
**注意应该与软件内的一致**, 默认是"ALT+S":
|
| 14 |
+
|
| 15 |
+
<img src="./src/saladictglobalshortcut2.jpg" div align=center>
|
doc/saladict_es.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/saladict_chs.md) | [English](../doc/saladict.md) | [pt-BR](../doc/saladict_pt-br.md) | [한국어](../doc/saladict_ko.md) | Español | [Français](../doc/saladict_fr.md)
|
| 2 |
+
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
**Nota:** Sólo funciona con navegadores que permitan accesos directos globales a extensiones (actualmente, sólo Firefox no admite accesos directos globales).
|
| 6 |
+
|
| 7 |
+
1. **Instalación:** https://saladict.crimx.com/download.html
|
| 8 |
+
2. **Ajustes de Saladict:**
|
| 9 |
+
* Activar "Mantener en segundo plano".
|
| 10 |
+
* Activar "Permisos" - "Leer portapapeles".
|
| 11 |
+
3. **Configuración del navegador (accesos directos):**
|
| 12 |
+
* En el navegador (edge://extensions/shortcuts o chrome://extensions/shortcuts), establece un atajo **global** para "Buscar contenido del portapapeles en el panel independiente".
|
| 13 |
+
|
| 14 |
+
<img src="./src/saladictglobalshortcut.jpg" div align=center>
|
| 15 |
+
|
| 16 |
+
**Importante:** El atajo en el navegador debe ser el mismo que en BallonsTranslator (por defecto, «ALT+S»).
|
| 17 |
+
|
| 18 |
+
<img src="./src/saladictglobalshortcut2.jpg" div align=center>
|
doc/saladict_fr.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/saladict_chs.md) | [English](../doc/saladict.md) | [pt-BR](../doc/saladict_pt-br.md) | [한국어](../doc/saladict_ko.md) | [Español](../doc/saladict_es.md) | Français
|
| 2 |
+
|
| 3 |
+
Note : cela ne fonctionne qu’avec les navigateurs qui offrent des raccourcis globaux pour les extensions (actuellement seul Firefox ne prend pas en charge les raccourcis globaux).
|
| 4 |
+
|
| 5 |
+
1. Installation : https://saladict.crimx.com/download.html
|
| 6 |
+
2. Dans les options de Saladict, activez « Rester en arrière-plan » et activez les « Permissions » – « Lire le presse-papiers ».
|
| 7 |
+
3. Dans le navigateur (edge://extensions/shortcuts ou chrome://extensions/shortcuts), définissez un **raccourci global** pour ```Rechercher le contenu du presse-papiers dans le panneau autonome```:
|
| 8 |
+
|
| 9 |
+
<img src="./src/saladictglobalshortcut.jpg" div align=center>
|
| 10 |
+
|
| 11 |
+
**Remarque : le raccourci dans le navigateur doit être le même que celui dans ballonstranslator**, avec « ALT+S » par défaut ::
|
| 12 |
+
|
| 13 |
+
<img src="./src/saladictglobalshortcut2.jpg" div align=center>
|
doc/saladict_ko.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/saladict_chs.md) | [English](../doc/saladict.md) | [pt-BR](../doc/saladict_pt-br.md) | 한국어 | [Español](../doc/saladict_es.md) | [Français](../doc/saladict_fr.md)
|
| 2 |
+
|
| 3 |
+
확장에 대한 전역 단축키를 제공하는 브라우저에서만 작동합니다(현재 Firefox만 전역 단축키를 지원하지 않습니다)
|
| 4 |
+
|
| 5 |
+
1. 설치: https://saladict.crimx.com/download.html
|
| 6 |
+
2. Saladict 옵션에서 "Keep in Background"를 활성화하고 "Permissions" - 'Read Clipboard"를 활성화합니다.
|
| 7 |
+
3. 브라우저(edge://extensions/shortcuts 또는 chrome://extensions/shortcuts)에서 ```Search clipboard content in Standalone Panel```에 대한 **전역** 단축키를 설정합니다:
|
| 8 |
+
|
| 9 |
+
<img src="./src/saladictglobalshortcut.jpg" div align=center>
|
| 10 |
+
|
| 11 |
+
**브라우저의 단축키는 기본적으로 ballonstrator 설정과 동일해야 합니다**, 기본값은 "ALT+S" 입니다:
|
| 12 |
+
|
| 13 |
+
<img src="./src/saladictglobalshortcut2.jpg" div align=center>
|
doc/saladict_pt-br.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[简体中文](../doc/saladict_chs.md) | [English](../doc/saladict.md) | pt-BR | [한국어](../doc/saladict_ko.md) | [Español](../doc/saladict_es.md) | [Français](../doc/saladict_fr.md)
|
| 2 |
+
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
**Observação:** Funciona apenas com navegadores que permitem atalhos globais para extensões (atualmente, apenas o Firefox não oferece suporte a atalhos globais).
|
| 6 |
+
|
| 7 |
+
1. **Instalação:** https://saladict.crimx.com/download.html
|
| 8 |
+
2. **Configurações do Saladict:**
|
| 9 |
+
* Habilite "Manter em Segundo Plano".
|
| 10 |
+
* Habilite "Permissões" - "Ler Área de Transferência".
|
| 11 |
+
3. **Configurações do Navegador (atalhos):**
|
| 12 |
+
* No navegador (edge://extensions/shortcuts ou chrome://extensions/shortcuts), defina um atalho **global** para "Pesquisar conteúdo da área de transferência no painel autônomo".
|
| 13 |
+
|
| 14 |
+
<img src="./src/saladictglobalshortcut.jpg" div align=center>
|
| 15 |
+
|
| 16 |
+
**Importante:** O atalho no navegador deve ser o mesmo que no BallonsTranslator (por padrão, "ALT+S").
|
| 17 |
+
|
| 18 |
+
<img src="./src/saladictglobalshortcut2.jpg" div align=center>
|
doc/src/006049.png
ADDED
|
Git LFS Details
|
doc/src/AisazuNihaIrarenai-003.png
ADDED
|
Git LFS Details
|
doc/src/AisazuNihaIrarenai-003_eng.png
ADDED
|
Git LFS Details
|
doc/src/bottombar0.png
ADDED
|
Git LFS Details
|
doc/src/configpanel.png
ADDED
|
Git LFS Details
|
doc/src/fontpresets.gif
ADDED
|
Git LFS Details
|
doc/src/global_font_format.png
ADDED
|
Git LFS Details
|
doc/src/imgedit_inpaint.gif
ADDED
|
Git LFS Details
|
doc/src/multisel_autolayout.gif
ADDED
|
Git LFS Details
|
doc/src/new_translator.png
ADDED
|
Git LFS Details
|