Giter Club home page Giter Club logo

dmmaze / ballonstranslator Goto Github PK

View Code? Open in Web Editor NEW
2.0K 16.0 135.0 57.57 MB

深度学习辅助漫画翻译工具, 支持一键机翻和简单的图像/文本编辑 | Yet another computer-aided comic/manga translation tool powered by deeplearning

License: GNU General Public License v3.0

Python 95.62% Batchfile 0.17% CSS 1.52% Shell 0.68% JavaScript 2.01%
comics computer-aided-translation deep-learning manga ocr scene-text-detection inpainting pytorch computer-vision anime

ballonstranslator's Introduction

BallonTranslator

简体中文 | English | Русский | 日本語 | Indonesia

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

界面预览

Features

  • 一键机翻

    • 译文回填参考对原文排版的估计,包括颜色,轮廓,角度,朝向,对齐方式等
    • 最后效果取决于文本检测,识别,抹字,机翻四个模块的整体表现
    • 支持日漫和美漫
    • 英译中,日译英排版已优化,文本布局以提取到的背景泡为参考,中文基于 pkuseg 进行断句,日译中竖排待改善
  • 图像编辑
    支持掩膜编辑和修复画笔

  • 文本编辑

    • 支持所见即所得地富文本编辑和一些基础排版格式调整、字体样式预设
    • 支持全文/源文/译文查找替换
    • 支持导入导出 word 文档
  • 适用于条漫

使用说明

Windows

如果用 Windows 而且不想自己手动配置环境,而且能正常访问互联网:
MEGAGoogle Drive 下载 BallonsTranslator_dev_src_with_gitpython.7z,解压并运行 launch_win.bat 启动程序。如果无法自动下载库和模型,手动下载 data 和 ballontrans_pylibs_win.7z 并解压到程序目录下。
运行 scripts/local_gitpull.bat 获取更新。

运行源码

安装 Python < 3.12 (别用微软应用商店版) 和 Git

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

# 启动程序
$ python3 launch.py

第一次运行会自动安装 torch 等依赖项并下载所需模型和文件,如果模型下载失败,需要手动从 MEGAGoogle Drive 下载 data 文件夹(或者报错里提到缺失的文件),并保存到源码目录下的对应位置。

如果要使用Sugoi翻译器(仅日译英),下载离线模型,将 sugoi_translator 移入 BallonsTranslator/ballontranslator/data/models。

构建 macOS 应用(适用 apple silicon 芯片)

如果构建不成功也可以直接跑源码

录屏2023-09-11 14 26 49

# 第1步:打开终端并确保当前终端窗口的Python大版本号是3.11,可以用下面的命令确认版本号
python3 -V

# 第2步:克隆仓库并进入仓库工作目录
git clone -b dev https://github.com/dmMaze/BallonsTranslator.git
cd BallonsTranslator

# 第3步:创建和启用 Python 3.11 虚拟环境
python3 -m venv venv
source venv/bin/activate

# 第4步:安装依赖
pip3 install -r requirements.txt

# 第5步:源码运行程序,会自动下载 data 文件,每个文件在20-400MB左右,合计大约1.67GB,需要比较稳定的网络,如果下载报错,请重复运行下面的命令直至不再下载报错并启动程序
# 如果多次下载失败,也可以从 [MEGA](https://mega.nz/folder/gmhmACoD#dkVlZ2nphOkU5-2ACb5dKw) 或 [Google Drive](https://drive.google.com/drive/folders/1uElIYRLNakJj-YS0Kd3r3HE-wzeEvrWd?usp=sharing) 下载 `libs` 和 `models` 并放入 data 文件夹
python3 launch.py

# 第6步:运行下面的远程脚本开始构建 macOS 应用程序(仅限 Apple Silicon 芯片的 Mac 设备),中途 sudo 命令需要输入开机密码授予权限
cd ..
curl -L https://raw.githubusercontent.com/dmMaze/BallonsTranslator/dev/scripts/macos-build-script.sh | bash

📌打包好的应用在./data/BallonsTranslator/dist/BallonsTranslator.app,将应用拖到 macOS 的应用程序文件夹即完成安装,开箱即用,不需要另外配置 Python 环境。

一键翻译

