def run():
    num_classes = 2
    image_shape = (160, 576)
    data_dir = './data'
    runs_dir = './runs'
    tests.test_for_kitti_dataset(data_dir)
    helper.maybe_download_pretrained_vgg(data_dir)
    epochs = 20
    batch_size = 5
    with tf.Session() as sess:
        vgg_path = os.path.join(data_dir, 'vgg')
        get_batches_fn = helper.gen_batch_function(os.path.join(data_dir, 'data_road/training'), image_shape)
        correct_label = tf.placeholder(tf.int32)
        learning_rate = tf.placeholder(tf.float32)
        (input_img, keep_prob, layer3_o, layer4_o, layer7_o) = load_vgg(sess, vgg_path)
        layer_output = layers(layer3_o, layer4_o, layer7_o, num_classes)
        (logits, train_op, cross_entropy_loss) = optimize(layer_output, correct_label, learning_rate, num_classes)
        train_nn(sess, epochs, batch_size, get_batches_fn, train_op, cross_entropy_loss, input_img, correct_label, keep_prob, learning_rate)
        helper.save_inference_samples(runs_dir, data_dir, sess, image_shape, logits, keep_prob, input_img)
def run():
    num_classes = 2
    image_shape = (160, 576)
    data_dir = './data'
    runs_dir = './runs'
    tests.test_for_kitti_dataset(data_dir)
    helper.maybe_download_pretrained_vgg(data_dir)
    epochs = 20
    batch_size = 5
    with tf.Session() as sess:
        vgg_path = os.path.join(data_dir, 'vgg')
        get_batches_fn = helper.gen_batch_function(os.path.join(data_dir, 'data_road/training'), image_shape)
        correct_label = tf.placeholder(tf.int32)
        learning_rate = tf.placeholder(tf.float32)
        (input_img, keep_prob, layer3_o, layer4_o, layer7_o) = load_vgg(sess, vgg_path)
        layer_output = layers(layer3_o, layer4_o, layer7_o, num_classes)
        (logits, train_op, cross_entropy_loss) = optimize(layer_output, correct_label, learning_rate, num_classes)
        train_nn(sess, epochs, batch_size, get_batches_fn, train_op, cross_entropy_loss, input_img, correct_label, keep_prob, learning_rate)
        helper.save_inference_samples(runs_dir, data_dir, sess, image_shape, logits, keep_prob, input_img)