Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sps014/BlazorML5
ML5 Machine Learning For Blazor with JSInterop mechanism
https://github.com/sps014/BlazorML5
Last synced: 4 months ago
JSON representation
ML5 Machine Learning For Blazor with JSInterop mechanism
- Host: GitHub
- URL: https://github.com/sps014/BlazorML5
- Owner: sps014
- License: mit
- Created: 2019-12-29T12:55:58.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-14T06:32:20.000Z (over 1 year ago)
- Last Synced: 2024-08-31T13:49:41.069Z (6 months ago)
- Language: C#
- Homepage: https://blazor-ml5-sample.netlify.com/
- Size: 7.38 MB
- Stars: 54
- Watchers: 6
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-blazor - BlazorML5 -  ML5 Machine Learning for Blazor with JSInterop mechanism. (Sample Projects / Machine Learning)
README
# ML5-Blazor
[](https://www.nuget.org/packages/BlazorML5/)
[](https://www.nuget.org/packages/BlazorML5)

### An Easy Machine Learning Library for Blazor.
Now supports both Blazor Server and WASM and MAUI Hybrid.## Current Features
1. Neural Network
2. Image Classification
3. Sound Classifier
4. Object Detector (YOLO and COCOSSD based)
5. PoseNet
6. Sentiment Analyzer
7. FaceMesh#### Hosted Sample
[Live Demo](https://blazor-ml5-sample.netlify.com/)#### Documentation
Install Asp.Net Core payload and then follow [Installation Instructions here](https://github.com/sps014/BlazorML5/wiki/BlazorML5-Installation) to configure ML5 to use it from C# Blazor app.
API documentation can be followed from [here](https://learn.ml5js.org/#/reference/index) after lib configuration.
.#### Sample Neural Network
```cs
@page "/nn"
@using BlazorML5
@using BlazorML5.Helpers
@inject IJSRuntime runtimeIndex
Add Data and Train
@code
{
NeuralNetwork _network;
protected override async Task OnInitializedAsync()
{
await Ml5.InitAsync(runtime);_network = await Ml5.NeuralNetworkAsync(new NeuralNetworkOptions()
{
Task = TaskType.Classification,
DataUrl = "https://raw.githubusercontent.com/ml5js/ml5-library/main/examples/p5js/NeuralNetwork/NeuralNetwork_color_classifier/data/colorData_small.json",
Debug = true,
Inputs = new object[]{"r", "g", "b"},
Outputs = new object[]{"label"}
});
_network.OnTraining+=(l,e)=>
{
Console.WriteLine($"Training: {e}%");
};
_network.OnTrainingComplete+=async ()=>
{
Console.WriteLine($"Training Complete");
await _network.ClassifyMultipleAsync(new object[]{new object[]{12,13,14},new object[]{15,16,17}});
};
_network.OnDataLoaded+=(e)=>
{
Console.WriteLine($"Data Loaded");
};
_network.OnClassify+=async (l,e)=>
{
Console.WriteLine(e.Length);
Console.WriteLine(e[0].Label);
};
_network.OnClassifyMultiple+=async (l,e)=>
{
Console.WriteLine(e.Length);
Console.WriteLine(e[0].Length);
Console.WriteLine(e[0][0].Label);
};}
async void AddData()
{
//data fetched from .csv file no need to manually add and hence directly training
//await _network.NormalizeDataAsync();
await _network.TrainAsync();
}}
```More samples [here](https://github.com/sps014/BlazorML5/tree/master/SampleApp/Pages)