From: Christian Heller Date: Mon, 26 Aug 2024 07:24:07 +0000 (+0200) Subject: Add timing info. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7B%20web_path%20%7D%7D/pick_tasks?a=commitdiff_plain;h=5c426fc7f28036bba4ba54c7ff869fcb5c15d4d3;p=stable_plom Add timing info. --- diff --git a/stable.py b/stable.py index 29e1918..484ac6e 100755 --- a/stable.py +++ b/stable.py @@ -3,6 +3,7 @@ from sys import argv, exit as sys_exit, stdin from os.path import dirname, basename, splitext, join as path_join, exists from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from random import randint +from datetime import datetime from stable.gen_params import GenParams, GEN_PARAMS @@ -120,6 +121,7 @@ def run(): old_model_path = '' maker = None total = len(args.models) * args.quantity + start_time = datetime.now() for i, model_name in enumerate(args.models): new_model_path = path_join(args.models_dir, model_name) if new_model_path != old_model_path: @@ -145,8 +147,13 @@ def run(): gen_params.seed = start_seed + n + seed_corrector path = save_path(i*args.quantity + n) maker.set_gen_params(gen_params) - index = i*args.quantity + n - print(f'GENERATING {index}/{total}: {path}; {gen_params.to_str}') + index = i*args.quantity + n + 1 + until_now = datetime.now() - start_time + until_end = ((until_now / index) * total) - until_now + print(f'GENERATING {index}/{total} ' + f'(time so far: {until_now[:-7]} / ' + f'estimated time left: {until_end[:-7]}): ' + f'{path}; {gen_params.to_str}') maker.gen_image_to(path)