KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
blazor-ml
★ 22
Open GitHub ↗
Example combining Blazor with ML.NET
Download README (.md)
Explore Similar Repositories
M5StickC-uPy
:
Micropython utilities for the M5StickC
Chinese-Error-Checking
:
No description available.
build-vscode-win-arm64
:
No description available.
go-subkey
:
Subkey port in Go
signalling-server
:
No description available.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
blazor-ml
?
Download (.md)
# blazor-ml Example application that shows how to integrate a Blazor server-side application with ML.NET - Users can upload images using the Blazor application, which are classified into one of 1000 labels using the ML.NET model. - The ML.NET model simply loads a pre-trained TensorFlow Google's inception model (available [here](https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/getting-started/DeepLearning_ImageClassification_TensorFlow/ImageClassification/assets/inputs/inception)) The application is discussed in detail in the article [Using Blazor, Tensorflow and ML.NET to Identify Images](https://www.dotnetcurry.com/aspnet-core/1537/blazor-ml-dotnet), published in the DotNetCurry magazine. ## Installation Make sure you have the .NET Core SDK 5.0 installed (download [here](https://dotnet.microsoft.com/download)) and clone this repo. You will see a solution with 2 projects: - The `ModelBuilder` is used to generate the ML.NET model, which is then saved to a ZIP file for the Blazor app to classify uploaded images ```bash cd ModelBuilder dotnet build dotnet run # ML.NET model's zip saved to PredictionModel.zip ``` - The `BlazorClient` provides the server-side Blazor app. Navigate the the *Identify Image* page (or `/identify`) to upload an image (using the [InputFile](https://docs.microsoft.com/en-us/aspnet/core/blazor/file-uploads?view=aspnetcore-5.0&pivots=webassembly) component), which will be classified using the previously saved ML.NET model ```bash cd BlazorClient dotnet build dotnet run # navigate to https://localhost:5001/identify ``` There are sample images in the `SampleImages` folder (see [wikimedia.md](./SampleImages/wikimedia.md) for attribution) which you can use to test the application ### Mac/Linux users The code relies on System.Drawing in order to convert an image into a bitmap. While System.Drawing [is now part of .NET Core](https://www.hanselman.com/blog/HowDoYouUseSystemDrawingInNETCore.aspx) you will probably need to install its GDI+ dependencies: ```bash # Linux sudo apt install libc6-dev sudo apt install libgdiplus # Mac brew install mono-libgdiplus ``` Feel free to try and use alternatives to System.Drawing such as [ImageSharp](https://github.com/SixLabors/ImageSharp). ## Reference - https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/getting-started/DeepLearning_ImageClassification_TensorFlow - https://devblogs.microsoft.com/cesardelatorre/run-with-ml-net-c-code-a-tensorflow-model-exported-from-azure-cognitive-services-custom-vision/ - https://medium.com/machinelearningadvantage/detect-any-object-in-an-image-using-c-and-ml-net-machine-learning-50e606b821a3