liom_toolkit.segmentation.vseg.validation module

liom_toolkit.segmentation.vseg.validation.show_diff(mask: ndarray, prediction: ndarray, output_path: str, id: str, acq: str) None

Show the difference between the mask and the prediction. - Black: TN - Red: FP - Blue: FN - White: TP

Parameters:
  • mask (np.ndarray) – The mask

  • prediction (np.ndarray) – The prediction

  • output_path (str) – The output path

  • id (str) – The id of the image

  • acq (str) – The acquisition of the image

Returns:

None

liom_toolkit.segmentation.vseg.validation.validate_model(model: VsegModel, img_list: list[ndarray], save_path: str, device: str) None

Validate a model on a list of images.

Parameters:
  • model (VsegModel) – The model to validate

  • img_list (list[np.ndarray]) – list of image paths to validate. The mask has to be in the same folder

  • save_path (str) – The path to save the results

  • device (str) – The device to use for prediction

Returns:

None