MLModelData
class MLModelData
The MLModelData
class is a self-contained archive containing an MLModel
along with supplemental data that is useful to make predictions with the model.
Fetching Model Data
NatML provides a model hosting, delivery, inference, and analytics service called NatML Hub. INCOMPLETE.
Creating a Model
An MLModel
is created from model data. The model can then be used with a predictor to make predictions.
You must dispose
the model when you are done with it. Failing to do so will result in severe resource leaks.
Using Predictor Data
Model data contains additional information needed to make a prediction with a model.
Classification Labels
For classification and detection models, this field contains the list of class labels associated with each class in the output distribution. If class labels don't apply to the model, it will return undefined
.
Feature Normalization
Vision models often require that images be normalized to a specific mean and standard deviation. As such, MLModelData
provides a Normalization
object containing the per-channel normalization coefficients:
Image Aspect Mode
Vision models might require that input image features be scaled a certain way when they are resized to fit the model's input size. The aspectMode
can be passed directly to an MLImageFeature
.
Audio Format
Audio and speech models often require or produce audio data with a specific sample rate and channel count. As such, MLModelData
provides an AudioFormat
object containing the audio format description:
Last updated