Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. const int ImageHeight = 224;
  2. const int ImageWidth = 224;
  3.  
  4. var pipeline = new ImageLoadingEstimator(_mlContext, string.Empty, ("ImageData", "ImagePath"))
  5. .Append(_mlContext.Transforms.Resize("ImageResized", imageWidth: ImageWidth, imageHeight: ImageHeight, inputColumnName: "ImageData"))
  6. .Append(_mlContext.Transforms.ExtractPixels(new ColumnInfo("input", "ImageResized", colors: ColorBits.Rgb, interleave:true, asFloat: true, offset: 128f, scale: 1 /255f)))
  7. .Append(new TensorFlowEstimator(_mlContext, new string[] { @"MobilenetV2/Predictions/Reshape_1" }, new string[] { "input" }, _modelFilePath))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement