Ejemplo n.º 1
0
    print('{:d} validation roidb entries'.format(len(valroidb)))
    cfg.TRAIN.USE_FLIPPED = orgflip
    cfg.TRAIN.USE_NOISE_AUG = orgnoise
    cfg.TRAIN.USE_JPG_AUG = orgjpg

    # load network
    if args.net == 'inception_v3':
        net = []
    elif args.net == 'vgg16':
        net = vgg16(batch_size=cfg.TRAIN.IMS_PER_BATCH)
    elif args.net == 'vgg16_noise':
        net = vgg16_noise(batch_size=cfg.TRAIN.IMS_PER_BATCH)
    elif args.net == 'res50':
        net = resnetv1(batch_size=cfg.TRAIN.IMS_PER_BATCH, num_layers=50)
    elif args.net == 'res50_noise':
        net = resnet_noise(batch_size=cfg.TRAIN.IMS_PER_BATCH, num_layers=50)
    elif args.net == 'res101':
        net = resnetv1(batch_size=cfg.TRAIN.IMS_PER_BATCH, num_layers=101)
    elif args.net == 'res101_noise':
        net = resnet_noise(batch_size=cfg.TRAIN.IMS_PER_BATCH, num_layers=101)
    elif args.net == 'res101_noise_init':
        net = resnet_noise_init(batch_size=cfg.TRAIN.IMS_PER_BATCH,
                                num_layers=101)
    elif args.net == 'res101_fusion':
        net = resnet_fusion(batch_size=cfg.TRAIN.IMS_PER_BATCH, num_layers=101)
    elif args.net == 'res101_fusion_2rpn':
        net = resnet_fusion_2rpn(batch_size=cfg.TRAIN.IMS_PER_BATCH,
                                 num_layers=101)
    elif args.net == 'res101_fusion_2rpn_sep':
        net = resnet_fusion_2rpn_sep(batch_size=cfg.TRAIN.IMS_PER_BATCH,
                                     num_layers=101)
Ejemplo n.º 2
0
    imdb.competition_mode(args.comp_mode)

    tfconfig = tf.ConfigProto(allow_soft_placement=True)
    tfconfig.gpu_options.allow_growth = True

    # init session
    sess = tf.Session(config=tfconfig)
    # load network
    if args.net == 'vgg16':
        net = vgg16(batch_size=1)
    elif args.net == 'res50':
        net = resnetv1(batch_size=1, num_layers=50)
    elif args.net == 'res101':
        net = resnetv1(batch_size=1, num_layers=101)
    elif args.net == 'res101_noise':
        net = resnet_noise(batch_size=1, num_layers=101)
    elif args.net == 'res101_noise_init':
        net = resnet_noise_init(batch_size=1, num_layers=101)
    elif args.net == 'res101_fusion':
        net = resnet_fusion(batch_size=1, num_layers=101)
    elif args.net == 'res101_fusion_noise':
        net = resnet_fusion_noise(batch_size=1, num_layers=101)
    elif args.net == 'res152':
        net = resnetv1(batch_size=1, num_layers=152)
    else:
        raise NotImplementedError

    # load model
    net.create_architecture(sess,
                            "TEST",
                            imdb.num_classes,