提供自動合併機制。

This commit is contained in:
yaoming 2022-10-09 00:48:04 +08:00
parent 335f887ba9
commit a767b6790b
4 changed files with 98 additions and 37 deletions

View file

@ -71,19 +71,19 @@ def main (model_class_name=None,
place_model_on_cpu=True,
run_on_cpu=run_on_cpu)
if md.g(None, "interactive") is None:
if md.g("interactive") is None:
is_interactive = io.input_bool ("Use interactive merger?", True) if not io.is_colab() else False
else:
is_interactive = md.g(None, "interactive")
is_interactive = md.g("interactive")
if not is_interactive:
cfg.ask_settings()
if md.g(None, "subprocess_count") is None:
if md.gd("NoSet", "subprocess_count") == "NoSet":
subprocess_count = io.input_int("Number of workers?", max(8, multiprocessing.cpu_count()),
valid_range=[1, multiprocessing.cpu_count()], help_message="Specify the number of threads to process. A low value may affect performance. A high value may result in memory error. The value may not be greater than CPU cores." )
else:
subprocess_count = md.g(4, "subprocess_count")
subprocess_count = md.gd(4, "subprocess_count")
input_path_image_paths = pathex.get_image_paths(input_path)