static void Main(string[] args) { var model = new OnnxModel("/Users/vladimirlisovoi/desktop/prak1/img"); model.EventResult += PredictionHandler; model.OutputEvent += OutputHandler; model.Work(); }
private void StartCommandHandler(object sender, ExecutedRoutedEventArgs e) { this.isWorking = true; resultcollection.Clear(); imagecollection.Clear(); classcollection.Clear(); ThreadPool.QueueUserWorkItem(new WaitCallback(param => { foreach (string path in Directory.GetFiles(selected_dir, "*.jpg")) { Dispatcher.BeginInvoke(new Action(() => { imagecollection.Add(new Image(path)); })); } })); mdl = new OnnxModel(selected_dir); mdl.EventResult += OutputHandler; mdl.Work(); }