Closed caiweihan closed 1 month ago
I have modified the code in the
__init__
function ofmainwindow.py
from:if shared.HEADLESS: self.run_batch(**exec_args)
to:
self.run_batch(**exec_args)
这样改有个问题是不传 exec 相关参数的时候下面的判断会直接让程序退出,可以
if len(self.exec_dirs) == 0
: 改成 if len(self.exec_dirs) == 0 and shared.HEADLESS
:为什么要额外加个 argument,直接对每个 exec_dirs 递归找下一层目录就行了,是否递归可以加个可选参数 --recursive 。 另外找下一层目录的时候最好滤掉 basename 是 inpainted, result, mask 这些存结果的目录。
另外建议不要在 launch.py 而是在 run_batch 里面解析执行参数。
I have modified the code in the
__init__
function ofmainwindow.py
from:if shared.HEADLESS: self.run_batch(**exec_args)
to:
self.run_batch(**exec_args)
这样改有个问题是不传 exec 相关参数的时候下面的判断会直接让程序退出,可以
- 在 run_batch 里检查发现 exec 相关参数为空且 headless 模式就在调用 run_next_dir 前返回
- 下面的条件
if len(self.exec_dirs) == 0
: 改成if len(self.exec_dirs) == 0 and shared.HEADLESS
:为什么要额外加个 argument,直接对每个 exec_dirs 递归找下一层目录就行了,是否递归可以加个可选参数 --recursive 。 另外找下一层目录的时候最好滤掉 basename 是 inpainted, result, mask 这些存结果的目录。
另外建议不要在 launch.py 而是在 run_batch 里面解析执行参数。
OK,这是我昨天遇到 Qt 的问题后自己让程序能够运行而改的代码,那就不提交了吧
For a folder that contains multiple subfolders, where each subfolder includes various comic images, you can use this command to batch process all subfolders:
For this feature, I've added some lines of code in
launch.py
:You can also use this command for translation, which will bring up the interface and display the images being translated in real-time, providing a better demonstration of the progress and accuracy of the translations:
I have modified the code in the
__init__
function ofmainwindow.py
from:to:
And changed the code in the
on_imgtrans_pipeline_finished
function from:to:
In addition, I have updated the README files to inform users about these new features.