예제 #1
0
def attach_roidb(imdb_names):
    """
    only implement single roidb now
    """
    roidbs = [get_roidb(s) for s in imdb_names.split('+')]
    roidb = roidbs[0]
    if len(roidbs) > 1:
        raise NotImplementedError
    else:
        imdb = get_imdb(imdb_names)
    return imdb, roidb
예제 #2
0
파일: roidb.py 프로젝트: 1165048017/MNC
def attach_roidb(imdb_names):
    """
    only implement single roidb now
    """
    roidbs = [get_roidb(s) for s in imdb_names.split('+')]
    roidb = roidbs[0]
    if len(roidbs) > 1:
        raise NotImplementedError
    else:
        imdb = get_imdb(imdb_names)
    return imdb, roidb
예제 #3
0
파일: maskdb.py 프로젝트: chagge/MNC
def attach_maskdb(imdb_names):
    """
    only implement single maskdb now
    """
    maskdbs = [get_maskdb(s) for s in imdb_names.split('+')]
    maskdb = maskdbs[0]
    if len(maskdbs) > 1:
        raise NotImplementedError
    else:
        imdb = get_imdb(imdb_names)
    return imdb, maskdb
예제 #4
0
def attach_maskdb(imdb_names):
    """
    only implement single maskdb now
    """
    maskdbs = [get_maskdb(s) for s in imdb_names.split('+')]
    maskdb = maskdbs[0]
    if len(maskdbs) > 1:
        raise NotImplementedError
    else:
        imdb = get_imdb(imdb_names)
    return imdb, maskdb
예제 #5
0
파일: maskdb.py 프로젝트: chagge/MNC
def get_maskdb(imdb_name):

    imdb = get_imdb(imdb_name)
    print 'Loaded dataset `{:s}` for training'.format(imdb.name)
    # Here set handler function. (e.g. gt_roidb in faster RCNN)
    imdb.set_roi_handler(cfg.TRAIN.PROPOSAL_METHOD)
    imdb.set_mask_handler(cfg.TRAIN.PROPOSAL_METHOD)
    print 'Set proposal method: {:s}'.format(cfg.TRAIN.PROPOSAL_METHOD)
    if cfg.TRAIN.USE_FLIPPED:
        print 'Appending horizontally-flipped training examples...'
        imdb.append_flipped_masks()
        print 'done'
    return imdb.maskdb
예제 #6
0
def get_maskdb(imdb_name):

    imdb = get_imdb(imdb_name)
    print 'Loaded dataset `{:s}` for training'.format(imdb.name)
    # Here set handler function. (e.g. gt_roidb in faster RCNN)
    imdb.set_roi_handler(cfg.TRAIN.PROPOSAL_METHOD)
    imdb.set_mask_handler(cfg.TRAIN.PROPOSAL_METHOD)
    print 'Set proposal method: {:s}'.format(cfg.TRAIN.PROPOSAL_METHOD)
    if cfg.TRAIN.USE_FLIPPED:
        print 'Appending horizontally-flipped training examples...'
        imdb.append_flipped_masks()
        print 'done'
    return imdb.maskdb
예제 #7
0
        sys.exit(1)

    return parser.parse_args()


if __name__ == '__main__':
    args = parse_args()

    print('Called with args:')
    print(args)

    if args.cfg_file is not None:
        cfg_from_file(args.cfg_file)

    cfg.GPU_ID = args.gpu_id

    print('Using config:')
    pprint.pprint(cfg)

    while not os.path.exists(args.caffemodel) and args.wait:
        print('Waiting for {} to exist...'.format(args.caffemodel))
        time.sleep(10)

    caffe.set_mode_gpu()
    caffe.set_device(args.gpu_id)

    imdb = get_imdb(args.imdb_name)
    _tester = TesterWrapper(args.prototxt, imdb, args.caffemodel,
                            args.task_name)
    _tester.get_result()
예제 #8
0
파일: test_net.py 프로젝트: chagge/MNC
        parser.print_help()
        sys.exit(1)

    return parser.parse_args()


if __name__ == '__main__':
    args = parse_args()

    print('Called with args:')
    print(args)

    if args.cfg_file is not None:
        cfg_from_file(args.cfg_file)

    cfg.GPU_ID = args.gpu_id

    print('Using config:')
    pprint.pprint(cfg)

    while not os.path.exists(args.caffemodel) and args.wait:
        print('Waiting for {} to exist...'.format(args.caffemodel))
        time.sleep(10)

    caffe.set_mode_gpu()
    caffe.set_device(args.gpu_id)

    imdb = get_imdb(args.imdb_name)
    _tester = TesterWrapper(args.prototxt, imdb, args.caffemodel, args.task_name)
    _tester.get_result()