# Path: utils/camvid.py
# IMAGE_HEIGHT = 720
# IMAGE_WIDTH = 960
# IMAGE_DEPTH = 3
# NUM_CLASSES = 32
# NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = 580
# NUM_EXAMPLES_PER_EPOCH_FOR_TEST = 580
# NUM_EXAMPLES_PER_EPOCH_FOR_EVAL = 580
# def _generate_image_and_label_batch(image, label, min_queue_examples,
#                                     batch_size, shuffle):
# def CamVid_reader_seq(filename_queue, seq_length):
# def CamVid_reader(filename_queue):
# def get_filename_list(path):
# def CamVidInputs(image_filenames, label_filenames, batch_size, shuffle=True):


import os
import tensorflow as tf
from utils import camvid
from scipy import misc
    [192, 192, 0],  # VegetationMisc
    [0, 0, 0],  # Void
    [64, 192, 0]  # Wall
]


def color_mask(tensor, color):
    return tf.reduce_all(tf.equal(tensor, color), 3)


def one_hot(labels):
    color_tensors = tf.unstack(colors)
    channel_tensors = list(map(lambda color: color_mask(labels, color), color_tensors))
    one_hot_labels = tf.cast(tf.stack(channel_tensors, 3), 'float32')
    return one_hot_labels


def rgb(logits):
    softmax = tf.nn.softmax(logits)
    argmax = tf.argmax(softmax, 3)
    color_map = tf.constant(colors, dtype=tf.float32)
    n = color_map.get_shape().as_list()[0]
    one_hot = tf.one_hot(argmax, n, dtype=tf.float32)
    one_hot_matrix = tf.reshape(one_hot, [-1, n])
    rgb_matrix = tf.matmul(one_hot_matrix, color_map)
    rgb_tensor = tf.reshape(rgb_matrix, [-1, IMAGE_HEIGHT, IMAGE_WIDTH, 3])
    return tf.cast(rgb_tensor, tf.float32)


def main(_):

# Path: utils/camvid.py
# IMAGE_HEIGHT = 720
# IMAGE_WIDTH = 960
# IMAGE_DEPTH = 3
# NUM_CLASSES = 32
# NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = 580
# NUM_EXAMPLES_PER_EPOCH_FOR_TEST = 580
# NUM_EXAMPLES_PER_EPOCH_FOR_EVAL = 580
# def _generate_image_and_label_batch(image, label, min_queue_examples,
#                                     batch_size, shuffle):
# def CamVid_reader_seq(filename_queue, seq_length):
# def CamVid_reader(filename_queue):
# def get_filename_list(path):
# def CamVidInputs(image_filenames, label_filenames, batch_size, shuffle=True):


# Path: self_driving/segnet/evaluate.py
import os
import tensorflow as tf
from utils import camvid
from scipy import misc

    [192, 192, 0],  # VegetationMisc
    [0, 0, 0],  # Void
    [64, 192, 0]  # Wall
]


def color_mask(tensor, color):
    return tf.reduce_all(tf.equal(tensor, color), 3)


def one_hot(labels):
    color_tensors = tf.unstack(colors)
    channel_tensors = list(map(lambda color: color_mask(labels, color), color_tensors))
    one_hot_labels = tf.cast(tf.stack(channel_tensors, 3), 'float32')
    return one_hot_labels


def rgb(logits):
    softmax = tf.nn.softmax(logits)
    argmax = tf.argmax(softmax, 3)
    color_map = tf.constant(colors, dtype=tf.float32)
    n = color_map.get_shape().as_list()[0]
    one_hot = tf.one_hot(argmax, n, dtype=tf.float32)
    one_hot_matrix = tf.reshape(one_hot, [-1, n])
    rgb_matrix = tf.matmul(one_hot_matrix, color_map)
    rgb_tensor = tf.reshape(rgb_matrix, [-1, IMAGE_HEIGHT, IMAGE_WIDTH, 3])
    return tf.cast(rgb_tensor, tf.float32)


def main(_):

    test_image_filenames, test_label_filenames = camvid.get_filename_list(test_dir)