建议在命令行终端下运行程序,首次运行请先配置好源语言/目标语言,打开一个带图片的文件夹,点击 Run 等待翻译完成

一键机翻嵌字格式如大小、颜色等默认是由程序决定的,可以在设置面板->嵌字菜单中改用全局设置。全局字体格式就是未编辑任何文本块时右侧字体面板显示的格式:

画板

修复画笔

修复画笔

矩形工具

矩形工具

按下鼠标左键拖动矩形框抹除框内文字,按下右键拉框清除框内修复结果。
抹除结果取决于算法(gif 中的"方法1"和"方法2")对文字区域估算的准确程度,一般拉的框最好稍大于需要抹除的文本块。两种方法都比较玄学,能够应付绝大多数简单文字简单背景,部分复杂背景简单文字/简单背景复杂文字,少数复杂背景复杂文字,可以多拉几次试试。
勾选"自动"拉完框立即修复,否则需要按下"修复"或者空格键才进行修复,或 Ctrl+D 删除矩形选框。

文本编辑

文本编辑

批量文本格式调整及自动排版

OCR并翻译选中文本框

界面说明及快捷键

  • Ctrl+Z,Ctrl+Y 可以撤销重做大部分操作,注意翻页后撤消重做栈会清空
  • A/D 或 pageUp/Down 翻页,如果当前页面未保存会自动保存
  • T 切换到文本编辑模式下(底部最右"T"图标),W激活文本块创建模式后在画布右键拉文本框
  • P 切换到画板模式,右下角滑条改原图透明度
  • 标题栏->运行 可以启用/禁用任意自动化模块,全部禁用后Run会根据全局字体样式和嵌字设置重新渲染文本
  • 设置面板配置各自动化模块参数
  • Ctrl++/- 或滚轮缩放画布
  • Ctrl+A 可选中界面中所有文本块
  • Ctrl+F 查找当前页,Ctrl+G全局查找
  • 0-9调整嵌字/原图透明度
  • 文本编辑下 Ctrl+B 加粗,Ctrl+U 下划线,Ctrl+I 斜体
  • 字体样式面板-"特效"修改透明度添加阴影

命令行模式 (无GUI)

python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."

所有设置 (如检测模型, 原语言目标语言等) 会从 config/config.json 导入。
如果渲染字体大小不对, 通过 --ldpi 指定 Logical DPI 大小, 通常为 96 和 72。

自动化模块

本项目重度依赖 manga-image-translator,在线服务器和模型训练需要费用,有条件请考虑支持一下

Sugoi 翻译器作者: mingshiba

文本检测

暂时仅支持日文(方块字都差不多)和英文检测,训练代码和说明见https://github.com/dmMaze/comic-text-detector

OCR

  • 所有 mit 模型来自 manga-image-translator,支持日英汉识别和颜色提取
  • manga_ocr 来自 kha-white,支持日语识别,注意选用该模型程序不会提取颜色

图像修复

  • AOT 修复模型来自 manga-image-translator
  • patchmatch 是非深度学习算法,也是PS修复画笔背后的算法,实现来自 PyPatchMatch,本程序用的是我的修改版
  • lama* 是微调过的lama

翻译器

  • 谷歌翻译器已经关闭**服务,大陆再用需要设置全局代理,并在设置面板把 url 换成*.com
  • 彩云,需要申请 token
  • papago
  • DeepL 和 Sugoi (及它的 CT2 Translation 转换)翻译器,感谢 Snowad14
  • 支持 Sakura-13B-Galgame

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

  • 电脑带N卡或 Apple silicon 默认启用 GPU 加速
  • 感谢 bropines 提供俄语翻译
  • 第三方输入法可能会造成右侧编辑框显示 bug,见#76,暂时不打算修
  • 选中文本迷你菜单支持聚合词典专业划词翻译沙拉查词: 安装说明

ballonstranslator's People

Contributors

alicewish avatar bropines avatar dmmaze avatar eltociear avatar hyrulelinks avatar kagenihisomi avatar mayako21126 avatar pidanshourouzhouxd avatar rokolyt avatar snowad14 avatar snylonue avatar tak2hu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ballonstranslator's Issues

Another block selection system

