torch_em.util

Helper functionality for loading checkpoints and image data, network prediction, model export and more.

 1"""Helper functionality for loading checkpoints and image data, network prediction, model export and more.
 2"""
 3from .image import load_data, load_image, supports_memmap
 4from .memory import compute_max_batch_size, compute_max_patch_shape
 5from .reporting import get_training_summary
 6from .training import parser_helper
 7from .util import (
 8    auto_compile, ensure_array, ensure_spatial_array, ensure_tensor, ensure_tensor_with_channels,
 9    get_constructor_arguments, get_trainer, is_compiled, load_model, model_is_equal, ensure_patch_shape,
10    validate_roi
11)
12
13# NOTE: we don't import the modelzoo convenience functions here.
14# In order to avoid importing bioimageio.core (which is quite massive) when importing torch_em
15# and to enable running torch_em without bioimageio.core
16# from .modelzoo import (add_weight_formats,
17#                        convert_to_onnx,
18#                        convert_to_torchscript,
19#                        export_bioimageio_model,
20#                        export_parser_helper,
21#                        get_default_citations,
22#                        import_bioimageio_model)