pretrained_model = False #pretrained_model = False test_dir = './alhpamatting' test_outdir = './test_predict' #validation_dir = '/data/gezheng/data-matting/new2/validation' #pretrained_vgg_model_path model_path = './vgg16_weights.npz' log_dir = 'matting_log' dataset_alpha = 'train_data/alpha' dataset_eps = 'train_data/eps' dataset_BG = 'train_data/bg' paths_alpha, paths_eps, paths_BG = load_path(dataset_alpha, dataset_eps, dataset_BG, hard_mode=hard_mode) range_size = len(paths_alpha) print('range_size is %d' % range_size) #range_size/batch_size has to be int batchs_per_epoch = int(range_size / train_batch_size) index_queue = tf.train.range_input_producer(range_size, num_epochs=None, shuffle=True, seed=None, capacity=32) index_dequeue_op = index_queue.dequeue_many(train_batch_size, 'index_dequeue') image_batch = tf.placeholder(tf.float32,
import os from scipy import misc image_size = 320 batch_size = 25 max_epochs = 1000000 #pretrained_vgg_model_path model_path = './vgg16_weights.npz' log_dir = './tensor_log' dataset_RGB = '/data/gezheng/data-matting/new/comp_RGB' dataset_alpha = '/data/gezheng/data-matting/new/alpha_final' dataset_FG = '/data/gezheng/data-matting/new/FG_final' dataset_BG = '/data/gezheng/data-matting/new/BG' paths_RGB,paths_alpha,paths_FG,paths_BG = load_path(dataset_RGB,dataset_alpha,dataset_FG,dataset_BG) range_size = len(paths_RGB) #range_size/batch_size has to be int batchs_per_epoch = int(range_size/batch_size) index_queue = tf.train.range_input_producer(range_size, num_epochs=None,shuffle=True, seed=None, capacity=32) index_dequeue_op = index_queue.dequeue_many(batch_size, 'index_dequeue') image_batch = tf.placeholder(tf.float32, shape=(batch_size,image_size,image_size,3)) GT_matte_batch = tf.placeholder(tf.float32, shape = (batch_size,image_size,image_size,1)) GT_trimap = tf.placeholder(tf.float32, shape = (batch_size,image_size,image_size,1)) GTBG_batch = tf.placeholder(tf.float32, shape = (batch_size,image_size,image_size,3)) GTFG_batch = tf.placeholder(tf.float32, shape = (batch_size,image_size,image_size,3)) is_train = tf.placeholder(tf.bool, name = 'is_train') en_parameters = []