-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add a DNN Image Featurizer Transform Estimator #1447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 33 commits
bc71575
32dc90c
38fecff
5e1faa5
3c3aa2a
66b621e
87a5d51
5bec174
8876f02
2630f7b
4a38bf9
75b1b0d
271ae03
2e5ef2d
85ca884
b76deda
259ac05
d093d4b
30b9488
a3792d9
9338464
1e7c7ae
ec352d4
ee24322
6c97453
24caec9
3975134
bf25371
c72bcfe
2bb2163
4cdd1eb
af7a844
0e2d617
e9e60b0
326d8bf
579ad6b
368cd64
1d106bd
1bebc64
22e385b
8f9e808
a1e571d
55b5b0f
7405fce
ce93709
02e8ebc
c519a19
a687ccb
52a3e6a
9f566a2
d33eb06
3e4db44
5fbd41d
bdc9f60
8effaf9
b27ebe2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.SamplesUtils", | |
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Recommender", "src\Microsoft.ML.Recommender\Microsoft.ML.Recommender.csproj", "{C8E1772B-DFD9-4A4D-830D-6AAB1C668BB3}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.DnnImageFeaturizer.ResNet18", "src\Microsoft.ML.DnnImageFeaturizer.ResNet18\Microsoft.ML.DnnImageFeaturizer.ResNet18.csproj", "{9222FC9D-599A-49A5-B685-08CC9A5C81D7}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.DnnImageFeaturizer.AlexNet", "src\Microsoft.ML.DnnImageFeaturizer.AlexNet\Microsoft.ML.DnnImageFeaturizer.AlexNet.csproj", "{6C29AA9B-054B-4762-BEA5-D305B932AA80}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.DnnImageFeaturizer.ResNet50", "src\Microsoft.ML.DnnImageFeaturizer.ResNet50\Microsoft.ML.DnnImageFeaturizer.ResNet50.csproj", "{4805129D-78C8-46D4-9519-0AD9B0574D6D}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.DnnImageFeaturizer.ResNet101", "src\Microsoft.ML.DnnImageFeaturizer.ResNet101\Microsoft.ML.DnnImageFeaturizer.ResNet101.csproj", "{DB7CEB5E-8BE6-48A7-87BE-B91D9AE96F71}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
|
@@ -511,6 +519,38 @@ Global | |
{C8E1772B-DFD9-4A4D-830D-6AAB1C668BB3}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{C8E1772B-DFD9-4A4D-830D-6AAB1C668BB3}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU | ||
{C8E1772B-DFD9-4A4D-830D-6AAB1C668BB3}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU | ||
{9222FC9D-599A-49A5-B685-08CC9A5C81D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{9222FC9D-599A-49A5-B685-08CC9A5C81D7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{9222FC9D-599A-49A5-B685-08CC9A5C81D7}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU | ||
{9222FC9D-599A-49A5-B685-08CC9A5C81D7}.Debug-Intrinsics|Any CPU.Build.0 = Debug-Intrinsics|Any CPU | ||
{9222FC9D-599A-49A5-B685-08CC9A5C81D7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{9222FC9D-599A-49A5-B685-08CC9A5C81D7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{9222FC9D-599A-49A5-B685-08CC9A5C81D7}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU | ||
{9222FC9D-599A-49A5-B685-08CC9A5C81D7}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU | ||
{6C29AA9B-054B-4762-BEA5-D305B932AA80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{6C29AA9B-054B-4762-BEA5-D305B932AA80}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{6C29AA9B-054B-4762-BEA5-D305B932AA80}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU | ||
{6C29AA9B-054B-4762-BEA5-D305B932AA80}.Debug-Intrinsics|Any CPU.Build.0 = Debug-Intrinsics|Any CPU | ||
{6C29AA9B-054B-4762-BEA5-D305B932AA80}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{6C29AA9B-054B-4762-BEA5-D305B932AA80}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{6C29AA9B-054B-4762-BEA5-D305B932AA80}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU | ||
{6C29AA9B-054B-4762-BEA5-D305B932AA80}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU | ||
{4805129D-78C8-46D4-9519-0AD9B0574D6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{4805129D-78C8-46D4-9519-0AD9B0574D6D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{4805129D-78C8-46D4-9519-0AD9B0574D6D}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU | ||
{4805129D-78C8-46D4-9519-0AD9B0574D6D}.Debug-Intrinsics|Any CPU.Build.0 = Debug-Intrinsics|Any CPU | ||
{4805129D-78C8-46D4-9519-0AD9B0574D6D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{4805129D-78C8-46D4-9519-0AD9B0574D6D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{4805129D-78C8-46D4-9519-0AD9B0574D6D}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU | ||
{4805129D-78C8-46D4-9519-0AD9B0574D6D}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU | ||
{DB7CEB5E-8BE6-48A7-87BE-B91D9AE96F71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DB7CEB5E-8BE6-48A7-87BE-B91D9AE96F71}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{DB7CEB5E-8BE6-48A7-87BE-B91D9AE96F71}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU | ||
{DB7CEB5E-8BE6-48A7-87BE-B91D9AE96F71}.Debug-Intrinsics|Any CPU.Build.0 = Debug-Intrinsics|Any CPU | ||
{DB7CEB5E-8BE6-48A7-87BE-B91D9AE96F71}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{DB7CEB5E-8BE6-48A7-87BE-B91D9AE96F71}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{DB7CEB5E-8BE6-48A7-87BE-B91D9AE96F71}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU | ||
{DB7CEB5E-8BE6-48A7-87BE-B91D9AE96F71}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
|
@@ -567,6 +607,10 @@ Global | |
{ECB71297-9DF1-48CE-B93A-CD969221F9B6} = {DA452A53-2E94-4433-B08C-041EDEC729E6} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not aligned? #Resolved |
||
{11A5210E-2EA7-42F1-80DB-827762E9C781} = {09EADF06-BE25-4228-AB53-95AE3E15B530} | ||
{C8E1772B-DFD9-4A4D-830D-6AAB1C668BB3} = {09EADF06-BE25-4228-AB53-95AE3E15B530} | ||
{9222FC9D-599A-49A5-B685-08CC9A5C81D7} = {09EADF06-BE25-4228-AB53-95AE3E15B530} | ||
{6C29AA9B-054B-4762-BEA5-D305B932AA80} = {09EADF06-BE25-4228-AB53-95AE3E15B530} | ||
{4805129D-78C8-46D4-9519-0AD9B0574D6D} = {09EADF06-BE25-4228-AB53-95AE3E15B530} | ||
{DB7CEB5E-8BE6-48A7-87BE-B91D9AE96F71} = {09EADF06-BE25-4228-AB53-95AE3E15B530} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {41165AF1-35BB-4832-A189-73060F82B01D} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<PackageDescription>ML.NET component for pretrained AlexNet image featurization</PackageDescription> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../Microsoft.ML.OnnxTransform/Microsoft.ML.OnnxTransform.nupkgproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="$(LocalAppData)\mlnet-resources\AlexNetOnnx\AlexNet.onnx" Pack="true" PackagePath=".\lib\netstandard2.0\AlexNetOnnx" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These Instead, these files should be placed in the See https://docs.microsoft.com/en-us/nuget/reference/nuspec#including-content-files #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<Content Include="$(LocalAppData)\mlnet-resources\AlexNetPrepOnnx\AlexNetPreprocess.onnx" Pack="true" PackagePath=".\lib\netstandard2.0\AlexNetPrepOnnx" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project DefaultTargets="Pack"> | ||
|
||
<Import Project="Microsoft.ML.DnnImageFeaturizer.AlexNet.nupkgproj" /> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<PackageDescription>ML.NET component for pretrained ResNet101 image featurization</PackageDescription> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../Microsoft.ML.OnnxTransform/Microsoft.ML.OnnxTransform.nupkgproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="$(LocalAppData)\mlnet-resources\ResNet101Onnx\ResNet101.onnx" Pack="true" PackagePath=".\lib\netstandard2.0\ResNet101Onnx" /> | ||
<Content Include="$(LocalAppData)\mlnet-resources\ResNetPrepOnnx\ResNetPreprocess.onnx" Pack="true" PackagePath=".\lib\netstandard2.0\ResNetPrepOnnx" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project DefaultTargets="Pack"> | ||
|
||
<Import Project="Microsoft.ML.DnnImageFeaturizer.ResNet101.nupkgproj" /> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<PackageDescription>ML.NET component for pretrained ResNet18 image featurization</PackageDescription> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../Microsoft.ML.OnnxTransform/Microsoft.ML.OnnxTransform.nupkgproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="$(LocalAppData)\mlnet-resources\ResNet18Onnx\ResNet18.onnx" Pack="true" PackagePath=".\lib\netstandard2.0\ResNet18Onnx" /> | ||
<Content Include="$(LocalAppData)\mlnet-resources\ResNetPrepOnnx\ResNetPreprocess.onnx" Pack="true" PackagePath=".\lib\netstandard2.0\ResNetPrepOnnx" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project DefaultTargets="Pack"> | ||
|
||
<Import Project="Microsoft.ML.DnnImageFeaturizer.ResNet18.nupkgproj" /> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<PackageDescription>ML.NET component for pretrained ResNet50 image featurization</PackageDescription> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../Microsoft.ML.OnnxTransform/Microsoft.ML.OnnxTransform.nupkgproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="$(LocalAppData)\mlnet-resources\ResNet50Onnx\ResNet50.onnx" Pack="true" PackagePath=".\lib\netstandard2.0\ResNet50Onnx" /> | ||
<Content Include="$(LocalAppData)\mlnet-resources\ResNetPrepOnnx\ResNetPreprocess.onnx" Pack="true" PackagePath=".\lib\netstandard2.0\ResNetPrepOnnx" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project DefaultTargets="Pack"> | ||
|
||
<Import Project="Microsoft.ML.DnnImageFeaturizer.ResNet50.nupkgproj" /> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,58 @@ | ||||||||||
// Licensed to the .NET Foundation under one or more agreements. | ||||||||||
// The .NET Foundation licenses this file to you under the MIT license. | ||||||||||
// See the LICENSE file in the project root for more information. | ||||||||||
|
||||||||||
using Microsoft.ML.Runtime; | ||||||||||
using Microsoft.ML.Runtime.Data; | ||||||||||
using System.IO; | ||||||||||
using System.Reflection; | ||||||||||
|
||||||||||
namespace Microsoft.ML.Transforms | ||||||||||
{ | ||||||||||
/// <summary> | ||||||||||
/// This is an extension method to be used with the <see cref="DnnImageFeaturizerEstimator"/> in order to use a pretrained AlexNet model. | ||||||||||
/// The NuGet containing this extension is also guaranteed to include the binary model file. Note that when building the project | ||||||||||
/// containing this extension method, the corresponding binary model will be downloaded from the CDN at | ||||||||||
/// https://express-tlcresources.azureedge.net/image/AlexNetPrepOnnx/AlexNetPreprocess.onnx and | ||||||||||
/// https://express-tlcresources.azureedge.net/image/AlexNetOnnx/AlexNet.onnx and placed into the local app directory | ||||||||||
/// folder under mlnet-resources. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this comment about This doesn't make sense for an XML summary comment on a class. The XML comments are for the users of this API, not developers working on this file. #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||
/// </summary> | ||||||||||
public static class AlexNetExtension | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
(nit) it is nice to keep the class name and the containing file name in sync.
|
||||||||||
{ | ||||||||||
/// <summary> | ||||||||||
/// If including this through a NuGet, the location of the model will be the same as of this file. This looks for the model there. | ||||||||||
/// This should be the default way to use AlexNet if importing the model from a NuGet. | ||||||||||
/// </summary> | ||||||||||
public static EstimatorChain<OnnxTransform> AlexNet(this DnnImageModelSelector dnnModelContext, IHostEnvironment env, string input, string output) | ||||||||||
{ | ||||||||||
var modelChain = new EstimatorChain<OnnxTransform>(); | ||||||||||
var tempCol = "onnxDnnPrep"; | ||||||||||
var execDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); | ||||||||||
|
||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
// There are two estimators created below. The first one is for image preprocessing and the second one is the actual DNN model. | ||||||||||
var prepEstimator = new OnnxScoringEstimator(env, Path.Combine(execDir, "AlexNetPrepOnnx", "AlexNetPreprocess.onnx"), input, tempCol); | ||||||||||
var mainEstimator = new OnnxScoringEstimator(env, Path.Combine(execDir, "AlexNetOnnx", "AlexNet.onnx"), tempCol, output); | ||||||||||
modelChain = modelChain.Append(prepEstimator); | ||||||||||
modelChain = modelChain.Append(mainEstimator); | ||||||||||
return modelChain; | ||||||||||
} | ||||||||||
|
||||||||||
/// <summary> | ||||||||||
/// This allows a custom model location to be specified. This is useful is a custom model is specified, | ||||||||||
/// or if the model is desired to be placed or shipped separately in a different folder from the main application. Note that because Onnx models | ||||||||||
/// must be in a directory all by themsleves for the OnnxTransform to work, this method appends a AlexNetOnnx/AlexNetPrepOnnx subdirectory | ||||||||||
/// to the passed in directory to prevent having to make that directory manually each time. | ||||||||||
/// </summary> | ||||||||||
public static EstimatorChain<OnnxTransform> AlexNet(this DnnImageModelSelector dnnModelContext, IHostEnvironment env, string input, string output, string modelDir) | ||||||||||
{ | ||||||||||
var modelChain = new EstimatorChain<OnnxTransform>(); | ||||||||||
var tempCol = "onnxDnnPrep"; | ||||||||||
|
||||||||||
var prepEstimator = new OnnxScoringEstimator(env, Path.Combine(modelDir, "AlexNetPrepOnnx", "AlexNetPreprocess.onnx"), input, tempCol); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
var mainEstimator = new OnnxScoringEstimator(env, Path.Combine(modelDir, "AlexNetOnnx", "AlexNet.onnx"), tempCol, output); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
modelChain = modelChain.Append(prepEstimator); | ||||||||||
modelChain = modelChain.Append(mainEstimator); | ||||||||||
return modelChain; | ||||||||||
} | ||||||||||
} | ||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<UsingTask TaskName="DownloadFilesFromUrl" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<IncludeInPackage>Microsoft.ML.DnnImageFeaturizer.AlexNet</IncludeInPackage> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Microsoft.ML.OnnxTransform\Microsoft.ML.OnnxTransform.csproj" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<LocalAppDataDir>$(LocalAppData)</LocalAppDataDir> | ||
<MlnetAppDataDir>$(LocalAppData)/mlnet-resources</MlnetAppDataDir> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PreprocessFile Include="$(MlnetAppDataDir)/AlexNetPrepOnnx/AlexNetPreprocess.onnx" | ||
Url="https://express-tlcresources.azureedge.net/image/AlexNetPrepOnnx/AlexNetPreprocess.onnx " | ||
DestinationFile="$(MlnetAppDataDir)/AlexNetPrepOnnx/AlexNetPreprocess.onnx" | ||
DestinationDir="$(MlnetAppDataDir)/AlexNetPrepOnnx" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ModelFile Include="$(MlnetAppDataDir)/AlexNetOnnx/AlexNet.onnx" | ||
Url="https://express-tlcresources.azureedge.net/image/AlexNetOnnx/AlexNet.onnx" | ||
DestinationFile="$(MlnetAppDataDir)/AlexNetOnnx/AlexNet.onnx" | ||
DestinationDir="$(MlnetAppDataDir)/AlexNetOnnx" /> | ||
</ItemGroup> | ||
|
||
<Target Name="DownloadPrepModels" Inputs="@(PreprocessFile)" Outputs="%(PreprocessFile.DestinationFile)"> | ||
<Message Importance="High" Text="Downloading external model files... %(PreprocessFile.DestinationFile)" /> | ||
<MakeDir Directories="$(MlnetAppDataDir)" /> | ||
<MakeDir Directories="$(LocalAppDataDir)" /> | ||
<MakeDir Directories="%(PreprocessFile.DestinationDir)" /> | ||
<DownloadFilesFromUrl Items="@(PreprocessFile)"/> | ||
</Target> | ||
|
||
<Target Name="DownloadMainModels" | ||
DependsOnTargets="DownloadPrepModels" | ||
AfterTargets="Build" | ||
Inputs="@(ModelFile)" Outputs="%(ModelFile.DestinationFile)"> | ||
<Message Importance="High" Text="Downloading external model files... %(ModelFile.DestinationFile)" /> | ||
<MakeDir Directories="%(ModelFile.DestinationDir)" /> | ||
<DownloadFilesFromUrl Items="@(ModelFile)"/> | ||
</Target> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<UsingTask TaskName="DownloadFilesFromUrl" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<IncludeInPackage>Microsoft.ML.DnnImageFeaturizer.ResNet101</IncludeInPackage> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Microsoft.ML.OnnxTransform\Microsoft.ML.OnnxTransform.csproj" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<LocalAppDataDir>$(LocalAppData)</LocalAppDataDir> | ||
<MlnetAppDataDir>$(LocalAppData)/mlnet-resources</MlnetAppDataDir> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PreprocessFile Include="$(MlnetAppDataDir)/ResNetPrepOnnx/ResNetPreprocess.onnx" | ||
Url="https://express-tlcresources.azureedge.net/image/ResNetPrepOnnx/ResNetPreprocess.onnx " | ||
DestinationFile="$(MlnetAppDataDir)/ResNetPrepOnnx/ResNetPreprocess.onnx" | ||
DestinationDir="$(MlnetAppDataDir)/ResNetPrepOnnx" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ModelFile Include="$(MlnetAppDataDir)/ResNet101Onnx/ResNet101.onnx" | ||
Url="https://express-tlcresources.azureedge.net/image/ResNet101Onnx/ResNet101.onnx" | ||
DestinationFile="$(MlnetAppDataDir)/ResNet101Onnx/ResNet101.onnx" | ||
DestinationDir="$(MlnetAppDataDir)/ResNet101Onnx" /> | ||
</ItemGroup> | ||
|
||
<Target Name="DownloadPrepModels" Inputs="@(PreprocessFile)" Outputs="%(PreprocessFile.DestinationFile)"> | ||
<Message Importance="High" Text="Downloading external model files... %(PreprocessFile.DestinationFile)" /> | ||
<MakeDir Directories="$(MlnetAppDataDir)" /> | ||
<MakeDir Directories="$(LocalAppDataDir)" /> | ||
<MakeDir Directories="%(PreprocessFile.DestinationDir)" /> | ||
<DownloadFilesFromUrl Items="@(PreprocessFile)"/> | ||
</Target> | ||
|
||
<Target Name="DownloadMainModels" | ||
DependsOnTargets="DownloadPrepModels" | ||
AfterTargets="Build" | ||
Inputs="@(ModelFile)" Outputs="%(ModelFile.DestinationFile)"> | ||
<Message Importance="High" Text="Downloading external model files... %(ModelFile.DestinationFile)" /> | ||
<MakeDir Directories="%(ModelFile.DestinationDir)" /> | ||
<DownloadFilesFromUrl Items="@(ModelFile)"/> | ||
</Target> | ||
|
||
</Project> |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not aligned? #Resolved