public void ClassificationImages(string currentDirectory) { Classes.Clear(); PathImages = new List <string>(Directory.GetFiles(currentDirectory, "*.jpg")); Thread t = new Thread(() => { foreach (string path in PathImages) { ResultClassification imageDataBase = FindInDataBase(path); if (imageDataBase != null) { ExistsCompletedHandler(imageDataBase); } else { NewPathImages.Enqueue(path); } } task = new ThreadClassification(NewPathImages, onnxModel, RecognitionCompletedHandler); task.Run(); }); t.Start(); }
public void ClassificationImages(string path) { Classes.Clear(); task = new ThreadClassification(path, onnxModel, RecognitionCompletedHandler); Thread t = new Thread(() => task.Run()); t.Start(); }