help="Used only for the extraction task, the ratio of positive and negative samples, number of negtive samples = negative_ratio * number of positive samples")
Continuously print a progress bar with rotating special effects.
Args:
msg(str): Message to be printed.
interval(float): Rotation interval. Default to 0.1.
'''
end=False
def_printer():
index=0
flags=['\\','|','/','-']
whilenotend:
flag=flags[index%len(flags)]
withself.use_terminator('\r'):
self.info('{}: {}'.format(msg,flag))
time.sleep(interval)
index+=1
t=threading.Thread(target=_printer)
t.start()
yield
end=True
logger=Logger()
BAR_FORMAT=f'{{desc}}: {Fore.GREEN}{{percentage:3.0f}}%{Fore.RESET}{Fore.BLUE}{{bar}}{Fore.RESET}{Fore.GREEN}{{n_fmt}}/{{total_fmt}} {Fore.RED}{{rate_fmt}}{{postfix}}{Fore.RESET} eta {Fore.CYAN}{{remaining}}{Fore.RESET}'