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