string imgModelPath = System.IO.Path.Combine(assemblyDirectory, "models\\img\\" + "saved_model.pb");
// Load Image AI
await Task.Run(() => ImgAI.StartAI(imgModelPath));
public static async Task StartAI(string modelPath)
{
try
{
// Load the pre-trained model
graph = new TFGraph();
graph.Import(File.ReadAllBytes(modelPath));
}
catch (Exception ex)
{
// Handle the exception (log, display a message, etc.)
MessageBox.Show($"Exception: {ex.Message}");
}
}