本文整理汇总了Python中progressbar.AnimatedMarker方法的典型用法代码示例。如果您正苦于以下问题:Python progressbar.AnimatedMarker方法的具体用法?Python progressbar.AnimatedMarker怎么用?Python progressbar.AnimatedMarker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类progressbar
的用法示例。
在下文中一共展示了progressbar.AnimatedMarker方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_progress_bar
# 需要导入模块: import progressbar [as 别名]
# 或者: from progressbar import AnimatedMarker [as 别名]
def _init_progress_bar(total_length, destination, message=None):
if not message:
message = "Downloading {!r}".format(os.path.basename(destination))
valid_length = total_length and total_length > 0
if valid_length and is_dumb_terminal():
widgets = [message, " ", Percentage()]
maxval = total_length
elif valid_length and not is_dumb_terminal():
widgets = [message, Bar(marker="=", left="[", right="]"), " ", Percentage()]
maxval = total_length
elif not valid_length and is_dumb_terminal():
widgets = [message]
maxval = UnknownLength
else:
widgets = [message, AnimatedMarker()]
maxval = UnknownLength
return ProgressBar(widgets=widgets, maxval=maxval)
示例2: progress_bar
# 需要导入模块: import progressbar [as 别名]
# 或者: from progressbar import AnimatedMarker [as 别名]
def progress_bar(event):
if event == 'Checking' or event == 'Calculating':
widgets = [progressbar.AnimatedMarker(), ' ', event + ' (Queue: ', progressbar.Counter(), ') ', progressbar.Timer()]
bar = progressbar.ProgressBar(widgets=widgets, max_value=progressbar.UnknownLength)
else:
widgets = [event + ' ', progressbar.Bar(), progressbar.Percentage(),
' (', progressbar.Timer(), ', ', progressbar.ETA(), ')']
bar = progressbar.ProgressBar(widgets=widgets, max_value=100)
return bar
示例3: Cmc
# 需要导入模块: import progressbar [as 别名]
# 或者: from progressbar import AnimatedMarker [as 别名]
def Cmc(q_data, g_data, rank_size):
n_query = q_data['feature'].shape[0]
n_gallery = g_data['feature'].shape[0]
dist = np_cdist(q_data['feature'], g_data['feature']) # Reture a n_query*n_gallery array
cmc = np.zeros((n_query, rank_size))
ap = np.zeros(n_query)
widgets = ["I'm calculating cmc! ", AnimatedMarker(markers='←↖↑↗→↘↓↙'), ' (', Percentage(), ')']
pbar = ProgressBar(widgets=widgets, max_value=n_query)
for k in range(n_query):
good_idx = np.where((q_data['id'][k]==g_data['id']) & (q_data['cam'][k]!=g_data['cam']))[0]
junk_mask1 = (g_data['id'] == -1)
junk_mask2 = (q_data['id'][k]==g_data['id']) & (q_data['cam'][k]==g_data['cam'])
junk_idx = np.where(junk_mask1 | junk_mask2)[0]
score = dist[k, :]
sort_idx = np.argsort(score)
sort_idx = sort_idx[:rank_size]
ap[k], cmc[k, :] = Compute_AP(good_idx, junk_idx, sort_idx)
pbar.update(k)
pbar.finish()
CMC = np.mean(cmc, axis=0)
mAP = np.mean(ap)
return CMC, mAP
示例4: __init__
# 需要导入模块: import progressbar [as 别名]
# 或者: from progressbar import AnimatedMarker [as 别名]
def __init__(self,interface_type,count=None,description=None):
self.interface_type = interface_type
self.current_value = 0
if self.interface_type == Config.UI_CLI:
widgets = []
if description is not None:
widgets.append('{}: '.format(description))
if count is not None:
widgets.append(Percentage())
widgets.append(' ')
widgets.append(Bar())
else:
widgets.append(Counter())
widgets.append(' ')
widgets.append(AnimatedMarker(markers='.oO@* '))
if count is not None:
self.progressBar = ProgressBar(widgets=widgets, max_value=count)
else:
self.progressBar = ProgressBar(max_value=progressbar.UnknownLength,widgets=widgets)
else:
PROGRESS_LOGGER.error('interface type not handled: {}'.format(self.interface_type))
raise Exception('interface type not handled: {}'.format(self.interface_type))