Esempio n. 1
0
    elif dataset_name == 'test' or dataset_name == 'test_blur':
        loadpath_dict = basedir + "..\\datasets\\preprocessed_HIG\\dataset_dict_" + dataset_name + ".pickle"

    with open(loadpath_dict, 'rb') as f:
        dataset_load = pickle.load(f)

    ##--bag of fingertip position
    fingertip = {}
    fingertip['hpe1_orig'] = []
    fingertip['hig_hpe1'] = []
    fingertip['hpe2'] = []
    fingertip['hpe1_blur'] = []
    fingertip['average'] = []

    #--start
    fusionnet.set_mode('eval')
    ir_batch = np.zeros((1, 1, args.trainImageSize, args.trainImageSize),
                        dtype=np.float32)
    depth_batch = np.zeros((1, 1, args.trainImageSize, args.trainImageSize),
                           dtype=np.float32)

    vis = Visualize_combined_outputs(utils, 4, 1, camerawidth, cameraheight)

    progressbar = trange(data_num, leave=True)
    for i in progressbar:
        #for i in range(data_num):
        frame = i
        ##--input
        if dataset_name == 'v1':
            depth_orig = cv2.imread(
                load_filepath_imgs + 'depth-%07d.png' % frame, 2)
Esempio n. 2
0
    f.write('traindataNum_VR20:%s\n' % traindataNum_vr20)
    f.write('validateNum_uvr:%s\n' % validateNum)
    f.close()

    #--start
    progress_train = progress.Progress(loss_names, pretrain=False)
    progress_validate = progress.Progress(loss_names, pretrain=False)

    iternum_train = traindataNum_uvr // args.train_batch
    iternum_train_blur = traindataNum_blur_uvr // args.train_batch
    iternum_vr20 = traindataNum_vr20 // args.train_batch
    print('start..')

    for epoch in range(args.epochs):
        #--train
        fusionnet.set_mode('train')

        datasetloader_uvr['train'].shuffle()

        generator_train_icvl = datasetloader_icvl.generator_learningData(
            args.train_batch, 'train', False, 0)

        #trange_num=traindataNum_uvr//args.train_batch + traindataNum_blur_uvr//args.train_batch +traindataNum_vr20//args.train_batch
        if traindataNum_vr20 > 0:
            trange_num = 2 * traindataNum_vr20 // args.train_batch
        else:
            trange_num = traindataNum_uvr // args.train_batch

        progressbar = trange(trange_num, leave=True)
        for i in progressbar:
            #select dataset