Skip to content

Commit be097f0

Browse files
committed
fix the code base to compile
1 parent e590b46 commit be097f0

File tree

8 files changed

+239
-209
lines changed

8 files changed

+239
-209
lines changed

src/Microsoft.ML.Data/Transforms/ColumnBindingsBase.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
namespace Microsoft.ML.Data
1717
{
18-
internal abstract class SourceNameColumnBase
18+
public abstract class SourceNameColumnBase
1919
{
2020
[Argument(ArgumentType.AtMostOnce, HelpText = "Name of the new column", ShortName = "name")]
2121
public string Name;
@@ -104,8 +104,7 @@ public bool TrySanitize()
104104
}
105105
}
106106

107-
[BestFriend]
108-
internal abstract class OneToOneColumn : SourceNameColumnBase
107+
public abstract class OneToOneColumn : SourceNameColumnBase
109108
{
110109
[BestFriend]
111110
private protected OneToOneColumn() { }

src/Microsoft.ML.ImageAnalytics/ExtensionsCatalog.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,21 @@ public static ImagePixelExtractingEstimator ExtractPixels(this TransformsCatalog
6969
bool interleave = false,
7070
float offset = ImagePixelExtractingEstimator.Defaults.Offset,
7171
float scale = ImagePixelExtractingEstimator.Defaults.Scale,
72-
bool asFloat = ImagePixelExtractingEstimator.Defaults.Convert)
73-
=> new ImagePixelExtractingEstimator(CatalogUtils.GetEnvironment(catalog), outputColumnName, inputColumnName, colors, order, interleave, offset, scale, asFloat);
72+
bool asFloat = ImagePixelExtractingEstimator.Defaults.AsFloat)
73+
{
74+
var column = new ImagePixelExtractingEstimator.ColumnOptions()
75+
{
76+
Name = outputColumnName,
77+
Source = inputColumnName,
78+
Colors = colors,
79+
Order = order,
80+
Interleave = interleave,
81+
Offset = offset,
82+
Scale = scale,
83+
AsFloat = asFloat
84+
};
85+
return new ImagePixelExtractingEstimator(CatalogUtils.GetEnvironment(catalog), column);
86+
}
7487

7588
/// <include file='doc.xml' path='doc/members/member[@name="ImagePixelExtractingEstimator"]/*' />
7689
/// <param name="catalog">The transform's catalog.</param>

