# Path: dataset/pose_dataset.py
# class Batch(Enum):
#     inputs = 0
#     part_score_targets = 1
#     part_score_weights = 2
#     locref_targets = 3
#     locref_mask = 4
#     pairwise_targets = 5
#     pairwise_mask = 6
#     data_item = 7
# 
# Path: nnet/losses.py
# def huber_loss(labels, predictions, weight=1.0, k=1.0, scope=None):


import re
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.contrib.slim.nets import resnet_v1
from dataset.pose_dataset import Batch
from nnet import losses




net_funcs = {'resnet_50': resnet_v1.resnet_v1_50,
             'resnet_101': resnet_v1.resnet_v1_101}


def prediction_layer(cfg, input, name, num_outputs):
    with slim.arg_scope([slim.conv2d, slim.conv2d_transpose], padding='SAME',
                        activation_fn=None, normalizer_fn=None,
                        weights_regularizer=slim.l2_regularizer(cfg.weight_decay)):
        with tf.variable_scope(name):
            pred = slim.conv2d_transpose(input, num_outputs,
                                         kernel_size=[3, 3], stride=2,
                                         scope='block4')
            return pred


def get_batch_spec(cfg):
    num_joints = cfg.num_joints
    batch_size = cfg.batch_size
    batch_spec = {

# Path: dataset/pose_dataset.py
# class Batch(Enum):
#     inputs = 0
#     part_score_targets = 1
#     part_score_weights = 2
#     locref_targets = 3
#     locref_mask = 4
#     pairwise_targets = 5
#     pairwise_mask = 6
#     data_item = 7
# 
# Path: nnet/losses.py
# def huber_loss(labels, predictions, weight=1.0, k=1.0, scope=None):


# Path: nnet/pose_net.py
import re
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.contrib.slim.nets import resnet_v1
from dataset.pose_dataset import Batch
from nnet import losses





net_funcs = {'resnet_50': resnet_v1.resnet_v1_50,
             'resnet_101': resnet_v1.resnet_v1_101}


def prediction_layer(cfg, input, name, num_outputs):
    with slim.arg_scope([slim.conv2d, slim.conv2d_transpose], padding='SAME',
                        activation_fn=None, normalizer_fn=None,
                        weights_regularizer=slim.l2_regularizer(cfg.weight_decay)):
        with tf.variable_scope(name):
            pred = slim.conv2d_transpose(input, num_outputs,
                                         kernel_size=[3, 3], stride=2,
                                         scope='block4')
            return pred


def get_batch_spec(cfg):
    num_joints = cfg.num_joints
    batch_size = cfg.batch_size
    batch_spec = {

        Batch.inputs: [batch_size, None, None, 3],