Skip to content

Commit 81cae9a

Browse files
Bri Achtmanjustinormontluisquintanilla
authored
1.5 mlnet update (dotnet#839)
* update ml.net versions * update proj to .net core 3.1 * shorten ccfraud project / file name Fixes Error MSB3491 * update image classification training solution to .net core 3 * update ranking sample to .net core 3.1 * Update BikeDemandForecasting.csproj * update to .net core 3.1 to fix errors * Update samples/csharp/getting-started/DeepLearning_ImageClassification_Training/ImageClassification.Train/assets/inputs/images/flower_photos_small_set/LICENSE.txt Co-authored-by: Justin Ormont <[email protected]> * Update samples/csharp/getting-started/DeepLearning_ImageClassification_Training/ImageClassification.Train/assets/inputs/images/flower_photos_small_set/LICENSE.txt Co-authored-by: Justin Ormont <[email protected]> * fix fsharp mnist project * fix automl taxi fare fsharp project * fix fsharp shampoo sales anomaly detection project * fix fsharp power anomaly detection project * Create PowerAnomalyDetection.sln * Update project name so web app will build * fix model explainability project * fix e2e matrix factorization by updating to .net core 3.1 * update scalable web api to 3.1 * update scalable web api integration to 3.1 * Update Startup.cs * Shorten length of project name to fix blazor app * add scisharp package for image classification model consumption * Create ImageClassification.Score.sln * Update samples to 1.5 (dotnet#841) * Updated and debuggined ONNX F# sample * Updates to DL TF Estimator * Updated OnnxObjectDetectionE2E * Updated AutoML samples * Fixed bugs in web app when upgraded to 3.1 * Updated version packages for DL binary * Updated to net core 3.1 * Fixed bugs in upgrade to 3.1 * Updated READMES * Delete imageClassifier.zip Co-authored-by: Justin Ormont <[email protected]> Co-authored-by: Luis Quintanilla <[email protected]>
1 parent 5308cda commit 81cae9a

File tree

378 files changed

+4024
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

378 files changed

+4024
-293
lines changed

samples/.ionide/symbolCache.db

608 KB
Binary file not shown.

samples/Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project>
22

33
<PropertyGroup>
4-
<MicrosoftMLVersion>1.4.0</MicrosoftMLVersion>
5-
<MicrosoftMLPreviewVersion>0.16.0</MicrosoftMLPreviewVersion>
4+
<MicrosoftMLVersion>1.5.0</MicrosoftMLVersion>
5+
<MicrosoftMLPreviewVersion>0.17.0</MicrosoftMLPreviewVersion>
66
</PropertyGroup>
77

88
</Project>

samples/csharp/end-to-end-apps/AnomalyDetection-Sales/SpikeDetectionE2EApp/SpikeDetection.ModelTrainer/SpikeDetectionModelTrainer.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
using Microsoft.Extensions.Configuration;
1010
using Microsoft.Extensions.Logging;
1111
using Microsoft.Extensions.ML;
12-
using TensorFlowImageClassification.ImageHelpers;
13-
using TensorFlowImageClassification.ML.DataModels;
12+
using TFClassification.ML.DataModels;
13+
using TFImageClassification.ImageHelpers;
14+
using TFImageClassification.ML.DataModels;
1415

15-
namespace TensorFlowImageClassification.Controllers
16+
namespace TFImageClassification.Controllers
1617
{
1718
[Route("api/[controller]")]
1819
[ApiController]
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Linq;
22
using System.Text;
33

4-
namespace TensorFlowImageClassification.ImageHelpers
4+
namespace TFImageClassification.ImageHelpers
55
{
66
public static class ImageValidationExtensions
77
{
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.IO;
66
using System.Linq;
77

8-
namespace TensorFlowImageClassification.ML.DataModels
8+
namespace TFImageClassification.ML.DataModels
99
{
1010
public class ImageInputData
1111
{
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
using Microsoft.ML.Data;
44

5-
namespace TensorFlowImageClassification.ML.DataModels
5+
namespace TFClassification.ML.DataModels
66
{
77
public class ImageLabelPredictions
88
{
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

2-
namespace TensorFlowImageClassification.ML.DataModels
2+
namespace TFClassification.ML.DataModels
33
{
44
public class ImagePredictedLabelWithProbability
55
{
66
public string ImageId;
77

8-
public string PredictedLabel;
8+
public string PredictedLabel { get; set; }
99
public float Probability { get; set; }
1010

1111
public long PredictionExecutionTime;
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Microsoft.ML;
44
using System.Threading;
55

6-
namespace TensorFlowImageClassification.ML
6+
namespace TFClassification.ML
77
{
88
public class InMemoryModelLoader : ModelLoader
99
{
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using Microsoft.ML;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using TensorFlowImageClassification.ML.DataModels;
4+
using TFImageClassification.ML.DataModels;
55

6-
namespace TensorFlowImageClassification.ML
6+
namespace TFImageClassification.ML
77
{
88
public class TensorFlowModelConfigurator
99
{
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Microsoft.AspNetCore.Mvc;
77
using Microsoft.AspNetCore.Mvc.RazorPages;
88

9-
namespace TensorFlowImageClassification.Pages
9+
namespace TFImageClassification.Pages
1010
{
1111
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
1212
public class ErrorModel : PageModel
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Microsoft.AspNetCore.Mvc;
66
using Microsoft.AspNetCore.Mvc.RazorPages;
77

8-
namespace TensorFlowImageClassification.Pages
8+
namespace TFImageClassification.Pages
99
{
1010
public class IndexModel : PageModel
1111
{
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Microsoft.AspNetCore.Mvc;
66
using Microsoft.AspNetCore.Mvc.RazorPages;
77

8-
namespace TensorFlowImageClassification.Pages
8+
namespace TFImageClassification.Pages
99
{
1010
public class PrivacyModel : PageModel
1111
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@using TFImageClassification
2+
@namespace TFImageClassification.Pages
3+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Microsoft.Extensions.Configuration;
99
using Microsoft.Extensions.Logging;
1010

11-
namespace TensorFlowImageClassification
11+
namespace TFImageClassification
1212
{
1313
public class Program
1414
{
+16-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
using Microsoft.AspNetCore.Builder;
33
using Microsoft.AspNetCore.Hosting;
44
using Microsoft.AspNetCore.Http;
5-
using Microsoft.AspNetCore.Mvc;
65
using Microsoft.Extensions.Configuration;
76
using Microsoft.Extensions.DependencyInjection;
87
using Microsoft.Extensions.ML;
8+
using Microsoft.Extensions.Hosting;
99
using Microsoft.ML;
10-
using TensorFlowImageClassification.ML;
11-
using TensorFlowImageClassification.ML.DataModels;
10+
using TFImageClassification.ML;
11+
using TFImageClassification.ML.DataModels;
12+
using TFClassification.ML.DataModels;
13+
using TFClassification.ML;
1214

13-
namespace TensorFlowImageClassification
15+
namespace TFImageClassification
1416
{
1517
public class Startup
1618
{
@@ -41,7 +43,8 @@ public void ConfigureServices(IServiceCollection services)
4143
options.MinimumSameSitePolicy = SameSiteMode.None;
4244
});
4345

44-
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
46+
services.AddControllers();
47+
services.AddRazorPages();
4548

4649
/////////////////////////////////////////////////////////////////////////////
4750
// Register the PredictionEnginePool as a service in the IoC container for DI.
@@ -55,7 +58,7 @@ public void ConfigureServices(IServiceCollection services)
5558
}
5659

5760
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
58-
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
61+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
5962
{
6063
if (env.IsDevelopment())
6164
{
@@ -72,7 +75,13 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
7275
app.UseStaticFiles();
7376
app.UseCookiePolicy();
7477

75-
app.UseMvc();
78+
app.UseRouting();
79+
app.UseAuthorization();
80+
app.UseEndpoints(endpoints =>
81+
{
82+
endpoints.MapControllers();
83+
endpoints.MapRazorPages();
84+
});
7685
}
7786

7887
public static string GetAbsolutePath(string relativePath)
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
5-
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
65
</PropertyGroup>
76

87

98
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.App" />
11-
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
129
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
1310
<PackageReference Include="Microsoft.Extensions.ML" Version="$(MicrosoftMLVersion)" />
1411
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
1512
<PackageReference Include="Microsoft.ML.ImageAnalytics" Version="$(MicrosoftMLVersion)" />
1613
<PackageReference Include="Microsoft.ML.TensorFlow" Version="$(MicrosoftMLVersion)" />
17-
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.15.0" />
14+
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="2.3.0" />
1815
</ItemGroup>
1916

2017
<ItemGroup>

samples/csharp/end-to-end-apps/DeepLearning_ImageClassification_TensorFlow/TensorFlowImageClassification.sln samples/csharp/end-to-end-apps/DeepLearning_ImageClassification_TF/TensorFlowImageClassification.sln

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.28803.202
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowImageClassification", "TensorFlowImageClassification\TensorFlowImageClassification.csproj", "{3B0E6181-5C60-45D7-A722-A4AC13103DC5}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TFImageClassification", "TFImageClassification\TFImageClassification.csproj", "{A1F1D6DD-7AA0-4378-B9CB-CDFB0B460E93}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{3B0E6181-5C60-45D7-A722-A4AC13103DC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{3B0E6181-5C60-45D7-A722-A4AC13103DC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{3B0E6181-5C60-45D7-A722-A4AC13103DC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{3B0E6181-5C60-45D7-A722-A4AC13103DC5}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{A1F1D6DD-7AA0-4378-B9CB-CDFB0B460E93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{A1F1D6DD-7AA0-4378-B9CB-CDFB0B460E93}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{A1F1D6DD-7AA0-4378-B9CB-CDFB0B460E93}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{A1F1D6DD-7AA0-4378-B9CB-CDFB0B460E93}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE

samples/csharp/end-to-end-apps/DeepLearning_ImageClassification_TensorFlow/TensorFlowImageClassification/Pages/_ViewImports.cshtml

-3
This file was deleted.

samples/csharp/end-to-end-apps/Model-Explainability/TaxiFarePrediction.Test/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace TaxiFareRegression
77
{
88
internal static class Program
99
{
10-
private static string BaseRelativePath = @"../../../../TaxiFarePrediction";
10+
private static string BaseRelativePath = @"../../../../TaxiFarePrediction/TaxiFarePredictionConsoleApp";
1111
private static string BaseDataPath = Path.Combine(Path.GetFullPath(BaseRelativePath), "inputs");
1212
private static string TestDataPath = Path.Combine(BaseDataPath, "taxi-fare-test.csv");
1313
private static string ModelPath = Path.Combine(BaseRelativePath, "outputs", "TaxiFareModel.zip");

samples/csharp/end-to-end-apps/Model-Explainability/TaxiFarePrediction.Test/TaxiFarePrediction.Test.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

samples/csharp/end-to-end-apps/ObjectDetection-Onnx/OnnxObjectDetectionApp/OnnxObjectDetectionApp.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<ItemGroup>
1010
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
1111
<PackageReference Include="Microsoft.ML.ImageAnalytics" Version="$(MicrosoftMLVersion)" />
12+
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.4.0" />
1213
<PackageReference Include="Microsoft.ML.OnnxTransformer" Version="$(MicrosoftMLVersion)" />
1314
<PackageReference Include="Microsoft.Windows.Compatibility" Version="3.1.0-preview2.19523.17" />
1415
<PackageReference Include="OpenCvSharp3-AnyCPU" Version="4.0.0.20181129" />

samples/csharp/end-to-end-apps/ObjectDetection-Onnx/OnnxObjectDetectionWeb/OnnxObjectDetectionWeb.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<PackageReference Include="Microsoft.Extensions.ML" Version="$(MicrosoftMLVersion)" />
3333
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
3434
<PackageReference Include="Microsoft.ML.ImageAnalytics" Version="$(MicrosoftMLVersion)" />
35+
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.4.0" />
3536
<PackageReference Include="Microsoft.ML.OnnxTransformer" Version="$(MicrosoftMLVersion)" />
3637
</ItemGroup>
3738

samples/csharp/end-to-end-apps/ObjectDetection-Onnx/README.md

+1-1

samples/csharp/end-to-end-apps/Recommendation-MovieRecommender/MovieRecommender/movierecommender/MovieRecommender.csproj

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<LangVersion>latest</LangVersion>
66
</PropertyGroup>
77

88
<ItemGroup>
99
<PackageReference Include="CsvHelper" Version="12.1.1" />
10-
<PackageReference Include="Microsoft.AspNetCore.App" />
1110
<PackageReference Include="Microsoft.Extensions.ML" Version="$(MicrosoftMLVersion)" />
1211
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
13-
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
1412
</ItemGroup>
1513
<ItemGroup>
1614
<Content Update="wwwroot\images\smileybob.png">

samples/csharp/end-to-end-apps/Recommendation-MovieRecommender/MovieRecommender/movierecommender/Startup.cs

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using Microsoft.AspNetCore.Builder;
22
using Microsoft.AspNetCore.Hosting;
3-
using Microsoft.AspNetCore.Mvc;
43
using Microsoft.Extensions.Configuration;
54
using Microsoft.Extensions.DependencyInjection;
5+
using Microsoft.Extensions.Hosting;
66
using Microsoft.Extensions.ML;
77
using movierecommender.Services;
88
using MovieRecommender.DataStructures;
@@ -25,11 +25,12 @@ public void ConfigureServices(IServiceCollection services)
2525
services.AddSingleton<IMovieService, MovieService>();
2626
services.AddPredictionEnginePool<MovieRating, MovieRatingPrediction>().FromFile(Configuration["MLModelPath"]);
2727

28-
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
28+
services.AddControllersWithViews();
29+
services.AddRazorPages();
2930
}
3031

3132
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
32-
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
33+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
3334
{
3435
if (env.IsDevelopment())
3536
{
@@ -42,12 +43,13 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
4243

4344
app.UseStaticFiles();
4445

45-
app.UseMvc(routes =>
46+
app.UseRouting();
47+
app.UseAuthorization();
48+
app.UseEndpoints(endpoints =>
4649
{
47-
routes.MapRoute(
48-
name: "default",
49-
template: "{controller=Movies}/{action=Profiles}/{id?}");
50+
endpoints.MapRazorPages();
51+
endpoints.MapControllerRoute("default", "{controller=Movies}/{action=Profiles}/{id?}");
5052
});
5153
}
5254
}
53-
}
55+
}

samples/csharp/end-to-end-apps/ScalableMLModelOnWebAPI-Custom/src/Scalable.WebAPI/Controllers/PredictorController.cs

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public ActionResult<string> PredictSentiment([FromQuery]string sentimentText)
3232
string retVal = $"Prediction: Is Toxic?: '{isToxic.ToString()}' with {probability.ToString()}% probability of toxicity for the text '{sentimentText}'";
3333

3434
return retVal;
35-
3635
}
3736

3837
public static float CalculatePercentage(double value)

samples/csharp/end-to-end-apps/ScalableMLModelOnWebAPI-Custom/src/Scalable.WebAPI/Scalable.WebAPI.csproj

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
5-
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
65
</PropertyGroup>
76

87
<ItemGroup>
98
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
10-
<PackageReference Include="Microsoft.AspNetCore.App" />
11-
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
129
<PackageReference Include="Microsoft.ML.FastTree" Version="$(MicrosoftMLVersion)" />
13-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.0" />
1410
</ItemGroup>
1511

1612
<ItemGroup>

0 commit comments

Comments
 (0)