5 instantiations of MLImage
Microsoft.ML.ImageAnalytics (5)
MLImage.cs (5)
49return new MLImage(image); 70return new MLImage(image); 110return new MLImage(image); 305return new MLImage(image); 424return new MLImage(destBitmap);
158 references to MLImage
Microsoft.ML.ImageAnalytics (35)
ExtensionsCatalog.cs (6)
24/// This estimator operates only on <see cref="Microsoft.ML.Data.MLImage"/>.</param> 40/// <param name="columns">The pairs of input and output columns. This estimator operates only on <see cref="Microsoft.ML.Data.MLImage"/>.</param> 61/// This column's data type will be <see cref="Microsoft.ML.Data.MLImage"/>.</param> 101/// This estimator operates over <see cref="Microsoft.ML.Data.MLImage"/>.</param> 145/// This estimator operates over <see cref="Microsoft.ML.Data.MLImage"/>.</param> 205/// This column's data type will be <see cref="Microsoft.ML.Data.MLImage"/>.</param>
ImageGrayscale.cs (5)
167var src = default(MLImage); 168var getSrc = input.GetGetter<MLImage>(input.Schema[ColMapNewToOld[iinfo]]); 180ValueGetter<MLImage> del = 181(ref MLImage dst) =>
ImageLoader.cs (5)
220var lastImage = default(MLImage); 233ValueGetter<MLImage> del = 234(ref MLImage dst) => 253dst = MLImage.CreateFromStream(ms);
ImagePixelExtractor.cs (3)
323var getSrc = input.GetGetter<MLImage>(input.Schema[ColMapNewToOld[iinfo]]); 324var src = default(MLImage);
ImageResizer.cs (5)
277var src = default(MLImage); 278var getSrc = input.GetGetter<MLImage>(input.Schema[ColMapNewToOld[iinfo]]); 290ValueGetter<MLImage> del = 291(ref MLImage dst) =>
ImageType.cs (3)
66DataViewTypeManager.Register(new ImageDataViewType(Height, Width), typeof(MLImage), this); 76: base(typeof(MLImage)) 86public ImageDataViewType() : base(typeof(MLImage))
MLImage.cs (5)
36public static MLImage CreateFromStream(Stream imageStream) 57public static MLImage CreateFromFile(string imagePath) 81public static unsafe MLImage CreateFromPixels(int width, int height, MLPixelFormat pixelFormat, ReadOnlySpan<byte> imagePixelData) 288internal MLImage CloneWithResizing(int width, int height, ImageResizeMode mode) 410internal MLImage CloneWithGrayscale()
VectorToImageTransform.cs (3)
344private ValueGetter<MLImage> GetterFromType<TValue>(PrimitiveDataViewType srcType, DataViewRow input, int iinfo, 356(ref MLImage dst) => 418dst = MLImage.CreateFromPixels(width, height, MLPixelFormat.Bgra32, imageData);
Microsoft.ML.OnnxTransformerTest (2)
OnnxTransformTests.cs (2)
591public MLImage Image { get; set; } 616Image = MLImage.CreateFromPixels(Width, Height, MLPixelFormat.Bgra32, imageData);
Microsoft.ML.Samples (23)
Dynamic\Transforms\ApplyONNXModelWithInMemoryImages.cs (2)
93public MLImage Image { get; set; } 118Image = MLImage.CreateFromPixels(width, height, MLPixelFormat.Bgra32, imageData);
Dynamic\Transforms\ImageAnalytics\ConvertToGrayScale.cs (4)
73MLImage imageObject = null; 74MLImage grayscaleImageObject = null; 82var imageObjectGetter = cursor.GetGetter<MLImage>(cursor.Schema[ 85var grayscaleGetter = cursor.GetGetter<MLImage>(cursor.Schema[
Dynamic\Transforms\ImageAnalytics\ConvertToGrayScaleInMemory.cs (5)
39var image = dataPoint.Image; 40var grayImage = dataPoint.GrayImage; 87public MLImage Image { get; set; } 90public MLImage GrayImage { get; set; } 110Image = MLImage.CreateFromPixels(width, height, MLPixelFormat.Bgra32, imageData);
Dynamic\Transforms\ImageAnalytics\ConvertToImage.cs (2)
61MLImage imageObject = null; 69var imageGetter = cursor.GetGetter<MLImage>(cursor.Schema["Image"]);
Dynamic\Transforms\ImageAnalytics\ExtractPixels.cs (4)
81MLImage imageObject = null; 82MLImage resizedImageObject = null; 91var imageObjectGetter = cursor.GetGetter<MLImage>(cursor.Schema[ 94var resizedImageGetter = cursor.GetGetter<MLImage>(cursor.Schema[
Dynamic\Transforms\ImageAnalytics\LoadImages.cs (2)
72MLImage imageObject = null; 80var imageObjectGetter = cursor.GetGetter<MLImage>(cursor.Schema[
Dynamic\Transforms\ImageAnalytics\ResizeImages.cs (4)
75MLImage imageObject = null; 76MLImage resizedImageObject = null; 84var imageObjectGetter = cursor.GetGetter<MLImage>(cursor.Schema[ 87var resizedImageGetter = cursor.GetGetter<MLImage>(cursor.Schema[
Microsoft.ML.Tests (80)
ImagesTests.cs (80)
156var imageCropGetter = cursor.GetGetter<MLImage>(cropped.Schema["ImageCropped"]); 157MLImage image = default; 203var imageGetter = cursor.GetGetter<MLImage>(grey.Schema["ImageGrey"]); 204MLImage image = default; 252var image = dataPoint.Image; 253var grayImage = dataPoint.GrayImage; 302public MLImage Image { get; set; } 305public MLImage GrayImage { get; set; } 325Image = MLImage.CreateFromPixels(width, height, MLPixelFormat.Bgra32, imageData); 363var imageGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageRestored"]); 364MLImage restoredImage = default; 366var imageCropGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageCropped"]); 367MLImage croppedImage = default; 438var imageGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageRestored"]); 439MLImage restoredImage = default; 441var imageCropGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageCropped"]); 442MLImage croppedImage = default; 514var imageGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageRestored"]); 515MLImage restoredImage = default; 517var imageCropGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageCropped"]); 518MLImage croppedImage = default; 589var imageGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageRestored"]); 590MLImage restoredImage = default; 592var imageCropGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageCropped"]); 593MLImage croppedImage = default; 664var imageGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageRestored"]); 665MLImage restoredImage = default; 667var imageCropGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageCropped"]); 668MLImage croppedImage = default; 740var imageGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageRestored"]); 741MLImage restoredImage = default; 743var imageCropGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageCropped"]); 744MLImage croppedImage = default; 815var imageGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageRestored"]); 816MLImage restoredImage = default; 818var imageCropGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageCropped"]); 819MLImage croppedImage = default; 891var imageGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageRestored"]); 892MLImage restoredImage = default; 894var imageCropGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageCropped"]); 895MLImage croppedImage = default; 965var imageGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageRestored"]); 966MLImage restoredImage = default; 968var imageCropGetter = cursor.GetGetter<MLImage>(backToImages.Schema["ImageCropped"]); 969MLImage croppedImage = default; 1028using (var image = (MLImage)rowView.First().Values.Last().Value) 1123public MLImage LoadedImage; 1165private static MLImage LoadImageFromFile(string imagePath) => MLImage.CreateFromFile(imagePath); 1171public MLImage ResizedImage; 1189var resizedImage = (MLImage)rowView.First().Values.Last().Value; 1234using MLImage image1 = MLImage.CreateFromFile(dataFile); 1236using MLImage image2 = MLImage.CreateFromStream(imageStream); 1253using MLImage image3 = MLImage.CreateFromPixels(image1.Width, image1.Height, image1.PixelFormat, image1.Pixels); 1264Assert.Throws<ArgumentNullException>(() => MLImage.CreateFromFile(null)); 1265Assert.Throws<ArgumentException>(() => MLImage.CreateFromFile("This is Invalid Path")); 1266Assert.Throws<ArgumentNullException>(() => MLImage.CreateFromStream(null)); 1267Assert.Throws<ArgumentException>(() => MLImage.CreateFromStream(new MemoryStream(new byte[10]))); 1268Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(10, 10, MLPixelFormat.Unknown, Array.Empty<byte>())); 1269Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(10, 10, MLPixelFormat.Bgra32, Array.Empty<byte>())); 1270Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(0, 10, MLPixelFormat.Bgra32, new byte[10])); 1271Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(10, 0, MLPixelFormat.Bgra32, new byte[10])); 1272Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(10, 10, MLPixelFormat.Bgra32, new byte[401])); 1280using MLImage image1 = MLImage.CreateFromFile(dataFile); 1290using MLImage image2 = MLImage.CreateFromFile(imageTempPath); 1309MLImage image = MLImage.CreateFromPixels(10, 10, MLPixelFormat.Bgra32, new byte[10 * 10 * 4]); 1333using MLImage image1 = MLImage.CreateFromFile(imageFile); 1337MLImage image2 = MLImage.CreateFromStream(stream); 1345image2 = MLImage.CreateFromStream(nonSeekableStream); 1368image2 = MLImage.CreateFromStream(ms);
Microsoft.ML.TorchSharp (18)
AutoFormerV2\ObjectDetectionTrainer.cs (18)
291var imageGetter = cursor.GetGetter<MLImage>(input.Schema[Parent.Option.ImageColumnName]); 322ValueGetter<MLImage> imageGetter, 364private (Tensor image, Tensor Label) PrepareData(ValueGetter<VBuffer<uint>> labelGetter, ValueGetter<MLImage> imageGetter, ValueGetter<VBuffer<float>> boundingBoxGetter) 368MLImage image = default; 494if (imageCol.ItemType.RawType != typeof(MLImage)) 806ValueGetter<MLImage> getImage = default; 808getImage = input.GetGetter<MLImage>(input.Schema[_parent.Options.ImageColumnName]); 810MLImage image = default; 830ValueGetter<MLImage> getImage = default; 832getImage = input.GetGetter<MLImage>(input.Schema[_parent.Options.ImageColumnName]); 834MLImage image = default; 854ValueGetter<MLImage> getImage = default; 856getImage = input.GetGetter<MLImage>(input.Schema[_parent.Options.ImageColumnName]); 858MLImage image = default; 900private Tensor PrepInputTensors(ref MLImage image, ValueGetter<MLImage> imageGetter) 963private protected void UpdateCacheIfNeeded(long position, TensorCacher outputCache, ref MLImage image, ref ValueGetter<MLImage> getImage)