This repository has been archived by the owner on Mar 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Example Image Classification
Deepak Kumar Battini edited this page Nov 13, 2017
·
2 revisions
using SiaNet;
using SiaNet.Application;
using SiaNet.Common;
GlobalParameters.Device = CNTK.DeviceDescriptor.CPUDevice;
Logging.OnWriteLog += Logging_OnWriteLog;
string imagePath = "path-to-jpeg-or-png-image";
ImageNet app = new ImageNet(ImageNetModel.ResNet50);
app.LoadModel();
var predictions = app.Predict(imagePath);
foreach (var item in predictions)
{
Console.WriteLine("Category: {0}, Score: {1}", item.Name, item.Score);
}
using SiaNet.Application;
using SiaNet.Common;
string imagePath = "path-to-jpeg-or-png-image";
Cifar10 app = new Cifar10(Cifar10Model.ResNet110);
app.LoadModel();
var predictions = app.Predict(imagePath);
foreach (var item in predictions)
{
Console.WriteLine("Category: {0}, Score: {1}", item.Name, item.Score);
}
private static void Logging_OnWriteLog(string message)
{
Console.WriteLine("Log: " + message); ;
}