FastSurferCNN.utils.misc

FastSurferCNN.utils.misc.check_path(path)[source]

Create path.

FastSurferCNN.utils.misc.find_latest_experiment(path)[source]

Find and load latest experiment.

Parameters:
pathstr

Path to the latest experiment.

Returns:
int

Latest experiments.

FastSurferCNN.utils.misc.plot_confusion_matrix(cm, classes, title='Confusion matrix', cmap=<matplotlib.colors.LinearSegmentedColormap object>, file_save_name='temp.pdf')[source]

Plot the confusion matrix.

Parameters:
cmnpt.NDArray

Confusion matrix.

classesList[str]

List of class names.

titlestr

(Default value = “Confusion matrix”).

cmapplt.cm.ColormapRegistry

Colour map (Default value = plt.cm.Blues).

file_save_namestr

(Default value = “temp.pdf”).

Returns:
figmatplotlib.figure.Figure

Matplotlib Figure object with the confusion matrix plot.

FastSurferCNN.utils.misc.plot_predictions(images_batch, labels_batch, batch_output, plt_title, file_save_name)[source]

Plot predictions from validation set.

Parameters:
images_batchtorch.Tensor

Batch of images.

labels_batchtorch.Tensor

Batch of labels.

batch_outputtorch.Tensor

Batch of output.

plt_titlestr

Plot title.

file_save_namestr

Name the plot should be saved tp.

FastSurferCNN.utils.misc.update_num_steps(dataloader, cfg)[source]

Update the number of steps.

Parameters:
dataloaderFastSurferCNN.data_loader.loader.DataLoader

The dataloader object that contains the training data.

cfgyacs.config.CfgNode

The configuration object that contains the training configuration.