| title | featurizeImage function (MicrosoftML) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| description | Featurizes an image using a pre-trained deep neural network model (MicrosoftML). | |||||||||
| author | rothja | |||||||||
| ms.author | jroth | |||||||||
| ms.date | 07/15/2019 | |||||||||
| ms.service | sql | |||||||||
| ms.subservice | machine-learning | |||||||||
| ms.topic | reference | |||||||||
| keywords |
|
|||||||||
| monikerRange | >=sql-server-2016||>=sql-server-linux-ver15 |
Featurizes an image using a pre-trained deep neural network model.
featurizeImage(var, outVar = NULL, dnnModel = "Resnet18")
Input variable containing extracted pixel values.
The prefix of the output variables containing the image features. If null, the input variable name will be used. The default value is NULL.
The pre-trained deep neural network. The possible options are:
"resnet18""resnet50""resnet101""alexnet"
The default value is"resnet18". SeeDeep Residual Learning for Image Recognitionfor details about ResNet.
featurizeImage featurizes an image using the specified
pre-trained deep neural network model. The input variables to this transform must be extracted pixel values.
A maml object defining the transform.
Microsoft Corporation Microsoft Technical Support
train <- data.frame(Path = c(system.file("help/figures/RevolutionAnalyticslogo.png", package = "MicrosoftML")), Label = c(TRUE), stringsAsFactors = FALSE)
# Loads the images from variable Path, resizes the images to 1x1 pixels and trains a neural net.
model <- rxNeuralNet(
Label ~ Features,
data = train,
mlTransforms = list(
loadImage(vars = list(Features = "Path")),
resizeImage(vars = "Features", width = 1, height = 1, resizing = "Aniso"),
extractPixels(vars = "Features")
),
mlTransformVars = "Path",
numHiddenNodes = 1,
numIterations = 1)
# Featurizes the images from variable Path using the default model, and trains a linear model on the result.
model <- rxFastLinear(
Label ~ Features,
data = train,
mlTransforms = list(
loadImage(vars = list(Features = "Path")),
resizeImage(vars = "Features", width = 224, height = 224), # If dnnModel == "AlexNet", the image has to be resized to 227x227.
extractPixels(vars = "Features"),
featurizeImage(var = "Features")
),
mlTransformVars = "Path")