Face-Mask-Classifier-Using-ML.NET
ML.NET is a cross-platform open-source machine learning framework that makes machine learning accessible to .NET developers.
ML.NET Model Builder is an intuitive graphical Visual Studio extension to build, train, and deploy custom machine learning models.
Add Machine Learning to a project
Pick a Scenario
Data Folder
Train
Training progress
Training Result
Testing Images
public class ConsumeModel
{
// For more info on consuming ML.NET models, visit https://aka.ms/model-builder-consume
// Method for consuming model in your app
public static ModelOutput Predict(ModelInput input)
{
// Create new MLContext
MLContext mlContext = new MLContext();
// Load model & create prediction engine
string modelPath = @"C:\Users\Hassan-Laptop\AppData\Local\Temp\MLVSTools\ConsoleApp2ML\ConsoleApp2ML.Model\MLModel.zip";
ITransformer mlModel = mlContext.Model.Load(modelPath, out var modelInputSchema);
var predEngine = mlContext.Model.CreatePredictionEngine<ModelInput, ModelOutput>(mlModel);
// Use model to make prediction on input data
ModelOutput result = predEngine.Predict(input);
return result;
}
}