private async void RunDarknetVideo_Impl() { ConsoleLog("Viewing " + Path.GetFileName(VideoPath) + ". You can continue using the app."); Stopwatch watch = new Stopwatch(); watch.Start(); await(Task.Run(Async_VideoTagging_Start).ConfigureAwait(true)); // await (Task.Run(() => { API_ImageDetection.TagVideo(VideoPath, true); }).ConfigureAwait(true)); watch.Stop(); ConsoleLog("Video completed in " + Benchmarking.TimePassed(watch), "Find ouput in videos folder."); }
/* Runs YOLO Image classification for the queued list of images. */ private async void RunYOLO_Impl() { if (ShowResultImage) { ConsoleLog("Tagging " + ImageQueue.Count + " images.", "(Close image popups to advance.)"); } else { ConsoleLog("Tagging " + ImageQueue.Count + " images.", "(Silent mode.)"); } // MessageBox.Show(Environment.CurrentDirectory); Stopwatch watch = new Stopwatch(); watch.Start(); List <String> OneQueue = new List <String>(); foreach (var str in ImageQueue) { OneQueue.Add(str); } if (ShowResultImage) { await(Task.Run(() => { TagImages_AlwaysShow_Task(OneQueue); }).ConfigureAwait(true)); } else { await(Task.Run(() => { TagImages_NeverShow_Task(OneQueue, "ImageData"); }).ConfigureAwait(true)); } // TagImages_AlwaysShow_Task watch.Stop(); ConsoleLog("Tagged " + ImageQueue.Count + " images in " + Benchmarking.TimePassed(watch), "(Showing tagged images as well.)"); }
private async void GenerateImageBatch_Impl() { ConsoleLog("Batching images from " + Path.GetFileName(VideoPath)); Stopwatch watch = new Stopwatch(); watch.Start(); // Populates images in "{ProjectDir}/ImageBatch"... await(Task.Run(GenerateImageBatch_Task).ConfigureAwait(true)); ConsoleLog("(1/3) Batching complete. Preparing list..."); // Makes a list of images from "{ProjectDir}/ImageBatch"... await(Task.Run(MakeImageQueueFileFromFolder_Task).ConfigureAwait(true)); ConsoleLog("(2/3) List prepared. Proceeding with detection..."); String QueueFileDir = Path.Combine(Properties.Settings.Default.ProjectDir, "ImageBatch", "ImageQueue.txt"); await(Task.Run(() => { TagImages_NeverShow_Task(QueueFileDir); }).ConfigureAwait(true)); ConsoleLog("(3/3) Completed tagging images."); watch.Stop(); ConsoleLog("Video taggin completed in " + Benchmarking.TimePassed(watch)); }