Share via


featurizeImage: 기계 학습 이미지 기능화 변환

미리 학습된 심층 신경망 모델을 사용하여 이미지를 특성화합니다.

사용

  featurizeImage(var, outVar = NULL, dnnModel = "Resnet18")

인수

var

추출된 픽셀 값을 포함하는 입력 변수.

outVar

이미지 기능을 포함하는 출력 변수의 접두사입니다. Null인 경우 입력 변수 이름이 사용됩니다. 기본값은 NULL입니다.

dnnModel

미리 학습된 심층 신경망. 가능한 옵션은 아래와 같습니다.

세부 정보

featurizeImage는 지정되어 미리 학습된 심층 신경망 모델을 사용하여 이미지를 기능화합니다. 이 변환에 대한 입력 변수는 추출된 픽셀 값이어야 합니다.

변환을 정의하는 maml 개체입니다.

작성자

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")