Skip to content

Commit

Permalink
1.5 mlnet update (#839)
Browse files Browse the repository at this point in the history
* 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 (#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]>
  • Loading branch information
3 people authored Aug 24, 2020
1 parent 5308cda commit 81cae9a
Show file tree
Hide file tree
Showing 378 changed files with 4,024 additions and 293 deletions.
Binary file added samples/.ionide/symbolCache.db
Binary file not shown.
4 changes: 2 additions & 2 deletions samples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>

<PropertyGroup>
<MicrosoftMLVersion>1.4.0</MicrosoftMLVersion>
<MicrosoftMLPreviewVersion>0.16.0</MicrosoftMLPreviewVersion>
<MicrosoftMLVersion>1.5.0</MicrosoftMLVersion>
<MicrosoftMLPreviewVersion>0.17.0</MicrosoftMLPreviewVersion>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.ML;
using TensorFlowImageClassification.ImageHelpers;
using TensorFlowImageClassification.ML.DataModels;
using TFClassification.ML.DataModels;
using TFImageClassification.ImageHelpers;
using TFImageClassification.ML.DataModels;

namespace TensorFlowImageClassification.Controllers
namespace TFImageClassification.Controllers
{
[Route("api/[controller]")]
[ApiController]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq;
using System.Text;

namespace TensorFlowImageClassification.ImageHelpers
namespace TFImageClassification.ImageHelpers
{
public static class ImageValidationExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.IO;
using System.Linq;

namespace TensorFlowImageClassification.ML.DataModels
namespace TFImageClassification.ML.DataModels
{
public class ImageInputData
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using Microsoft.ML.Data;

namespace TensorFlowImageClassification.ML.DataModels
namespace TFClassification.ML.DataModels
{
public class ImageLabelPredictions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

namespace TensorFlowImageClassification.ML.DataModels
namespace TFClassification.ML.DataModels
{
public class ImagePredictedLabelWithProbability
{
public string ImageId;

public string PredictedLabel;
public string PredictedLabel { get; set; }
public float Probability { get; set; }

public long PredictionExecutionTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.ML;
using System.Threading;

namespace TensorFlowImageClassification.ML
namespace TFClassification.ML
{
public class InMemoryModelLoader : ModelLoader
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Microsoft.ML;
using System.Collections.Generic;
using System.Linq;
using TensorFlowImageClassification.ML.DataModels;
using TFImageClassification.ML.DataModels;

namespace TensorFlowImageClassification.ML
namespace TFImageClassification.ML
{
public class TensorFlowModelConfigurator
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace TensorFlowImageClassification.Pages
namespace TFImageClassification.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public class ErrorModel : PageModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace TensorFlowImageClassification.Pages
namespace TFImageClassification.Pages
{
public class IndexModel : PageModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace TensorFlowImageClassification.Pages
namespace TFImageClassification.Pages
{
public class PrivacyModel : PageModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@using TFImageClassification
@namespace TFImageClassification.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace TensorFlowImageClassification
namespace TFImageClassification
{
public class Program
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.ML;
using Microsoft.Extensions.Hosting;
using Microsoft.ML;
using TensorFlowImageClassification.ML;
using TensorFlowImageClassification.ML.DataModels;
using TFImageClassification.ML;
using TFImageClassification.ML.DataModels;
using TFClassification.ML.DataModels;
using TFClassification.ML;

namespace TensorFlowImageClassification
namespace TFImageClassification
{
public class Startup
{
Expand Down Expand Up @@ -41,7 +43,8 @@ public void ConfigureServices(IServiceCollection services)
options.MinimumSameSitePolicy = SameSiteMode.None;
});

services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.AddControllers();
services.AddRazorPages();

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

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
Expand All @@ -72,7 +75,13 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseStaticFiles();
app.UseCookiePolicy();

app.UseMvc();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapRazorPages();
});
}

public static string GetAbsolutePath(string relativePath)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="Microsoft.Extensions.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML.ImageAnalytics" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML.TensorFlow" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.15.0" />
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="2.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.202
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowImageClassification", "TensorFlowImageClassification\TensorFlowImageClassification.csproj", "{3B0E6181-5C60-45D7-A722-A4AC13103DC5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TFImageClassification", "TFImageClassification\TFImageClassification.csproj", "{A1F1D6DD-7AA0-4378-B9CB-CDFB0B460E93}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3B0E6181-5C60-45D7-A722-A4AC13103DC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B0E6181-5C60-45D7-A722-A4AC13103DC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B0E6181-5C60-45D7-A722-A4AC13103DC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B0E6181-5C60-45D7-A722-A4AC13103DC5}.Release|Any CPU.Build.0 = Release|Any CPU
{A1F1D6DD-7AA0-4378-B9CB-CDFB0B460E93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1F1D6DD-7AA0-4378-B9CB-CDFB0B460E93}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1F1D6DD-7AA0-4378-B9CB-CDFB0B460E93}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1F1D6DD-7AA0-4378-B9CB-CDFB0B460E93}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace TaxiFareRegression
{
internal static class Program
{
private static string BaseRelativePath = @"../../../../TaxiFarePrediction";
private static string BaseRelativePath = @"../../../../TaxiFarePrediction/TaxiFarePredictionConsoleApp";
private static string BaseDataPath = Path.Combine(Path.GetFullPath(BaseRelativePath), "inputs");
private static string TestDataPath = Path.Combine(BaseDataPath, "taxi-fare-test.csv");
private static string ModelPath = Path.Combine(BaseRelativePath, "outputs", "TaxiFareModel.zip");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML.ImageAnalytics" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.4.0" />
<PackageReference Include="Microsoft.ML.OnnxTransformer" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="3.1.0-preview2.19523.17" />
<PackageReference Include="OpenCvSharp3-AnyCPU" Version="4.0.0.20181129" />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<PackageReference Include="Microsoft.Extensions.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML.ImageAnalytics" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.4.0" />
<PackageReference Include="Microsoft.ML.OnnxTransformer" Version="$(MicrosoftMLVersion)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| ML.NET version | API type | Status | App Type | Data type | Scenario | ML Task | Algorithms |
|----------------|-------------|------------|-------------|-------------|------------------|---------------|-----------------------------------|
| v1.4 | Dynamic API | Up-to-date | End-End app | image files | Object Detection | Deep Learning | ONNX: Tiny YOLOv2 & Custom Vision |
| v1.5.0 | Dynamic API | Up-to-date | End-End app | image files | Object Detection | Deep Learning | ONNX: Tiny YOLOv2 & Custom Vision |

## Problem

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="12.1.1" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<Content Update="wwwroot\images\smileybob.png">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.ML;
using movierecommender.Services;
using MovieRecommender.DataStructures;
Expand All @@ -25,11 +25,12 @@ public void ConfigureServices(IServiceCollection services)
services.AddSingleton<IMovieService, MovieService>();
services.AddPredictionEnginePool<MovieRating, MovieRatingPrediction>().FromFile(Configuration["MLModelPath"]);

services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.AddControllersWithViews();
services.AddRazorPages();
}

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

app.UseStaticFiles();

app.UseMvc(routes =>
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
routes.MapRoute(
name: "default",
template: "{controller=Movies}/{action=Profiles}/{id?}");
endpoints.MapRazorPages();
endpoints.MapControllerRoute("default", "{controller=Movies}/{action=Profiles}/{id?}");
});
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public ActionResult<string> PredictSentiment([FromQuery]string sentimentText)
string retVal = $"Prediction: Is Toxic?: '{isToxic.ToString()}' with {probability.ToString()}% probability of toxicity for the text '{sentimentText}'";

return retVal;

}

public static float CalculatePercentage(double value)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.ML.FastTree" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 81cae9a

Please sign in to comment.