The annoying thing is that when I'm about to edit a selected block on a page, I move the mouse to another block and everything flies off. And I also wanted the text blocks (on the right) to move the focus only when I click on the input box.

使用几小时发现的一些bug

  1. 在文本编辑界面选择文字时,如果鼠标拖动停止的位置在文字框外,那么就无法复制
  2. 在右侧修改文字后,左侧的文字经常会有奇怪的错误(如图)。
  3. 图像修复的inpaint_size默认为2048,但是我这边会因为爆内存而崩溃,建议默认1024

Snipaste_2022-12-29_16-08-08

另外,我发现字体颜色的识别有点问题,经常会把黑色设置成灰色(可能是jpg噪点的问题),建议增加全局修改字体颜色的功能。

Help me with Sugoi translator integration (RuntimeError: Unable to open file 'model.bin' in model 'data/models/sugoi_translator')

Traceback (most recent call last):
File "C:\Users\n\DOWNLO1\COMPRE1\BALLON1\BALLON1.0-C\BALLON1\dl\translators_init_.py", line 81, in init
File "C:\Users\n\DOWNLO
1\COMPRE1\BALLON1\BALLON1.0-C\BALLON1\dl\translators_init_.py", line 106, in setup_translator
File "C:\Users\n\DOWNLO1\COMPRE1\BALLON1\BALLON1.0-C\BALLON~1\dl\translators_init_.py", line 374, in _setup_translator
RuntimeError: Unable to open file 'model.bin' in model 'data/models/sugoi_translator'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\n\DOWNLO1\COMPRE1\BALLON1\BALLON1.0-C\BALLON1\ui\dl_manager.py", line 161, in _set_translator
File "C:\Users\n\DOWNLO
1\COMPRE1\BALLON1\BALLON1.0-C\BALLON1\dl\translators_init_.py", line 86, in init
dl.translators.exceptions.TranslatorSetupFailure: Unable to open file 'model.bin' in model 'data/models/sugoi_translator'

(strike down was unintended it had '~' symbol in it)

用pyinstaller将本项目打包成standalone macOS app的方法

之前版本能够在M1 Max Mac上启动了,但后来电脑重装了,有些库都变过了,就重新来了一遍,新版本在maxOS上又无法启动了

requirements_macOS.txt 中的cocoa库没有找到,去PyPI也没有,我猜是不是pycocoa?改成pycocoa后requirements_macOS安装成功,然后运行python ballontranslator

报错如下,虽然using pyqt6,但还是提示找不到pyqt5

