image_classifier_3d.utils package

Submodules

image_classifier_3d.utils.misc_utils module

image_classifier_3d.utils.misc_utils.mix_collate(batch)[source]

A util function for handling data when images in each mini-batch have different sizes. Conventionally, all images in each mini-batch during training should have the same size. This is a work-around. Inspired by https://discuss.pytorch.org/t/how-to-create-a-dataloader-with-variable-size-input/8278/3 # noqa E501

image_classifier_3d.utils.quilt_utils module

class image_classifier_3d.utils.quilt_utils.QuiltModelZoo[source]

Bases: object

connect to model zoo on quilt3

download_model(model_name: str, save_path: Union[str, pathlib.Path] = './zoo/model.pth')[source]

download the model “model_name” to “out_path”

Paremeters — model_name: str

the name of the model to be downloaded

save_path: Union(str, Path)

the path to save the model, default is ‘./zoo/model.pth’

peak_all_models() → List[source]

print out names of existing models in the model zoo

image_classifier_3d.utils.quilt_utils.validate_model(config, hparams, save_path)[source]

validate the model configuration parameters, for model path, model files will be downloaded from quilt if not exist

config:

a dictionary of key parameters

hparams:

a Namespace object similar to config (currently redudent, will be improved in future versions)

save_path:

if the required models are not found in the save_path, model files will be downloaded to save_path

Module contents