Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Aniket025
GitHub Repository: Aniket025/Medical-Prescription-OCR
Path: blob/master/Model-3/ocr/viz.py
426 views
1
from __future__ import print_function
2
3
def printProgressBar (iteration,
4
total,
5
prefix = '',
6
suffix = '',
7
decimals = 1,
8
length = 40,
9
fill = '*'):
10
"""
11
Call in a loop to create terminal progress bar
12
@params:
13
iteration - Required : current iteration (Int)
14
total - Required : total iterations (Int)
15
prefix - Optional : prefix string (Str)
16
suffix - Optional : suffix string (Str)
17
decimals - Optional : positive number of decimals in percent complete (Int)
18
length - Optional : character length of bar (Int)
19
fill - Optional : bar fill character (Str)
20
"""
21
iteration += 1
22
percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(total)))
23
filledLength = int(length * iteration // total)
24
bar = fill * filledLength + '-' * (length - filledLength)
25
print('\r%s |%s| %s%% %s' % (prefix, bar, percent, suffix), end = '\r')
26
27
if iteration == total:
28
print()
29
30