mirror of
https://github.com/rakuri255/UltraSinger.git
synced 2026-11-30 09:13:57 +09:00
downgrade tensorflow dependency to last version with gpu support for windows update plot to be a linear progression between notes on the y axis and include confidence information add timer component to measure process time
27 lines
560 B
Python
27 lines
560 B
Python
import atexit
|
|
from functools import reduce
|
|
from time import process_time
|
|
|
|
from modules.console_colors import ULTRASINGER_HEAD
|
|
|
|
|
|
def seconds_to_str(t):
|
|
"""Format seconds to string"""
|
|
return "%d:%02d:%02d.%03d" % reduce(
|
|
lambda ll, b: divmod(ll[0], b) + ll[1:], [(t * 1000,), 1000, 60, 60]
|
|
)
|
|
|
|
|
|
def log(s):
|
|
"""Log line with optional time elapsed"""
|
|
print(f"{ULTRASINGER_HEAD} {seconds_to_str(process_time())} - {s}")
|
|
|
|
|
|
def end_log():
|
|
"""Log at program end"""
|
|
log("End Program")
|
|
|
|
|
|
atexit.register(end_log)
|
|
log("Initialized...")
|