hand_crop=True,
                         use_wrist_coord=False,
                         coord_uv_noise=True,
                         crop_center_noise=True,
                         crop_offset_noise=True,
                         crop_scale_noise=True)

# build network graph
data = dataset.get()

# build network
net = PoseEstimationNetwork()

# feed trough network
evaluation = tf.placeholder_with_default(True, shape=())
_, coord3d_pred, R = net.Pose3DNet(data['scoremap'], data['hand_side'],
                                   evaluation)

# Start TF
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.8)
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))
tf.train.start_queue_runners(sess=sess)

# Loss
loss = 0.0

loss += tf.reduce_mean(tf.square(coord3d_pred - data['keypoint_xyz21_can']))
loss += tf.reduce_mean(tf.square(R - data['rot_mat']))

# Solver
global_step = tf.Variable(0, trainable=False, name="global_step")
lr_scheduler = LearningRateScheduler(values=train_para['lr'],
# get dataset
# dataset = BinaryDbReader(mode='evaluation', shuffle=False, use_wrist_coord=False)
dataset = BinaryDbReaderSTB(mode='evaluation',
                            shuffle=False,
                            use_wrist_coord=False)

# build network graph
data = dataset.get()
image_scaled = tf.image.resize_images(data['image'], (240, 320))

# build network
net = PoseEstimationNetwork()

# feed through network
evaluation = tf.placeholder_with_default(True, shape=())
_, _, _, _, _, coord3d_pred = net.Pose3DNet(image_scaled, data['hand_side'],
                                            evaluation)
coord3d_gt = data['keypoint_xyz21']

# Start TF
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.8)
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))
tf.train.start_queue_runners(sess=sess)

# initialize network with weights used in the paper
net.init(sess,
         weight_files=[
             './weights/handsegnet-rhd.pickle',
             './weights/posenet3d-rhd-stb.pickle'
         ])

util = EvalUtil()