bob.med.tb.engine.predictor

Functions

run(model, data_loader, name, device, …[, …])

Runs inference on input data, outputs HDF5 files with predictions

bob.med.tb.engine.predictor.run(model, data_loader, name, device, output_folder, grad_cams=False)[source]

Runs inference on input data, outputs HDF5 files with predictions

Parameters
  • model (torch.nn.Module) – neural network model (e.g. pasa)

  • data_loader (py:class:torch.torch.utils.data.DataLoader) –

  • name (str) – the local name of this dataset (e.g. train, or test), to be used when saving measures files.

  • device (str) – device to use cpu or cuda:0

  • output_folder (str) – folder where to store output prediction and model summary

  • grad_cams (bool) – if we export grad cams for every prediction (must be used along a batch size of 1 with the DensenetRS model)

Returns

all_predictions – All the predictions associated with filename and groundtruth

Return type

list