-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathpyproject.toml
More file actions
250 lines (238 loc) · 7.66 KB
/
Copy pathpyproject.toml
File metadata and controls
250 lines (238 loc) · 7.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# uv 依赖配置(替代 requirements_cpu/gpu/amd/metal.txt)
#
# 安装方式(五选一,dependency groups 互斥):
# uv sync # 默认:NVIDIA CUDA 13.0 + 打包/测试工具
# uv sync --no-default-groups --group cuda12.6 # NVIDIA CUDA 12.6 版
# uv sync --no-default-groups --group cpu # CPU 版
# uv sync --no-default-groups --group rocm7.2.1 # Linux AMD ROCm 7.2.1 版
# uv sync --no-default-groups --group metal # macOS Apple Silicon (MPS) 版
[project]
name = "manga-translator-ui"
version = "1.7.6"
description = "Manga Image Translator UI"
requires-python = ">=3.12,<3.13"
dependencies = [
"aiofiles==25.1.0",
"aiohttp==3.14.3",
"aioshutil==1.5",
"albumentations==2.0.8",
"arabic-reshaper==3.0.0",
"backports.statistics==0.1.0",
"colorama==0.4.6",
"customtkinter==5.2.2",
"einops==0.8.1",
"fastapi==0.141.1",
"fire==0.7.1",
"fugashi==1.3.2",
"hanlp==2.1.3",
"python-multipart==0.0.32",
"httpcore==1.0.9",
"httpx>=0.28.1,<1.0.0",
"ijson==3.4.0",
"jaconv==0.3.4",
"json5==0.9.28",
"kornia==0.8.1",
"langcodes==3.5.0",
"loguru==0.7.3",
"matplotlib==3.11.1",
"networkx==3.5",
"omegaconf==2.3.0",
"openai==2.14.0",
"curl_cffi>=0.7.0",
"opencv-contrib-python>=4.10.0",
"packaging<25.0",
"pandas==2.3.1",
"Pillow==12.3.0",
"pillow-heif==1.5.0",
"psutil==5.9.5",
"py3langid==0.2.2",
"pyclipper==1.3.0.post6",
"pydantic==2.11.7",
"pyperclip==1.9.0",
"pythainlp[nlpo3]==5.3.1",
"PyHyphen==4.0.4",
"PyQt6==6.9.1",
"PyQt6-Fluent-Widgets==1.11.2",
"python-dotenv==1.2.2",
"rich==14.1.0",
"safetensors==0.8.0",
"spandrel==0.4.1",
"scipy==1.16.1",
# YOLO OBB / MangaLens 气泡检测运行时依赖 ultralytics
"ultralytics==8.4.14",
# sentencepiece 已移除,改用 tokenizers 库 (use_fast=True)
"setuptools==83.0.0",
"Shapely==2.1.1",
"scikit-image==0.25.2",
"starlette==1.3.1",
"tiktoken==0.11.0",
"timm==1.0.19",
"transformers==5.14.1",
"accelerate>=1.12.0",
"tqdm==4.67.1",
"unidic_lite==1.0.8",
"uvicorn==0.35.0",
"websockets==14.2",
"anyio>=4.8.0",
"google-genai==1.57.0",
# pydensecrf 来源按平台选择,见 [tool.uv.sources]
"pydensecrf",
"torchsummary",
"open_clip_torch==3.1.0",
"python-bidi==0.6.6",
"google-cloud==0.34.0",
# 简繁体中文转换
"opencc-python-reimplemented==0.1.7",
# PDF/EPUB/CBZ 压缩包支持
"PyMuPDF==1.25.5",
"rarfile==4.2",
"py7zr==1.1.3",
# Server 模块依赖
"bcrypt==4.2.1",
"cryptography==50.0.0",
"APScheduler==3.10.4",
]
[dependency-groups]
cpu = [
"torch==2.13.0",
"torchvision==0.28.0",
"onnxruntime==1.28.0",
"ctranslate2==4.8.1",
"huggingface-hub==1.26.0",
"numpy>=2.0,<2.3",
]
"cuda13.0" = [
"torch==2.13.0",
"torchvision==0.28.0",
"onnxruntime-gpu==1.28.0",
"ctranslate2==4.8.1",
"huggingface-hub==1.26.0",
"numpy>=2.0,<2.3",
"xformers==0.0.35",
]
# Docker 仍以 BUILD_TYPE=gpu 选择镜像阶段;该内部别名不用于安装器或发行附件命名。
gpu = [
{ include-group = "cuda13.0" },
]
"cuda12.6" = [
"torch==2.13.0",
"torchvision==0.28.0",
"onnxruntime-gpu==1.28.0",
"ctranslate2==4.8.1",
"huggingface-hub==1.26.0",
"numpy>=2.0,<2.3",
"xformers==0.0.35",
]
# AMD ROCm:Linux 使用 PyTorch 官方 ROCm 7.2 索引;Windows 安装器使用 Radeon ROCm 7.2.1。
# Windows ROCm 依赖由 packaging/launch.py 按 ROCm SDK -> PyTorch 顺序安装。
"rocm7.2.1" = [
"onnxruntime==1.28.0",
"ctranslate2==4.8.1",
"huggingface-hub==1.26.0",
"numpy>=2.0,<2.3",
"torch==2.13.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"torchvision==0.28.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"triton-rocm==3.7.1; sys_platform == 'linux' and platform_machine == 'x86_64'",
]
metal = [
# 使用默认 PyPI 源,自动安装 MPS 版本
"torch==2.13.0",
"torchvision==0.28.0",
# macOS 不支持 GPU 版 onnxruntime
"onnxruntime==1.28.0",
"ctranslate2==4.8.1",
"huggingface-hub==1.26.0",
"numpy>=2.0,<2.3",
# macOS 原生 Dock 图标支持(AppKit)
"pyobjc-framework-Cocoa>=10.0",
]
packaging = [
"pyinstaller==6.17.0",
"pyinstaller-hooks-contrib==2025.9",
]
test = [
"pytest==9.1.1",
]
[tool.uv]
# 本项目按应用管理,不构建/安装自身
package = false
# 本仓库默认使用 NVIDIA CUDA 13.0 环境,并保留项目打包和测试工具
default-groups = ["cuda13.0", "packaging", "test"]
# 五种后端互斥,不能同时安装
conflicts = [
[
{ group = "cpu" },
{ group = "cuda13.0" },
{ group = "cuda12.6" },
{ group = "rocm7.2.1" },
{ group = "metal" },
],
]
[tool.pytest.ini_options]
# 固定到当前仓库,避免 pytest 向上继承相邻旧仓库的配置和源码路径。
testpaths = ["test"]
pythonpath = [".", "desktop_qt_ui"]
[tool.uv.sources]
# torch 索引按 dependency group 绑定;metal 不绑定,回落到默认 PyPI(自动 MPS 版)
torch = [
{ index = "pytorch-cpu", group = "cpu" },
{ index = "pytorch-cu130", group = "cuda13.0" },
{ index = "pytorch-cu126", group = "cuda12.6" },
{ index = "pytorch-rocm72", group = "rocm7.2.1", marker = "sys_platform == 'linux' and platform_machine == 'x86_64'" },
]
torchvision = [
{ index = "pytorch-cpu", group = "cpu" },
{ index = "pytorch-cu130", group = "cuda13.0" },
{ index = "pytorch-cu126", group = "cuda12.6" },
{ index = "pytorch-rocm72", group = "rocm7.2.1", marker = "sys_platform == 'linux' and platform_machine == 'x86_64'" },
]
triton-rocm = [
{ index = "pytorch-rocm72", group = "rocm7.2.1", marker = "sys_platform == 'linux' and platform_machine == 'x86_64'" },
]
xformers = [
{ index = "pytorch-cu130", group = "cuda13.0" },
{ index = "pytorch-cu126", group = "cuda12.6" },
]
# pydensecrf 按平台选择安装来源
# Windows/macOS/Linux x86_64: 预编译 wheel(避免本地编译失败)
pydensecrf = [
{ url = "https://github.com/hgmzhn/manga-translator-ui/releases/download/v1.7.6/pydensecrf-1.0-cp312-cp312-win_amd64.whl", marker = "sys_platform == 'win32'" },
{ url = "https://github.com/hgmzhn/pydensecrf/releases/download/v1.0.0/pydensecrf-1.0-cp312-cp312-macosx_10_13_universal2.whl", marker = "sys_platform == 'darwin'" },
{ url = "https://github.com/hgmzhn/pydensecrf/releases/download/v1.0.0/pydensecrf-1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", marker = "sys_platform == 'linux' and platform_machine == 'x86_64'" },
]
# pydensecrf 无运行时依赖;直接声明元数据,避免 lock 时为 Linux 分支从 git 源码构建
[[tool.uv.dependency-metadata]]
name = "pydensecrf"
requires-dist = []
# HanLP 仍依赖已弃用的 pynvml 兼容包;nvidia-ml-py 提供同名模块,
# 可直接替代且不会在导入时产生弃用警告。
[[tool.uv.dependency-metadata]]
name = "hanlp"
version = "2.1.3"
requires-dist = [
"hanlp-common>=0.0.23",
"hanlp-downloader",
"hanlp-trie>=0.0.4",
"nvidia-ml-py>=12.0.0",
"sentencepiece>=0.1.91",
"termcolor",
"toposort==1.5",
"torch>=1.6.0",
"transformers>=4.1.1",
]
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu126"
url = "https://download.pytorch.org/whl/cu126"
explicit = true
[[tool.uv.index]]
name = "pytorch-rocm72"
url = "https://download.pytorch.org/whl/rocm7.2"
explicit = true