Python fast_rcnn.config.cfg.MODELS_DIR Examples

The following are 8 code examples of fast_rcnn.config.cfg.MODELS_DIR(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module fast_rcnn.config.cfg , or try the search function .
Example #1
Source File: train_faster_rcnn_alt_opt.py    From face-py-faster-rcnn with MIT License 6 votes vote down vote up
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.
# ------------------------------------------------------------------------------ 
Example #2
Source File: train_faster_rcnn_alt_opt.py    From faster-rcnn-resnet with MIT License 6 votes vote down vote up
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.
# ------------------------------------------------------------------------------ 
Example #3
Source File: train_faster_rcnn_alt_opt.py    From uai-sdk with Apache License 2.0 6 votes vote down vote up
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.
# ------------------------------------------------------------------------------ 
Example #4
Source File: train_faster_rcnn_alt_opt.py    From uai-sdk with Apache License 2.0 6 votes vote down vote up
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.
# ------------------------------------------------------------------------------ 
Example #5
Source File: train_faster_rcnn_alt_opt.py    From caffe-faster-rcnn-resnet-fpn with MIT License 6 votes vote down vote up
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.
# ------------------------------------------------------------------------------ 
Example #6
Source File: train_faster_rcnn_alt_opt.py    From py-R-FCN with MIT License 6 votes vote down vote up
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.
# ------------------------------------------------------------------------------ 
Example #7
Source File: train_rfcn_alt_opt_5stage.py    From uai-sdk with Apache License 2.0 5 votes vote down vote up
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 
Example #8
Source File: train_rfcn_alt_opt_5stage.py    From py-R-FCN with MIT License 5 votes vote down vote up
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