ModelType

interface ModelType<T : InferenceModel, U : InferenceModel>

Basic interface for models loaded from S3.

Parameters

T

the type of the basic model for common functionality.

U

the type of the pre-trained model for usage in Easy API.

Functions

model
Link copied to clipboard
open fun model(modelHub: ModelHub): T

Loads the model, identified by this name, from the modelHub.

preInit
Link copied to clipboard
open fun preInit(): InferenceModel
preprocessInput
Link copied to clipboard
open fun preprocessInput(imageFile: File, preprocessing: Preprocessing): FloatArray
abstract fun preprocessInput(data: FloatArray, tensorShape: LongArray): FloatArray

Common preprocessing function for the Neural Networks trained on ImageNet and whose weights are available with the keras.application.

pretrainedModel
Link copied to clipboard
abstract fun pretrainedModel(modelHub: ModelHub): U

Returns the specially prepared pre-trained model of the type U.

Properties

channelsFirst
Link copied to clipboard
abstract val channelsFirst: Boolean

If true it means that the second dimension is related to number of channels in image has short notation as NCWH, otherwise, channels are at the last position and has a short notation as NHWC.

modelRelativePath
Link copied to clipboard
abstract val modelRelativePath: String

Relative path to model for local and S3 buckets storages.

Inheritors

TFModels
Link copied to clipboard