sksurgerytf.callbacks.segmentation_history module

Module to implement callback to save an image, with segmentation.

class sksurgerytf.callbacks.segmentation_history.SegmentationHistory(tensor_board_dir, data, number_of_samples, desired_number_images)[source]

Bases: keras.callbacks.Callback

Class to implement Tensorboard callback to save a batch of images and their segmentations, so we can monitor progress directly in Tensorboard.

on_epoch_end(epoch, logs)[source]

Called at the end of each epoch, so we can log data. :param epoch: number of the epoch :param logs: logging info, see docs, currently unused.

save_to_tensorboard(npyfile, step)[source]

Write a set of images, in a format suitable for Tensorboard.

Parameters:
  • npyfile – block of data, see above method.
  • step – some int to indicate progress, e.g. batch number or epoch.