crumpets.workers.segmentation package

class crumpets.workers.segmentation.SegmentationWorker(image, target_image, image_params=None, target_image_params=None, image_rng=None, **kwargs)[source]

Bases: crumpets.workers.FCNWorker

Worker for image segmentation tasks. target_image_params defaults nearest neighbor interpolation, no supersampling, and to disable all pixel-based augmentations like brightness and color.

prepare(sample, batch, buffers)[source]

Implement this method to define the behavior of the BufferWorker subclass. Results must be written to buffers and/or batch object.

Parameters
  • sample – individual sample object to process

  • batch – the object the sample belongs to; append values to lists as necessary

  • buffers – output buffers to use for this sample