コード例 #1
0
ファイル: od_utils.py プロジェクト: thomasshupeng/TNC_FRCNN
def train_object_detector(cfg):
    """
    Trains an object detector as specified in the configuration
    :param cfg: the configuration
    :return: the eval model of the trained detector
    """

    detector_name = _get_detector_name(cfg)
    eval_model = None
    if cfg["CNTK"].MAKE_MODE:
        print("loading {}".format(detector_name))
    else:
        print("training {}".format(detector_name))
    if detector_name == 'FastRCNN':
        from FastRCNN.FastRCNN_train import prepare, train_fast_rcnn
        prepare(cfg, use_arg_parser=False)
        eval_model = train_fast_rcnn(cfg)
    elif detector_name == 'FasterRCNN':
        from FasterRCNN.FasterRCNN_train import prepare, train_faster_rcnn
        prepare(cfg, use_arg_parser=False)
        eval_model = train_faster_rcnn(cfg)
    else:
        print('Unknown detector: {}'.format(detector_name))

    return eval_model
コード例 #2
0
def prepareOnly_object_detector(cfg):
    detector_name = _get_detector_name(cfg)
    print("preparing {}".format(detector_name))
    if detector_name == 'FastRCNN':
        from FastRCNN.FastRCNN_train import prepare, train_fast_rcnn
        prepare(cfg, use_arg_parser=False)
    elif detector_name == 'FasterRCNN':
        from FasterRCNN.FasterRCNN_train import prepare, train_faster_rcnn
        prepare(cfg, use_arg_parser=False)
    else:
        print('Unknown detector: {}'.format(detector_name))
コード例 #3
0
ファイル: od_utils.py プロジェクト: AllanYiin/CNTK
def train_object_detector(cfg):
    """
    Trains an object detector as specified in the configuration
    :param cfg: the configuration
    :return: the eval model of the trained detector
    """

    detector_name = _get_detector_name(cfg)
    eval_model = None
    print("training {}".format(detector_name))
    if detector_name == 'FastRCNN':
        from FastRCNN.FastRCNN_train import prepare, train_fast_rcnn
        prepare(cfg, use_arg_parser=False)
        eval_model = train_fast_rcnn(cfg)
    elif detector_name == 'FasterRCNN':
        from FasterRCNN.FasterRCNN_train import prepare, train_faster_rcnn
        prepare(cfg, use_arg_parser=False)
        eval_model = train_faster_rcnn(cfg)
    else:
        print('Unknown detector: {}'.format(detector_name))

    return eval_model