dacapo.predict

Attributes

logger

Functions

predict(run_name, iteration, input_container, ...[, ...])

Predict with a trained model.

Module Contents

dacapo.predict.logger
dacapo.predict.predict(run_name: str | dacapo.experiments.Run, iteration: int | None, input_container: upath.UPath | str, input_dataset: str, output_path: dacapo.store.local_array_store.LocalArrayIdentifier | upath.UPath | str, output_roi: funlib.geometry.Roi | str | None = None, num_workers: int = 1, output_dtype: numpy.dtype | str = np.uint8, overwrite: bool = True)

Predict with a trained model.

Parameters:
  • run_name (str or Run) – The name of the run to predict with or the Run object.

  • iteration (int or None) – The training iteration of the model to use for prediction.

  • input_container (Path | str) – The container of the input array.

  • input_dataset (str) – The dataset name of the input array.

  • output_path (LocalArrayIdentifier | str) – The path where the prediction array will be stored, or a LocalArryIdentifier for the prediction array.

  • output_roi (Optional[Roi | str], optional) – The ROI of the output array. If None, the ROI of the input array will be used. Defaults to None.

  • num_workers (int, optional) – The number of workers to use for blockwise prediction. Defaults to 1 for local processing, otherwise 12.

  • output_dtype (np.dtype | str, optional) – The dtype of the output array. Defaults to np.uint8.

  • overwrite (bool, optional) – If True, the output array will be overwritten if it already exists. Defaults to True.

Raises:

ValueError – If run_name is not found in config store

Examples

>>> predict("run_name", 100, "input.zarr", "raw", "output.zarr", output_roi="[0:100,0:100,0:100]")