ModelHub

abstract class ModelHub(cacheDirectory: File)

This is an abstract class which provides methods for loading models, its weights and labels (for prediction purposes) to the local cacheDirectory.

Since

0.2

Constructors

ModelHub
Link copied to clipboard
fun ModelHub(cacheDirectory: File)

Functions

get
Link copied to clipboard
operator fun <T : InferenceModel, U : InferenceModel> get(modelType: ModelType<T, U>): U
loadModel
Link copied to clipboard
abstract fun <T : InferenceModel, U : InferenceModel> loadModel(modelType: ModelType<T, U>, loadingMode: LoadingMode = LoadingMode.SKIP_LOADING_IF_EXISTS): T

Loads model configuration without weights.

loadPretrainedModel
Link copied to clipboard
fun <T : InferenceModel, U : InferenceModel> loadPretrainedModel(modelType: ModelType<T, U>, loadingMode: LoadingMode = LoadingMode.SKIP_LOADING_IF_EXISTS): U

Loads pretrained model of modelType from the ModelHub in loadingMode.

Properties

cacheDirectory
Link copied to clipboard
val cacheDirectory: File

The directory for all loaded models and datasets. It should be created before model loading and should have all required permissions for file writing/reading on your OS.

Inheritors

TFModelHub
Link copied to clipboard