58 references to Width
Microsoft.ML.ImageAnalytics (9)
ImageGrayscale.cs (3)
187if (src == null || src.Height <= 0 || src.Width <= 0) 193Contracts.Assert(dst.Width == src.Width && dst.Height == src.Height);
ImagePixelExtractor.cs (1)
348Host.Check(src.Height == height && src.Width == width);
ImageResizer.cs (3)
299if (src == null || src.Height <= 0 || src.Width <= 0) 301if (src.Height == info.ImageHeight && src.Width == info.ImageWidth) 327Contracts.Assert(dst.Width == info.ImageWidth && dst.Height == info.ImageHeight);
MLImage.cs (2)
139byte[] pixels = new byte[Height * Width * 3]; 143for (int i = 0; i < Height * Width * 3;)
Microsoft.ML.Samples (8)
Dynamic\Transforms\ImageAnalytics\ConvertToGrayScale.cs (2)
96imagePath, name, $"Width={imageObject.Width}, Height={imageObject.Height}", 97$"Width={grayscaleImageObject.Width}, Height={grayscaleImageObject.Height}");
Dynamic\Transforms\ImageAnalytics\ConvertToImage.cs (1)
79$"Width={imageObject.Width}, Height={imageObject.Height}",
Dynamic\Transforms\ImageAnalytics\ExtractPixels.cs (2)
111$"Width={imageObject.Width}, Height={imageObject.Height}", 112$"Width={resizedImageObject.Width}, Height={resizedImageObject.Height}",
Dynamic\Transforms\ImageAnalytics\LoadImages.cs (1)
91$"Width={imageObject.Width}, Height={imageObject.Height}");
Dynamic\Transforms\ImageAnalytics\ResizeImages.cs (2)
99$"Width={imageObject.Width}, Height={imageObject.Height}", 100$"Width={resizedImageObject.Width}, Height={resizedImageObject.Height}");
Microsoft.ML.Tests (29)
ImagesTests.cs (29)
257Assert.Equal(image.Width, grayImage.Width); 281Assert.Equal(singleImage.Image.Width, transformedSingleImage.GrayImage.Width); 1041int index = pixelSize * (image.Width - 1); 1043index = pixelSize * (image.Width) * (image.Height - 1); 1045index = pixelSize * image.Width * image.Height - pixelSize; 1047index = pixelSize * image.Width * ((image.Height / 2) - 1) + pixelSize * ((image.Width / 2) - 1); 1051index = pixelSize * image.Width * ((image.Height / 3) - 1) + pixelSize * ((image.Width / 2) - 1); 1054index = pixelSize * image.Width * ((image.Height / 3 * 2) - 1) + pixelSize * ((image.Width / 2) - 1); 1057index = pixelSize * image.Width * ((image.Height / 2) - 1) + pixelSize * ((image.Width / 3) - 1); 1060index = pixelSize * image.Width * ((image.Height / 2) - 1) + pixelSize * ((image.Width / 3 * 2) - 1); 1239Assert.Equal(image1.Width, image2.Width); 1245Assert.Equal(image1.Width * image1.Height * (image1.BitsPerPixel / 8), image1.Pixels.Length); 1253using MLImage image3 = MLImage.CreateFromPixels(image1.Width, image1.Height, image1.PixelFormat, image1.Pixels); 1254Assert.Equal(image1.Width, image3.Width); 1292Assert.Equal(image1.Width, image2.Width); 1312Assert.Equal(10, image.Width); 1321Assert.Throws<InvalidOperationException>(() => image.Width); 1371Assert.Equal(image1.Width, image2.Width);
Microsoft.ML.TorchSharp (12)
AutoFormerV2\ObjectDetectionTrainer.cs (12)
372var midTensor2 = midTensor1.reshape(1, image.Height, image.Width, 3); 374var midTensor4 = midTensor3.reshape(3, image.Height, image.Width); 383using var reMidTensor = midTensor.reshape(1, 3, image.Height, image.Width); 384var padW = 32 - (image.Width % 32); 386using var transMidTensor = torch.zeros(1, 3, image.Height + padH, image.Width + padW, device: Device); 387transMidTensor[RangeUtil.ToTensorIndex(..), RangeUtil.ToTensorIndex(..), RangeUtil.ToTensorIndex(..image.Height), RangeUtil.ToTensorIndex(..image.Width)] = reMidTensor / 255.0; 907var midTensor2 = midTensor1.reshape(1, image.Height, image.Width, 3); 909var midTensor4 = midTensor3.reshape(3, image.Height, image.Width); 918var reMidTensor = midTensor.reshape(1, 3, image.Height, image.Width); 919var padW = 32 - (image.Width % 32); 921var transMidTensor = torch.zeros(1, 3, image.Height + padH, image.Width + padW, device: _parent.Device); 922transMidTensor[RangeUtil.ToTensorIndex(..), RangeUtil.ToTensorIndex(..), RangeUtil.ToTensorIndex(..image.Height), RangeUtil.ToTensorIndex(..image.Width)] = reMidTensor / 255.0;