tf_unet Package

unet Module

image_util Module

util Module

Created on Aug 10, 2016

author: jakeret

tf_unet.util.combine_img_prediction(data, gt, pred)[source]

Combines the data, grouth thruth and the prediction into one rgb image

Parameters:
  • data – the data tensor
  • gt – the ground thruth tensor
  • pred – the prediction tensor
Returns img:

the concatenated rgb image

tf_unet.util.crop_to_shape(data, shape)[source]

Crops the array to the given image shape by removing the border (expects a tensor of shape [batches, nx, ny, channels].

Parameters:
  • data – the array to crop
  • shape – the target shape
tf_unet.util.plot_prediction(x_test, y_test, prediction, save=False)[source]
tf_unet.util.save_image(img, path)[source]

Writes the image to disk

Parameters:
  • img – the rgb image to save
  • path – the target path
tf_unet.util.to_rgb(img)[source]

Converts the given array into a RGB image. If the number of channels is not 3 the array is tiled such that it has 3 channels. Finally, the values are rescaled to [0,255)

Parameters:img – the array to convert [nx, ny, channels]
Returns img:the rgb image [nx, ny, 3]

layers Module

Created on Aug 19, 2016

author: jakeret

tf_unet.layers.bias_variable(shape)[source]
tf_unet.layers.conv2d(x, W, keep_prob_)[source]
tf_unet.layers.crop_and_concat(x1, x2)[source]
tf_unet.layers.cross_entropy(y_, output_map)[source]
tf_unet.layers.deconv2d(x, W, stride)[source]
tf_unet.layers.max_pool(x, n)[source]
tf_unet.layers.pixel_wise_softmax(output_map)[source]
tf_unet.layers.pixel_wise_softmax_2(output_map)[source]
tf_unet.layers.weight_variable(shape, stddev=0.1)[source]
tf_unet.layers.weight_variable_devonc(shape, stddev=0.1)[source]