Beispiel #1
0
  if args.cfg_file is not None:
    cfg_from_file(args.cfg_file)
  if args.set_cfgs is not None:
    cfg_from_list(args.set_cfgs)

  print('Using config:')
  pprint.pprint(cfg)
############################## begin #######################################
  # train set
#  imdb, roidb = combined_roidb(args.imdb_name)
  imdb = get_Imdbs(args.imdb_name)

  # total num_images
  total_num = imdb.num_images
  # initial num_images 
  initialnum = imdb[imdb.item_name(0)].num_images
  # unlabeled num_images 
  remainnum = imdb[imdb.item_name(1)].num_images

  print('total num:{}, initial num:{}'.format(total_num,initialnum)) 

  bitmapImdb = BitMap(total_num)
  
  roidb = get_training_roidb(imdb)

  print('{:d} roidb entries'.format(len(roidb)))

  # output directory where the models are saved
  output_dir = get_output_dir(imdb, args.tag)
  print('Output will be saved to `{:s}`'.format(output_dir))
    imdb = get_Imdbs(args.imdb_name)
    roidb = get_training_roidb(imdb)
    print '{:d} roidb entries'.format(len(roidb))

    output_dir = get_output_dir(imdb)
    print 'Output will be saved to `{:s}`'.format(output_dir)

    # some statistic to record
    alamount = 0
    ssamount = 0
    # set bitmap for AL
    tableA = BitMap(imdb.num_images)
    # choose initiail samples:VOC2007
    sample_num = imdb.num_images
    train_num = len(imdb[imdb.item_name(0)].roidb)
    print 'All VOC2007 images use for initial train, image numbers:%d' % (
        train_num)
    for i in range(train_num):
        tableA.set(i)

    train_roidb = [roidb[i] for i in range(train_num)]
    pretrained_model_name = args.pretrained_model

    # static parameters
    tao = 60000
    beta = 1000
    # updatable hypeparameters
    gamma = 0.6
    mylambda = np.array([-np.log(0.9)] * imdb.num_classes)
    # train record
Beispiel #3
0
######################## begin #############################

    imdb = get_Imdbs(args.imdb_name)
    roidb = get_training_roidb(imdb)
    print '{:d} roidb entries'.format(len(roidb))

    output_dir = get_output_dir(imdb)
    print 'Output will be saved to `{:s}`'.format(output_dir)

    # some statistic to record
    alamount = 0; ssamount = 0
    discardamount = 0
    # set bitmap for AL
    bitmapImdb = BitMap(imdb.num_images)
    # choose initiail samples:VOC2007
    initial_num = len(imdb[imdb.item_name(0)].roidb) 
    print 'All VOC2007 images use for initial train, image numbers:%d'%(initial_num)
    for i in range(initial_num):
        bitmapImdb.set(i)

    train_roidb = [roidb[i] for i in range(initial_num)]
    pretrained_model_name = args.pretrained_model

    # static parameters
    tao = args.max_iters
    # initial hypeparameters
    gamma = 0.15; clslambda = np.array([-np.log(0.9)]*imdb.num_classes)
    # train record
    loopcounter = 0; train_iters = 0; iters_sum = train_iters
    # control al proportion
    al_proportion_checkpoint = [int(x*initial_num) for x in np.linspace(0.3,2,10)]