2 instantiations of ImageResizingEstimator
Microsoft.ML.ImageAnalytics (2)
53 references to ImageResizingEstimator
Microsoft.ML.ImageAnalytics (50)
ImageResizer.cs (38)
33/// <see cref="ITransformer"/> resulting from fitting an <see cref="ImageResizingEstimator"/>.
46public ImageResizingEstimator.ResizingKind? Resizing;
49public ImageResizingEstimator.Anchor? CropAnchor;
82public ImageResizingEstimator.ResizingKind Resizing = ImageResizingEstimator.Defaults.Resizing;
85public ImageResizingEstimator.Anchor CropAnchor = ImageResizingEstimator.Defaults.CropAnchor;
108private readonly ImageResizingEstimator.ColumnOptions[] _columns;
113internal IReadOnlyCollection<ImageResizingEstimator.ColumnOptions> Columns => _columns.AsReadOnly();
123/// <param name="resizing">What <see cref="ImageResizingEstimator.ResizingKind"/> to use.</param>
124/// <param name="cropAnchor">If <paramref name="resizing"/> set to <see cref="ImageResizingEstimator.ResizingKind.IsoCrop"/> what anchor to use for cropping.</param>
127ImageResizingEstimator.ResizingKind resizing = ImageResizingEstimator.ResizingKind.IsoCrop,
128ImageResizingEstimator.Anchor cropAnchor = ImageResizingEstimator.Anchor.Center)
129: this(env, new ImageResizingEstimator.ColumnOptions(outputColumnName, imageWidth, imageHeight, inputColumnName, resizing, cropAnchor))
138internal ImageResizingTransformer(IHostEnvironment env, params ImageResizingEstimator.ColumnOptions[] columns)
144private static (string outputColumnName, string inputColumnName)[] GetColumnPairs(ImageResizingEstimator.ColumnOptions[] columns)
159var cols = new ImageResizingEstimator.ColumnOptions[args.Columns.Length];
163cols[i] = new ImageResizingEstimator.ColumnOptions(
199_columns = new ImageResizingEstimator.ColumnOptions[ColumnPairs.Length];
206var scale = (ImageResizingEstimator.ResizingKind)ctx.Reader.ReadByte();
207Host.CheckDecode(Enum.IsDefined(typeof(ImageResizingEstimator.ResizingKind), scale));
208var anchor = (ImageResizingEstimator.Anchor)ctx.Reader.ReadByte();
209Host.CheckDecode(Enum.IsDefined(typeof(ImageResizingEstimator.Anchor), anchor));
210_columns[i] = new ImageResizingEstimator.ColumnOptions(ColumnPairs[i].outputColumnName, width, height, ColumnPairs[i].inputColumnName, scale, anchor);
244Contracts.Assert((ImageResizingEstimator.ResizingKind)(byte)col.Resizing == col.Resizing);
246Contracts.Assert((ImageResizingEstimator.Anchor)(byte)col.Anchor == col.Anchor);
312ImageResizingEstimator.ResizingKind.IsoPad => ImageResizeMode.Pad,
313ImageResizingEstimator.ResizingKind.IsoCrop =>
316ImageResizingEstimator.Anchor.Top => ImageResizeMode.CropAnchorTop,
317ImageResizingEstimator.Anchor.Bottom => ImageResizeMode.CropAnchorBottom,
318ImageResizingEstimator.Anchor.Left => ImageResizeMode.CropAnchorLeft,
319ImageResizingEstimator.Anchor.Right => ImageResizeMode.CropAnchorRight,
322ImageResizingEstimator.ResizingKind.Fill => ImageResizeMode.Fill,
444/// <param name="resizing">What <see cref="ImageResizingEstimator.ResizingKind"/> to use.</param>
445/// <param name="anchor">If <paramref name="resizing"/> set to <see cref="ImageResizingEstimator.ResizingKind.IsoCrop"/> what anchor to use for cropping.</param>
501: base(Contracts.CheckRef(env, nameof(env)).Register(nameof(ImageResizingEstimator)), transformer)
Microsoft.ML.Tests (3)