public static List <PredResult> Cifar10Test(Cifar10Model model) { string imagePath = string.Format("{0}images\\dog_cls.jpg", AppDomain.CurrentDomain.BaseDirectory); Cifar10 app = new Cifar10(model); app.LoadModel(); return(app.Predict(imagePath)); }
/// <summary> /// Initializes a new instance of the <see cref="Cifar10"/> class. /// </summary> /// <param name="model">The cifar 10 model to use for this application.</param> public Cifar10(Cifar10Model model) { this.model = model; actualValues = new Dictionary <int, string>(); ExpandoObject jsonValues = Newtonsoft.Json.JsonConvert.DeserializeObject <ExpandoObject>(PredMap.Cifar10); foreach (var item in jsonValues) { actualValues.Add(Convert.ToInt32(item.Key), item.Value.ToString()); } }