Esempio n. 1
0
    args = parse_args()

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

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

    cfg_set_path(args.exp_dir)

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

    thresh = cfg_load_thresh(args.thresh_file)
    cfg_set_mode('Test', thresh)

    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)
    
    # full AZ-net
    net = caffe.Net(args.prototxt, args.caffemodel, caffe.TEST)
    net.name = os.path.splitext(os.path.basename(args.caffemodel))[0]
    # fc layers of AZ-Net
Esempio n. 2
0
    args = parser.parse_args()
    return 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_set_path(args.exp_dir)

    cfg_set_mode('Train')

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

    if not args.randomize:
        # fix the random seeds (numpy and caffe) for reproducibility
        np.random.seed(cfg.RNG_SEED)
        caffe.set_random_seed(cfg.RNG_SEED)
        
    if args.normalize:
        cfg.TRAIN.UN_NORMALIZE = True
    else:
        cfg.TRAIN.UN_NORMALIZE = False

    # set up caffe
Esempio n. 3
0
    args = parse_args()

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

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

    cfg_set_path(args.exp_dir)

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

    thresh = cfg_load_thresh(args.thresh_file)
    cfg_set_mode('Test', thresh)

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

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

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

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