cyto_dl.callbacks.image_saver module#

class cyto_dl.callbacks.image_saver.ImageSaver(save_dir: str | Path, save_every_n_epochs: int = 1, stages: List[str] = ['train', 'val'], save_input: bool = False)[source]#

Bases: Callback

Callback for saving images after postprocessing by eads.

Parameters:
  • save_dir (Union[str, Path]) – Directory to save images

  • save_every_n_epochs (int=1) – Frequency to save images

  • stages (List[str]=[“train”, “val”]) – Stages to save images

  • save_input (bool =False) – Whether to save input images

on_predict_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx=0)[source]#
on_test_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx=0)[source]#
on_train_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx=0)[source]#
on_validation_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx=0)[source]#
save(outputs, stage=None, step=None)[source]#