mipcandy.inference#

Module Contents#

Classes#

Functions#

API#

mipcandy.inference.parse_predictant(x: mipcandy.types.SupportedPredictant, loader: type[mipcandy.data.Loader], *, as_label: bool = False) tuple[list[torch.Tensor], list[str] | None][source]#
class mipcandy.inference.Predictor(experiment_folder: str | os.PathLike[str], example_shape: mipcandy.types.AmbiguousShape, *, checkpoint: str = 'checkpoint_best.pth', device: mipcandy.types.Device = 'cpu')[source]#

Bases: mipcandy.layer.WithPaddingModule, mipcandy.layer.WithNetwork

Initialization

lazy_load_model() None[source]#
predict_image(image: torch.Tensor, *, batch: bool = False) torch.Tensor[source]#
_predict(x: mipcandy.types.SupportedPredictant | mipcandy.data.UnsupervisedDataset) tuple[list[torch.Tensor], list[str] | None][source]#
predict(x: mipcandy.types.SupportedPredictant | mipcandy.data.UnsupervisedDataset) list[torch.Tensor][source]#
static save_prediction(output: torch.Tensor, path: str | os.PathLike[str]) None[source]#
save_predictions(outputs: Sequence[torch.Tensor], folder: str | os.PathLike[str], *, filenames: Sequence[str | os.PathLike[str]] | None = None) None[source]#
predict_to_files(x: mipcandy.types.SupportedPredictant | mipcandy.data.UnsupervisedDataset, folder: str | os.PathLike[str]) list[str] | None[source]#
__call__(x: mipcandy.types.SupportedPredictant | mipcandy.data.UnsupervisedDataset) list[torch.Tensor][source]#