当前位置: 首页>>代码示例>>Python>>正文


Python progressbar.AnimatedMarker方法代码示例

本文整理汇总了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) 
开发者ID:ubuntu,项目名称:microk8s,代码行数:22,代码来源:_windows.py

示例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 
开发者ID:shirosaidev,项目名称:diskover,代码行数:11,代码来源:diskover.py

示例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 
开发者ID:jackie840129,项目名称:STE-NVAN,代码行数:28,代码来源:cmc.py

示例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)) 
开发者ID:devgc,项目名称:EventMonkey,代码行数:28,代码来源:ProgressManager.py


注:本文中的progressbar.AnimatedMarker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。