src/Microsoft.ML.StaticPipe/ImageStaticPipe.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public static Custom<Bitmap> Resize(this Custom<Bitmap> input, int width, int he
126126
public static Vector<float> ExtractPixels(this Custom<Bitmap> input, bool useAlpha = false, bool useRed = true,
127127
bool useGreen = true, bool useBlue = true, ImagePixelExtractingEstimator.ColorsOrder order = ImagePixelExtractingEstimator.Defaults.Order, bool interleave = false, float scale = 1.0f, float offset = 0.0f)
128128
{
129-
var colParams = new ImagePixelExtractingTransformer.Column
129+
var colParams = new ImagePixelExtractingEstimator.ColumnOptions
130130
{
131131
UseAlpha = useAlpha,
132132
UseRed = useRed,
@@ -135,7 +135,7 @@ public static Vector<float> ExtractPixels(this Custom<Bitmap> input, bool useAlp
135135
Interleave = interleave,
136136
Scale = scale,
137137
Offset = offset,
138-
Convert = true
138+
AsFloat = true
139139
};
140140
return new ImagePixelExtractingStaticExtensions.OutPipelineColumn<float>(input, colParams);
141141
}
@@ -157,14 +157,14 @@ public static Vector<float> ExtractPixels(this Custom<Bitmap> input, bool useAlp
157157
public static Vector<byte> ExtractPixelsAsBytes(this Custom<Bitmap> input, bool useAlpha = false, bool useRed = true,
158158
bool useGreen = true, bool useBlue = true, ImagePixelExtractingEstimator.ColorsOrder order = ImagePixelExtractingEstimator.Defaults.Order, bool interleave = false)
159159
{
160-
var colParams = new ImagePixelExtractingTransformer.Column
160+
var colParams = new ImagePixelExtractingEstimator.ColumnOptions
161161
{
162162
UseAlpha = useAlpha,
163163
UseRed = useRed,
164164
UseGreen = useGreen,
165165
UseBlue = useBlue,
166166
Interleave = interleave,
167-
Convert = false
167+
AsFloat = false
168168
};
169169
return new ImagePixelExtractingStaticExtensions.OutPipelineColumn<byte>(input, colParams);
170170
}

src/Microsoft.ML.StaticPipe/ImageTransformsStatic.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,9 @@ private interface IColInput
187187
internal sealed class OutPipelineColumn<T> : Vector<T>, IColInput
188188
{
189189
public Custom<Bitmap> Input { get; }
190-
private static readonly ImagePixelExtractingTransformer.Options _defaultArgs = new ImagePixelExtractingTransformer.Options();
191-
private readonly ImagePixelExtractingTransformer.Column _colParam;
190+
private readonly ImagePixelExtractingEstimator.ColumnOptions _colParam;
192191

193-
public OutPipelineColumn(Custom<Bitmap> input, ImagePixelExtractingTransformer.Column col)
192+
public OutPipelineColumn(Custom<Bitmap> input, ImagePixelExtractingEstimator.ColumnOptions col)
194193
: base(Reconciler.Inst, input)
195194
{
196195
Contracts.AssertValue(input);
@@ -207,7 +206,7 @@ public ImagePixelExtractingEstimator.ColumnOptions MakeColumnOptions(string outp
207206

208207
_colParam.Name = outputColumnName;
209208
_colParam.Source = inputColumnName;
210-
return new ImagePixelExtractingEstimator.ColumnOptions(_colParam, _defaultArgs);
209+
return _colParam;
211210
}
212211
}
213212

test/BaselineOutput/Common/EntryPoints/core_manifest.json

Lines changed: 89 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -18794,52 +18794,23 @@
1879418794
"Kind": "Struct",
1879518795
"Fields": [
1879618796
{
18797-
"Name": "UseAlpha",
18798-
"Type": "Bool",
18799-
"Desc": "Whether to use alpha channel",
18800-
"Aliases": [
18801-
"alpha"
18802-
],
18803-
"Required": false,
18804-
"SortOrder": 150.0,
18805-
"IsNullable": true,
18806-
"Default": null
18807-
},
18808-
{
18809-
"Name": "UseRed",
18810-
"Type": "Bool",
18811-
"Desc": "Whether to use red channel",
18812-
"Aliases": [
18813-
"red"
18814-
],
18815-
"Required": false,
18816-
"SortOrder": 150.0,
18817-
"IsNullable": true,
18818-
"Default": null
18819-
},
18820-
{
18821-
"Name": "UseGreen",
18822-
"Type": "Bool",
18823-
"Desc": "Whether to use green channel",
18824-
"Aliases": [
18825-
"green"
18826-
],
18827-
"Required": false,
18828-
"SortOrder": 150.0,
18829-
"IsNullable": true,
18830-
"Default": null
18831-
},
18832-
{
18833-
"Name": "UseBlue",
18834-
"Type": "Bool",
18835-
"Desc": "Whether to use blue channel",
18836-
"Aliases": [
18837-
"blue"
18838-
],
18797+
"Name": "Colors",
18798+
"Type": {
18799+
"Kind": "Enum",
18800+
"Values": [
18801+
"Alpha",
18802+
"Red",
18803+
"Green",
18804+
"Blue",
18805+
"Rgb",
18806+
"All"
18807+
]
18808+
},
18809+
"Desc": null,
1883918810
"Required": false,
1884018811
"SortOrder": 150.0,
18841-
"IsNullable": true,
18842-
"Default": null
18812+
"IsNullable": false,
18813+
"Default": "Rgb"
1884318814
},
1884418815
{
1884518816
"Name": "Order",
@@ -18857,47 +18828,95 @@
1885718828
"Desc": "Order of channels",
1885818829
"Required": false,
1885918830
"SortOrder": 150.0,
18860-
"IsNullable": true,
18861-
"Default": null
18831+
"IsNullable": false,
18832+
"Default": "ARGB"
1886218833
},
1886318834
{
1886418835
"Name": "Interleave",
1886518836
"Type": "Bool",
1886618837
"Desc": "Whether to separate each channel or interleave in specified order",
1886718838
"Required": false,
1886818839
"SortOrder": 150.0,
18869-
"IsNullable": true,
18870-
"Default": null
18840+
"IsNullable": false,
18841+
"Default": false
1887118842
},
1887218843
{
18873-
"Name": "Convert",
18844+
"Name": "AsFloat",
1887418845
"Type": "Bool",
1887518846
"Desc": "Whether to convert to floating point",
1887618847
"Aliases": [
1887718848
"conv"
1887818849
],
1887918850
"Required": false,
1888018851
"SortOrder": 150.0,
18881-
"IsNullable": true,
18882-
"Default": null
18852+
"IsNullable": false,
18853+
"Default": true
1888318854
},
1888418855
{
1888518856
"Name": "Offset",
1888618857
"Type": "Float",
1888718858
"Desc": "Offset (pre-scale)",
1888818859
"Required": false,
1888918860
"SortOrder": 150.0,
18890-
"IsNullable": true,
18891-
"Default": null
18861+
"IsNullable": false,
18862+
"Default": 0.0
1889218863
},
1889318864
{
1889418865
"Name": "Scale",
1889518866
"Type": "Float",
1889618867
"Desc": "Scale factor",
1889718868
"Required": false,
1889818869
"SortOrder": 150.0,
18899-
"IsNullable": true,
18900-
"Default": null
18870+
"IsNullable": false,
18871+
"Default": 1.0
18872+
},
18873+
{
18874+
"Name": "UseAlpha",
18875+
"Type": "Bool",
18876+
"Desc": "Whether to use alpha channel",
18877+
"Aliases": [
18878+
"alpha"
18879+
],
18880+
"Required": false,
18881+
"SortOrder": 150.0,
18882+
"IsNullable": false,
18883+
"Default": false
18884+
},
18885+
{
18886+
"Name": "UseRed",
18887+
"Type": "Bool",
18888+
"Desc": "Whether to use red channel",
18889+
"Aliases": [
18890+
"red"
18891+
],
18892+
"Required": false,
18893+
"SortOrder": 150.0,
18894+
"IsNullable": false,
18895+
"Default": false
18896+
},
18897+
{
18898+
"Name": "UseGreen",
18899+
"Type": "Bool",
18900+
"Desc": "Whether to use green channel",
18901+
"Aliases": [
18902+
"green"
18903+
],
18904+
"Required": false,
18905+
"SortOrder": 150.0,
18906+
"IsNullable": false,
18907+
"Default": false
18908+
},
18909+
{
18910+
"Name": "UseBlue",
18911+
"Type": "Bool",
18912+
"Desc": "Whether to use blue channel",
18913+
"Aliases": [
18914+
"blue"
18915+
],
18916+
"Required": false,
18917+
"SortOrder": 150.0,
18918+
"IsNullable": false,
18919+
"Default": false
1890118920
},
1890218921
{
1890318922
"Name": "Name",
@@ -18951,8 +18970,8 @@
1895118970
],
1895218971
"Required": false,
1895318972
"SortOrder": 150.0,
18954-
"IsNullable": false,
18955-
"Default": false
18973+
"IsNullable": true,
18974+
"Default": null
1895618975
},
1895718976
{
1895818977
"Name": "UseRed",
@@ -18963,8 +18982,8 @@
1896318982
],
1896418983
"Required": false,
1896518984
"SortOrder": 150.0,
18966-
"IsNullable": false,
18967-
"Default": true
18985+
"IsNullable": true,
18986+
"Default": null
1896818987
},
1896918988
{
1897018989
"Name": "UseGreen",
@@ -18975,8 +18994,8 @@
1897518994
],
1897618995
"Required": false,
1897718996
"SortOrder": 150.0,
18978-
"IsNullable": false,
18979-
"Default": true
18997+
"IsNullable": true,
18998+
"Default": null
1898018999
},
1898119000
{
1898219001
"Name": "UseBlue",
@@ -18987,8 +19006,8 @@
1898719006
],
1898819007
"Required": false,
1898919008
"SortOrder": 150.0,
18990-
"IsNullable": false,
18991-
"Default": true
19009+
"IsNullable": true,
19010+
"Default": null
1899219011
},
1899319012
{
1899419013
"Name": "Order",
@@ -19006,29 +19025,29 @@
1900619025
"Desc": "Order of colors.",
1900719026
"Required": false,
1900819027
"SortOrder": 150.0,
19009-
"IsNullable": false,
19010-
"Default": "ARGB"
19028+
"IsNullable": true,
19029+
"Default": null
1901119030
},
1901219031
{
1901319032
"Name": "Interleave",
1901419033
"Type": "Bool",
1901519034
"Desc": "Whether to separate each channel or interleave in specified order",
1901619035
"Required": false,
1901719036
"SortOrder": 150.0,
19018-
"IsNullable": false,
19019-
"Default": false
19037+
"IsNullable": true,
19038+
"Default": null
1902019039
},
1902119040
{
19022-
"Name": "Convert",
19041+
"Name": "AsFloat",
1902319042
"Type": "Bool",
1902419043
"Desc": "Whether to convert to floating point",
1902519044
"Aliases": [
1902619045
"conv"
1902719046
],
1902819047
"Required": false,
1902919048
"SortOrder": 150.0,
19030-
"IsNullable": false,
19031-
"Default": true
19049+
"IsNullable": true,
19050+
"Default": null
1903219051
},
1903319052
{
1903419053
"Name": "Offset",

0 commit comments

Comments
 (0)