❯ python ballontranslator
/Users/usr/.pyenv/versions/3.9.12/lib/python3.9/site-packages/qtpy/__init__.py:267: RuntimeWarning: Selected binding "pyqt5" could not be found, using "pyqt6"
  warnings.warn('Selected binding "{}" could not be found, '
Traceback (most recent call last):
  File "/Users/usr/.pyenv/versions/3.9.12/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/usr/.pyenv/versions/3.9.12/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/usr/Downloads/BallonsTranslator/ballontranslator/__main__.py", line 60, in <module>
    main()
  File "/Users/usr/Downloads/BallonsTranslator/ballontranslator/__main__.py", line 52, in main
    from ui.mainwindow import MainWindow
  File "/Users/usr/Downloads/BallonsTranslator/ballontranslator/ui/mainwindow.py", line 22, in <module>
    from .mainwindowbars import TitleBar, LeftBar, BottomBar
  File "/Users/usr/Downloads/BallonsTranslator/ballontranslator/ui/mainwindowbars.py", line 11, in <module>
    from .framelesswindow import startSystemMove
  File "/Users/usr/Downloads/BallonsTranslator/ballontranslator/ui/framelesswindow/__init__.py", line 6, in <module>
    from .fw_qt6.utils import startSystemMove
  File "/Users/usr/Downloads/BallonsTranslator/ballontranslator/ui/framelesswindow/fw_qt6/__init__.py", line 8, in <module>
    from .mac import AcrylicWindow
  File "/Users/usr/Downloads/BallonsTranslator/ballontranslator/ui/framelesswindow/fw_qt6/mac/__init__.py", line 8, in <module>
    from .window_effect import MacWindowEffect
  File "/Users/usr/Downloads/BallonsTranslator/ballontranslator/ui/framelesswindow/fw_qt6/mac/window_effect.py", line 5, in <module>
    from ..utils.mac_utils import getNSWindow
  File "/Users/usr/Downloads/BallonsTranslator/ballontranslator/ui/framelesswindow/fw_qt6/utils/__init__.py", line 7, in <module>
    from .mac_utils import MacMoveResize as MoveResize
  File "/Users/usr/Downloads/BallonsTranslator/ballontranslator/ui/framelesswindow/fw_qt6/utils/mac_utils.py", line 6, in <module>
    from PyQt5.QtCore import QT_VERSION_STR
ModuleNotFoundError: No module named 'PyQt5.QtCore'

一些小问题

1.竖向文本排版中,符号不会转
2. 在软件中的快捷键说明不够
3. 画笔工具会在所有图片上生效
4. 1.3.0相对1.2.0更容易崩溃

copying areas of text, pasting text into multiple areas of text

hello, is it possible to add to them the ability to enter the same text when selecting several areas of text? (paste copied text) Let's say I need to paste one number "1" into 10 different text clouds, it's inconvenient to enter them in turn everywhere. is it possible to add a text alignment feature? create guides like in Photoshop so that text can align with them is it possible to make it possible to copy multiple areas with text and paste them elsewhere? Let's say I want to copy two areas of text and paste them side by side so they're aligned. sorry if there are such functions, I read the instructions in Russian and did not understand anything ... perhaps the translation of the instructions is incorrect. if you want, I can later translate the instruction into Russian and send it to you, perhaps it will come in handy for some of the Russian-speaking users

好像不支持图片还原?

image
image
您好 这个 拟声词 被自动识别并且翻译了 实际上是没必要的
然后删除之后这里就空白了 然后在 掩码的部分没有看到反向涂抹修复?

Brush tool is missing an eraser

Suppose I've drawn something, but I want to erase some extra pieces and there is no eraser. If click Right mouse button, it turns on permanent drawing mode altogether

The video shows how it just starts drawing all the time after right-clicking

Carnac_S6nCQ8V7vg.mp4

Icon

I've been working on adding an icon here. Everything worked out, but I still don't understand how to change the icon in the Windows taskbar
image

We drew the icon from scratch with Lavanette

A couple of questions

The program when performs all translations, painting over even what is not needed. Like I don't want any cloud to be painted over and translated, with text, but it can't be undone. There is no paint layer as such. I would like to be able to remove probably painted and translated pieces

If you don't understand anything, I can attach a video)

Transferring a folder into the program.

I would like to simply move the folder, say, to the left menu from Explorer, so that the program would search for images in it. You can also add a default path function, where you can simply add the working folder, with all the material

DeepL Translation

It won't allow me to translate to English using DeepL it says ('target_lang="EN" is deprecated, please use "EN-GB" or "EN-US" instead.').
For DeepL you need to use either English British or English American for it to work.

文字显示不全呢

bandicam.2023-01-01.11-15-26-730.mp4

先祝大佬2023元旦新年快乐
您说2023年前更新OCR
我还以为至少要农历的年呢 没想到 今天起来就看到您更新出来了
然后 我发现个问题 如上边的视频所演示的那样
在漫画这边的气泡里写字
在右侧的文本框里显示不全
我开始以为是不是我字体的问题?
换了挺多字体 微软 方正 思源 都是这个问题
我确定不是我字体的事情
遂来发帖

ModuleNotFoundError: No module named 'qtpy'

I tried building the program so I could try using sugoi translator with this, and I after about a day of it running (not sure why it was so slow) it finally finished but when I try and run the ballontranslator.exe it gives me this error

Traceback (most recent call last):
File "H:\apps\BallonsTranslator\release\BallonTranslator.dist_main_.py", line 44, in
File "H:\apps\BallonsTranslator\release\BallonTranslator.dist_main_.py", line 19, in main
ModuleNotFoundError: No module named 'qtpy'

闪退的有点严重

不知道为什么管理员权限也会闪退 各种操作下都会发生闪退
好不稳定啊

RAM Usage

Can we do something about RAM usage ?
It's more than Chrome (with 15 tabs open)

image

Another couple of wishes

  • 1. Applying a stroke color to each individual letter
    python3 9_jlPR4Iqusa
  • 2. Ability to create shapes (circle/oval and rectangle)
  • 3. Transparency of the text layer. Change the final transparency of the text (sometimes found in manga).
  • 4. Font selection menu often does not hold a long name of the font (and it generally can not hold much).
    image

So far, all I found during the translation of the manga

Unable to install pkuseg

I have installed all other packages successfully only pkuseg is left. I have python 3.10.7 installed, is it causing error because of that ? I

Log for reference:

F:\Ballon\BallonsTranslator>pip install -r requirements.txt
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
Requirement already satisfied: numpy in c:\python310\lib\site-packages (from -r requirements.txt (line 2)) (1.23.3)
Requirement already satisfied: urllib3==1.25.11 in c:\python310\lib\site-packages (from -r requirements.txt (line 3)) (1.25.11)
Requirement already satisfied: jaconv in c:\python310\lib\site-packages (from -r requirements.txt (line 4)) (0.3)
Requirement already satisfied: torch in c:\python310\lib\site-packages (from -r requirements.txt (line 5)) (1.13.0+cu117)
Requirement already satisfied: torchvision in c:\python310\lib\site-packages (from -r requirements.txt (line 6)) (0.14.0+cu117)
Requirement already satisfied: transformers in c:\python310\lib\site-packages (from -r requirements.txt (line 7)) (4.23.1)
Requirement already satisfied: fugashi in c:\python310\lib\site-packages (from -r requirements.txt (line 8)) (1.2.0)
Requirement already satisfied: unidic_lite in c:\python310\lib\site-packages (from -r requirements.txt (line 9)) (1.0.8)
Requirement already satisfied: tqdm in c:\python310\lib\site-packages (from -r requirements.txt (line 10)) (4.64.1)
Requirement already satisfied: opencv-python==4.5.* in c:\python310\lib\site-packages (from -r requirements.txt (line 11)) (4.5.5.64)
Requirement already satisfied: PyQt5>=5.15.4 in c:\python310\lib\site-packages (from -r requirements.txt (line 12)) (5.15.7)
Requirement already satisfied: shapely in c:\python310\lib\site-packages (from -r requirements.txt (line 13)) (1.8.5.post1)
Requirement already satisfied: pyclipper in c:\python310\lib\site-packages (from -r requirements.txt (line 14)) (1.3.0.post3)
Requirement already satisfied: einops in c:\python310\lib\site-packages (from -r requirements.txt (line 15)) (0.5.0)
Requirement already satisfied: termcolor in c:\python310\lib\site-packages (from -r requirements.txt (line 16)) (2.1.0)
Requirement already satisfied: bs4 in c:\python310\lib\site-packages (from -r requirements.txt (line 17)) (0.0.1)
Requirement already satisfied: deepl in c:\python310\lib\site-packages (from -r requirements.txt (line 18)) (1.11.0)
Requirement already satisfied: qtpy in c:\python310\lib\site-packages (from -r requirements.txt (line 19)) (2.2.1)
Collecting pkuseg
  Using cached pkuseg-0.0.25.tar.gz (48.8 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: sentencepiece in c:\python310\lib\site-packages (from -r requirements.txt (line 21)) (0.1.97)
Requirement already satisfied: ctranslate2 in c:\python310\lib\site-packages (from -r requirements.txt (line 22)) (2.24.0)
Requirement already satisfied: python-docx in c:\python310\lib\site-packages (from -r requirements.txt (line 23)) (0.8.11)
Requirement already satisfied: docx2txt in c:\python310\lib\site-packages (from -r requirements.txt (line 24)) (0.8)
Requirement already satisfied: piexif in c:\python310\lib\site-packages (from -r requirements.txt (line 25)) (1.1.3)
Requirement already satisfied: typing-extensions in c:\python310\lib\site-packages (from torch->-r requirements.txt (line 5)) (4.4.0)
Requirement already satisfied: requests in c:\python310\lib\site-packages (from torchvision->-r requirements.txt (line 6)) (2.28.1)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in c:\python310\lib\site-packages (from torchvision->-r requirements.txt (line 6)) (9.2.0)
Requirement already satisfied: packaging>=20.0 in c:\python310\lib\site-packages (from transformers->-r requirements.txt (line 7)) (21.3)
Requirement already satisfied: filelock in c:\python310\lib\site-packages (from transformers->-r requirements.txt (line 7)) (3.8.0)
Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in c:\python310\lib\site-packages (from transformers->-r requirements.txt (line 7)) (0.13.1)
Requirement already satisfied: pyyaml>=5.1 in c:\python310\lib\site-packages (from transformers->-r requirements.txt (line 7)) (6.0)
Requirement already satisfied: huggingface-hub<1.0,>=0.10.0 in c:\python310\lib\site-packages (from transformers->-r requirements.txt (line 7)) (0.10.1)
Requirement already satisfied: regex!=2019.12.17 in c:\python310\lib\site-packages (from transformers->-r requirements.txt (line 7)) (2022.9.13)
Requirement already satisfied: colorama in c:\python310\lib\site-packages (from tqdm->-r requirements.txt (line 10)) (0.4.6)
Requirement already satisfied: PyQt5-sip<13,>=12.11 in c:\python310\lib\site-packages (from PyQt5>=5.15.4->-r requirements.txt (line 12)) (12.11.0)
Requirement already satisfied: PyQt5-Qt5>=5.15.0 in c:\python310\lib\site-packages (from PyQt5>=5.15.4->-r requirements.txt (line 12)) (5.15.2)
Requirement already satisfied: beautifulsoup4 in c:\python310\lib\site-packages (from bs4->-r requirements.txt (line 17)) (4.11.1)
Requirement already satisfied: cython in c:\python310\lib\site-packages (from pkuseg->-r requirements.txt (line 20)) (0.29.32)
Requirement already satisfied: lxml>=2.3.2 in c:\python310\lib\site-packages (from python-docx->-r requirements.txt (line 23)) (4.9.1)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\python310\lib\site-packages (from packaging>=20.0->transformers->-r requirements.txt (line 7)) (3.0.9)
Requirement already satisfied: idna<4,>=2.5 in c:\python310\lib\site-packages (from requests->torchvision->-r requirements.txt (line 6)) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in c:\python310\lib\site-packages (from requests->torchvision->-r requirements.txt (line 6)) (2022.9.24)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\python310\lib\site-packages (from requests->torchvision->-r requirements.txt (line 6)) (2.1.1)
Requirement already satisfied: soupsieve>1.2 in c:\python310\lib\site-packages (from beautifulsoup4->bs4->-r requirements.txt (line 17)) (2.3.2.post1)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
Installing collected packages: pkuseg
  DEPRECATION: pkuseg is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for pkuseg ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pkuseg did not run successfully.
  │ exit code: 1
  ╰─> [68 lines of output]
      running install
      C:\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\config.py -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\data.py -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\download.py -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\gradient.py -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\model.py -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\optimizer.py -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\res_summarize.py -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\scorer.py -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\trainer.py -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\__init__.py -> build\lib.win-amd64-cpython-310\pkuseg
      creating build\lib.win-amd64-cpython-310\pkuseg\dicts
      copying pkuseg\dicts\__init__.py -> build\lib.win-amd64-cpython-310\pkuseg\dicts
      creating build\lib.win-amd64-cpython-310\pkuseg\models
      copying pkuseg\models\__init__.py -> build\lib.win-amd64-cpython-310\pkuseg\models
      creating build\lib.win-amd64-cpython-310\pkuseg\postag
      copying pkuseg\postag\model.py -> build\lib.win-amd64-cpython-310\pkuseg\postag
      copying pkuseg\postag\__init__.py -> build\lib.win-amd64-cpython-310\pkuseg\postag
      creating build\lib.win-amd64-cpython-310\pkuseg\models\default
      copying pkuseg\models\default\__init__.py -> build\lib.win-amd64-cpython-310\pkuseg\models\default
      copying pkuseg\feature_extractor.pyx -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\inference.pyx -> build\lib.win-amd64-cpython-310\pkuseg
      copying pkuseg\dicts\default.pkl -> build\lib.win-amd64-cpython-310\pkuseg\dicts
      copying pkuseg\postag\feature_extractor.pyx -> build\lib.win-amd64-cpython-310\pkuseg\postag
      copying pkuseg\models\default\features.pkl -> build\lib.win-amd64-cpython-310\pkuseg\models\default
      copying pkuseg\models\default\weights.npz -> build\lib.win-amd64-cpython-310\pkuseg\models\default
      running build_ext
      skipping 'pkuseg\inference.cpp' Cython extension (up-to-date)
      cythoning pkuseg/feature_extractor.pyx to pkuseg\feature_extractor.c
      cythoning pkuseg/postag/feature_extractor.pyx to pkuseg/postag\feature_extractor.c
      building 'pkuseg.inference' extension
      creating build\temp.win-amd64-cpython-310
      creating build\temp.win-amd64-cpython-310\Release
      creating build\temp.win-amd64-cpython-310\Release\pkuseg
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Python310\lib\site-packages\numpy\core\include -IC:\Python310\include -IC:\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tppkuseg\inference.cpp /Fobuild\temp.win-amd64-cpython-310\Release\pkuseg\inference.obj
      inference.cpp
      C:\Python310\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
      pkuseg\inference.cpp(3118): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
      pkuseg\inference.cpp(4284): warning C4244: '=': conversion from 'npy_intp' to 'int', possible loss of data
      pkuseg\inference.cpp(4285): warning C4244: '=': conversion from 'npy_intp' to 'int', possible loss of data
      pkuseg\inference.cpp(5108): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
      pkuseg\inference.cpp(6219): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
      pkuseg\inference.cpp(6807): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int', possible loss of data
      pkuseg\inference.cpp(22327): error C2105: '++' needs l-value
      pkuseg\inference.cpp(22329): error C2105: '--' needs l-value
      pkuseg\inference.cpp(22616): error C2105: '++' needs l-value
      pkuseg\inference.cpp(22618): error C2105: '--' needs l-value
      pkuseg\inference.cpp(22855): error C2105: '++' needs l-value
      pkuseg\inference.cpp(22857): error C2105: '--' needs l-value
      pkuseg\inference.cpp(23619): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Python310\include\cpython/object.h(191): note: see declaration of '_typeobject'
      pkuseg\inference.cpp(23624): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Python310\include\cpython/object.h(191): note: see declaration of '_typeobject'
      pkuseg\inference.cpp(23639): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Python310\include\cpython/object.h(191): note: see declaration of '_typeobject'
      pkuseg\inference.cpp(23652): error C2039: 'tp_print': is not a member of '_typeobject'
      C:\Python310\include\cpython/object.h(191): note: see declaration of '_typeobject'
      pkuseg\inference.cpp(24323): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
      pkuseg\inference.cpp(24339): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
      pkuseg\inference.cpp(26222): warning C4996: 'PyUnicode_FromUnicode': deprecated in 3.3
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pkuseg

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)

是不是不支持 导出编辑好的图片?

今天偶然看到这个工具
下载试了试 还行把 随便编辑了几张图 之后发现???没有导出 图片的功能?
还有 没有原始图片文字 和 翻译文字的图片对吧功能(是直接在气泡上对比 不是在右侧的那个编辑里对吧 那个对比 不直观 )
图片修复这个功能真的很不错 没有很厚重的涂抹感
大佬是不是可以考虑先吧 编辑翻译完的图片导出功能安排上?
还有百度 腾讯 翻译接口也安排一下?

自动队列

添加自动队列,在当前文件夹下所有文件都跑完了后自动跑队列中的下一个文件夹
或者加一个跑完全部后自动关机

A question

I'm a new guy,and I want to know how to zoom the picture,the pictures I opened seems too big,and I have no idea to zoom them

Dark theme?

I would like to change the theme of the application. At night, it makes the eyes hurt to look at the white interface.

重新识别?

image
相同的文本框
image
一页有3个 有一个没被识别出来 这种情况狠多
可否考虑增加右键菜单 对单一选中的框选区域进行重新审查识别?
还有这种整页都没有识别的
是否可以增加一个
image
image
运行仅限于本页的单次 运行重新审查识别 现在的运行=整本漫画全部重来一遍

Different Offline Translator Model

Would it be possible to add support for a pytorch model (in the form of a .pt file) instead of the .model and .bin model that is currently used, as I have another model I would like to use instead of the one provided. The sugoi offline model is being improved and it would be nice to use future improved models with the program.

I am unsure as how to achieve this myself but I would appreciate any tips on how to edit the source code to use the different model format or how to convert my model in to the model format required.

把导出Word改成导出Xls

把word文档换为xls表格是否会好些
xls表格可以更直观的存储、修改及导入
在导出的表格里有图片
就像这样
image
1.工程是文件名
2.序号是为了方便程序读取(001.1.1是个例子,你可以自行定义)
3.其中像颜色那一栏如果可以的话直接改单元格像这样
image
xls表格不止可以存储这些信息,我只是举例

新人使用问题

是否直接下载Ballonstranslator-1.30-core.7z和Ballonstranslator-1.316及data文件就可以了?然后不需要再按照说明去克隆仓库,直接命令行执行程序就可以了吗?

还有我执行程序后只能使用一键机翻对所有队列图片后才会出现OCR文字,翻译的结果,然后如果需要调整翻译文字进行嵌字的话,就只能调整好后在进行一键机翻,没有单独保存的功能吗

Failed to set manga_ocr:No module named 'asyncio' K Show Details...

image
image

image

Traceback (most recent call last):
File "D:\BALLON1\ui\dl_manager.py", line 47, in _set_module
File "D:\BALLON
1\dl\ocr_init_.py", line 22, in init
File "D:\BALLON1\dl\ocr_init_.py", line 125, in setup_ocr
File "D:\BALLON
1\dl\ocr\manga_ocr.py", line 4, in
File "D:\BallonTranslator\transformers_init_.py", line 31, in
from .file_utils import (
File "D:\BallonTranslator\transformers\file_utils.py", line 51, in
from huggingface_hub import HfFolder, Repository, create_repo, list_repo_files, whoami
File "D:\BallonTranslator\huggingface_hub_init_.py", line 33, in
from .file_download import cached_download, hf_hub_download, hf_hub_url
File "D:\BallonTranslator\huggingface_hub\file_download.py", line 16, in
from tqdm.auto import tqdm
File "D:\BallonTranslator\tqdm\auto.py", line 29, in
from .asyncio import tqdm as asyncio_tqdm
File "D:\BallonTranslator\tqdm\asyncio.py", line 10, in
import asyncio
ModuleNotFoundError: No module named 'asyncio'
因为识别不准确且不能单独进行框选识别 我打算换个引擎然后重新跑
被提示这个 是需要下载什么东西吗?

can't import project json file

Traceback (most recent call last):
  File "E:\dev2\BallonsTranslator-master\ui\mainwindowbars.py", line 265, in onOpenProj
    self.open_dir.emit()
TypeError: LeftBar.open_dir[str] signal has 1 argument(s) but 0 provided

Maybe you just haven't implemented it yet but as there are no Exeptions that show it so I wanted to be sure

Recognizing individual clouds of text

If it is possible, I would like to have a feature where you can select a region and all text in it is recognized with ocr and will be deleted with inpaint.
Just tired of every time to screenshot and throw in google lens to recognize characters that are either not recognized, or in such a crooked cloud that everything is jumbled

Font Size Settings

When I try to change the font size, I enter one digit and... all. The cursor moves to a block of text, and sometimes erases everything I've been working on. Here's a gif

python3.9_7m8K11QIvS.mp4

New translators support and better text display

Hi

Can you add support for DeepL which is the best online translator although the free option only works for a limited amount you can also implement the Textractor workaround with its DevTools solution that kinda lets you use DeepL unlimited for free.

The other translator to add is Sugoi Japanese Translator (links in the description) that is even better than DeepL for translating weeb related things, plus is 100% free and totally works offline with no restrictions! I suggest joining the discord where many different devs hang out for more info https://discord.gg/XFbWSjMHJh

Also you think you can fix the issue regarding the horrible way the english translated text is displayed that I mentioned here zyddnys/manga-image-translator#58 (comment) ?

Feature request

  • Pin/Favourite fonts (show pinned or recently used fonts on top)

  • Shortcut to change page (Already available A/D I thought it was for scrolling up down)

  • Option to remove images from the sidebar list

And few questions:

  1. How can I select single image to edit ? I don't want to import whole folder but only selected images.

  2. How can I perform OCR + Translation + Inpainting on selected (current) page or bubble only.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.