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


Python cfg.MODELS_DIR属性代码示例

本文整理汇总了Python中fast_rcnn.config.cfg.MODELS_DIR属性的典型用法代码示例。如果您正苦于以下问题:Python cfg.MODELS_DIR属性的具体用法?Python cfg.MODELS_DIR怎么用?Python cfg.MODELS_DIR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在fast_rcnn.config.cfg的用法示例。


在下文中一共展示了cfg.MODELS_DIR属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_solvers

# 需要导入模块: from fast_rcnn.config import cfg [as 别名]
# 或者: from fast_rcnn.config.cfg import MODELS_DIR [as 别名]
def get_solvers(net_name):
    # Faster R-CNN Alternating Optimization
    n = 'faster_rcnn_alt_opt'
    # Solver for each training stage
    solvers = [[net_name, n, 'stage1_rpn_solver60k80k.pt'],
               [net_name, n, 'stage1_fast_rcnn_solver30k40k.pt'],
               [net_name, n, 'stage2_rpn_solver60k80k.pt'],
               [net_name, n, 'stage2_fast_rcnn_solver30k40k.pt']]
    solvers = [os.path.join(cfg.MODELS_DIR, *s) for s in solvers]
    # Iterations for each training stage
    max_iters = [80000, 40000, 80000, 40000]
    # max_iters = [100, 100, 100, 100]
    # Test prototxt for the RPN
    rpn_test_prototxt = os.path.join(
        cfg.MODELS_DIR, net_name, n, 'rpn_test.pt')
    return solvers, max_iters, rpn_test_prototxt

# ------------------------------------------------------------------------------
# Pycaffe doesn't reliably free GPU memory when instantiated nets are discarded
# (e.g. "del net" in Python code). To work around this issue, each training
# stage is executed in a separate process using multiprocessing.Process.
# ------------------------------------------------------------------------------ 
开发者ID:playerkk,项目名称:face-py-faster-rcnn,代码行数:24,代码来源:train_faster_rcnn_alt_opt.py

示例2: get_solvers

# 需要导入模块: from fast_rcnn.config import cfg [as 别名]
# 或者: from fast_rcnn.config.cfg import MODELS_DIR [as 别名]
def get_solvers(imdb_name, net_name, model_name):
    # R-FCN Alternating Optimization
    # Solver for each training stage
    if imdb_name.startswith('coco'):
        solvers = [[net_name, model_name, 'stage1_rpn_solver360k480k.pt'],
                   [net_name, model_name, 'stage1_rfcn_ohem_solver360k480k.pt'],
                   [net_name, model_name, 'stage2_rpn_solver360k480k.pt'],
                   [net_name, model_name, 'stage2_rfcn_ohem_solver360k480k.pt'],
                   [net_name, model_name, 'stage3_rpn_solver360k480k.pt']]
        solvers = [os.path.join('.', 'models', 'coco', *s) for s in solvers]
        # Iterations for each training stage
        max_iters = [480000, 480000, 480000, 480000, 480000]
        # Test prototxt for the RPN
        rpn_test_prototxt = os.path.join(
            '.', 'models', 'coco', net_name, model_name, 'rpn_test.pt')
    else:
        solvers = [[net_name, model_name, 'stage1_rpn_solver60k80k.pt'],
                   [net_name, model_name, 'stage1_rfcn_ohem_solver80k120k.pt'],
                   [net_name, model_name, 'stage2_rpn_solver60k80k.pt'],
                   [net_name, model_name, 'stage2_rfcn_ohem_solver80k120k.pt'],
                   [net_name, model_name, 'stage3_rpn_solver60k80k.pt']]
        solvers = [os.path.join(cfg.MODELS_DIR, *s) for s in solvers]
        # Iterations for each training stage
        max_iters = [80000, 120000, 80000, 120000, 80000]
        # Test prototxt for the RPN
        rpn_test_prototxt = os.path.join(
            cfg.MODELS_DIR, net_name, model_name, 'rpn_test.pt')
    return solvers, max_iters, rpn_test_prototxt 
开发者ID:ucloud,项目名称:uai-sdk,代码行数:30,代码来源:train_rfcn_alt_opt_5stage.py


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