TFModelHub
This class provides methods for loading Keras models, its weights and ImageNet labels (for prediction purposes) to the local cacheDirectory.
Since
0.2
Parameters
cacheDirectory
The directory for all loaded models. It should be created before model loading and should have all required permissions for file writing/reading on your OS.
Constructors
TFModelHub
Link copied to clipboard
Functions
get
Link copied to clipboard
operator fun <T : InferenceModel, U : InferenceModel> get(modelType: ModelType<T, U>): U
Content copied to clipboard
loadClassLabels
Link copied to clipboard
Forms mapping of class label to class name for the ImageNet dataset.
loadModel
Link copied to clipboard
open override fun <T : InferenceModel, U : InferenceModel> loadModel(modelType: ModelType<T, U>, loadingMode: LoadingMode): T
Content copied to clipboard
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
Content copied to clipboard
Loads pretrained model of modelType from the ModelHub in loadingMode.
loadWeights
Link copied to clipboard
fun loadWeights(modelType: ModelType<*, *>, loadingMode: LoadingMode = LoadingMode.SKIP_LOADING_IF_EXISTS): HdfFile
Content copied to clipboard
Loads model weights.
Properties
cacheDirectory
Link copied to clipboard