make thumbnail generating multithread

fix the bug with open video
add class distribution chart
This commit is contained in:
Alex Bezdieniezhnykh
2024-09-25 21:46:07 +03:00
parent 742f1ffee9
commit 22d4493d86
11 changed files with 215 additions and 50 deletions
+2 -2
View File
@@ -19,12 +19,12 @@ public class FormState
public ObservableCollection<AnnotationResult> AnnotationResults { get; set; } = [];
public WindowsEnum ActiveWindow { get; set; }
public string GetTimeName(TimeSpan ts) => $"{VideoName}_{ts:hmmssf}";
public string GetTimeName(TimeSpan? ts) => $"{VideoName}_{ts:hmmssf}";
public TimeSpan? GetTime(string name)
{
var timeStr = name.Split("_").LastOrDefault();
if (string.IsNullOrEmpty(timeStr) || timeStr.Length < 7)
if (string.IsNullOrEmpty(timeStr) || timeStr.Length < 6)
return null;
//For some reason, TimeSpan.ParseExact doesn't work on every platform.
+2 -2
View File
@@ -148,9 +148,9 @@ public class YoloLabel : Label
return res;
}
public static async Task<List<YoloLabel>> ReadFromFile(string filename)
public static async Task<List<YoloLabel>> ReadFromFile(string filename, CancellationToken cancellationToken = default)
{
var str = await File.ReadAllTextAsync(filename);
var str = await File.ReadAllTextAsync(filename, cancellationToken);
return str.Split('\n')
.Select(Parse)