Commit d199de76 authored by dmMaze's avatar dmMaze
Browse files

headless mode #413

parent 677fd20b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -139,6 +139,13 @@ OCR并翻译选中文本框

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

## 命令行模式 (无GUI)
``` python
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
```
所有设置 (如检测模型, 原语言目标语言等) 会从 config/config.json 导入。  
如果渲染字体大小不对, 通过 ```--ldpi ``` 指定 Logical DPI 大小, 通常为 96 和 72。

# 自动化模块
本项目重度依赖 [manga-image-translator](https://github.com/zyddnys/manga-image-translator),在线服务器和模型训练需要费用,有条件请考虑支持一下
- Ko-fi: <https://ko-fi.com/voilelabs>
+8 −1
Original line number Diff line number Diff line
@@ -186,6 +186,13 @@ OCR & Translate Selected Area
  
<img src="doc/src/configpanel.png">

## Headless mode (Run without GUI)
``` python
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
```
Note the configuration (source language, target language, inpaint model, etc) will load from config/config.json.  
If the rendered font size is not right, specify logical DPI manually via ```--ldpi ```, typical values are 96 and 72.


# Automation modules
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:  
+4 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ parser.add_argument("--debug", action='store_true')
parser.add_argument("--requirements", default='requirements.txt')
parser.add_argument("--headless", action='store_true', help='run without GUI')
parser.add_argument("--exec_dirs", default='', help='translation queue (project directories) separated by comma')
parser.add_argument("--ldpi", default=None, type=float, help='logical dots perinch')
args, _ = parser.parse_known_args()


@@ -224,6 +225,8 @@ def main():
        shared.APP_DEFAULT_FONT = app_font

    shared.APP_DEFAULT_FONT = app.font().defaultFamily()
    if args.ldpi:
        shared.LDPI = args.ldpi

    from ui.mainwindow import MainWindow

+2 −4
Original line number Diff line number Diff line
# To install pytorch cuda (gpu) version, please look https://pytorch.org/

PyQt6-Qt6>=6.6.2; sys_platform == 'win32'
PyQt6>=6.6.1; sys_platform == 'win32'
PyQt6-Qt6>=6.6.2; sys_platform == 'darwin'
PyQt6>=6.6.1; sys_platform == 'darwin'
PyQt6-Qt6>=6.6.2
PyQt6>=6.6.1
numpy
urllib3==1.25.11 # https://github.com/psf/requests/issues/5740
jaconv