Model Utilities


mltk.core.load_mltk_model(model, test=False, print_not_found_err=False, logger=None, reload=True)[source]

Find a MLTK model with the given name and instantiate its corresponding mltk.core.MltkModel object

  • model (str) – Name of MLTK model or path to MLTK model’s python specification script or archive. Append -test to the MLTK model name to load into “testing” mode (this is the same as setting the argument: test=True)

  • test (bool) – If the MLTK model should be loaded in “testing” mode

  • print_not_found_err – If true and the MLTK model is not found, then print an error

  • reload (bool) – If the given model is a python script then reload the module if necessary

Return type



Load model object


mltk.core.list_mltk_models(test=False, for_utests=False, logger=None)[source]

Return a list of all found MLTK model names

Return type



mltk.core.load_tflite_or_keras_model(model, model_type=None, weights=None, logger=None)[source]

Instantiate a Keras or TfliteModel object

IF model is an mltk.core.MltkModel instance OR a model archive, AND model_type is:

ELSE model should be the file path to a .tflite or .h5 model file.

Return type

Union[TfliteModel, Model]