# Path: ldif/util/file_util.py
# def readlines(p):
# def readbin(p):
# def writebin(p, s):
# def writetxt(p, s):
# def write_np(path, arr):
# def read_grd(path):
# def read_sif_v1(path, verbose=False):
# def read_lines(p):
# def read_image(p):
# def read_npz(p):
# def read_np(p):
# def read_txt_to_np(p):
# def read_py2_pkl(p):
# def write_mesh(path, mesh):
# def read_mesh(path):
# def read_csv(path):
# def read_normals(path_to_dir, im_count=20, leading='_depth'):
# def write_points(path_ext_optional, points):
# def write_grd(path, volume, world2grid=None):
# def write_depth_image(path, depth_image):


from matplotlib import cm
from ldif.util.file_util import log
import numpy as np
import tensorflow as tf
  mean_max_weight = tf.reduce_mean(tf.reduce_max(five_dim_rbf, axis=1))
  tf.summary.scalar('%s-mean_max_rbf_weight' % dataset_split, mean_max_weight)
  peak_weight = tf.reduce_max(five_dim_rbf)
  tf.summary.scalar('%s-peak_rbf_weight' % dataset_split, peak_weight)
  mean_total_weight = tf.reduce_mean(tf.reduce_sum(five_dim_rbf, axis=1))
  tf.summary.scalar('%s-mean_total_rbf_weight' % dataset_split,
                    mean_total_weight)

  frac_of_biggest = tf.divide(
      tf.reduce_max(five_dim_rbf, axis=1), tf.reduce_sum(five_dim_rbf, axis=1))
  mean_frac_of_biggest = tf.reduce_mean(frac_of_biggest)
  tf.summary.scalar('%s-mean_plurality_frac' % dataset_split,
                    mean_frac_of_biggest)

  pixel_count_above_half_weight = tf.count_nonzero(
      five_dim_rbf > 0.5, axis=[2, 3, 4]) / (
          length * height * width)
  tf.summary.histogram('%s-pixel_count_above_half_weight' % dataset_split,
                       pixel_count_above_half_weight)
  pixel_count_above_tenth_weight = tf.count_nonzero(
      five_dim_rbf > 0.1, axis=[2, 3, 4]) / (
          length * height * width)
  tf.summary.histogram('%s-pixel_count_above_tenth_weight' % dataset_split,
                       pixel_count_above_tenth_weight)


# TODO(kgenova) Make a summarizer class that handles all this so the model
# config doesn't need to get passed over and over, and so that it's easy to
# deal with the tensorflow boilerplate.
def summarize_in_out_image(model_config, prediction):  # pylint:disable=unused-argument

# Path: ldif/util/file_util.py
# def readlines(p):
# def readbin(p):
# def writebin(p, s):
# def writetxt(p, s):
# def write_np(path, arr):
# def read_grd(path):
# def read_sif_v1(path, verbose=False):
# def read_lines(p):
# def read_image(p):
# def read_npz(p):
# def read_np(p):
# def read_txt_to_np(p):
# def read_py2_pkl(p):
# def write_mesh(path, mesh):
# def read_mesh(path):
# def read_csv(path):
# def read_normals(path_to_dir, im_count=20, leading='_depth'):
# def write_points(path_ext_optional, points):
# def write_grd(path, volume, world2grid=None):
# def write_depth_image(path, depth_image):


# Path: ldif/training/summarize.py
from matplotlib import cm
from ldif.util.file_util import log
import numpy as np
import tensorflow as tf

  mean_max_weight = tf.reduce_mean(tf.reduce_max(five_dim_rbf, axis=1))
  tf.summary.scalar('%s-mean_max_rbf_weight' % dataset_split, mean_max_weight)
  peak_weight = tf.reduce_max(five_dim_rbf)
  tf.summary.scalar('%s-peak_rbf_weight' % dataset_split, peak_weight)
  mean_total_weight = tf.reduce_mean(tf.reduce_sum(five_dim_rbf, axis=1))
  tf.summary.scalar('%s-mean_total_rbf_weight' % dataset_split,
                    mean_total_weight)

  frac_of_biggest = tf.divide(
      tf.reduce_max(five_dim_rbf, axis=1), tf.reduce_sum(five_dim_rbf, axis=1))
  mean_frac_of_biggest = tf.reduce_mean(frac_of_biggest)
  tf.summary.scalar('%s-mean_plurality_frac' % dataset_split,
                    mean_frac_of_biggest)

  pixel_count_above_half_weight = tf.count_nonzero(
      five_dim_rbf > 0.5, axis=[2, 3, 4]) / (
          length * height * width)
  tf.summary.histogram('%s-pixel_count_above_half_weight' % dataset_split,
                       pixel_count_above_half_weight)
  pixel_count_above_tenth_weight = tf.count_nonzero(
      five_dim_rbf > 0.1, axis=[2, 3, 4]) / (
          length * height * width)
  tf.summary.histogram('%s-pixel_count_above_tenth_weight' % dataset_split,
                       pixel_count_above_tenth_weight)


# TODO(kgenova) Make a summarizer class that handles all this so the model
# config doesn't need to get passed over and over, and so that it's easy to
# deal with the tensorflow boilerplate.
def summarize_in_out_image(model_config, prediction):  # pylint:disable=unused-argument

  log.info('In-out image summaries have been removed.')