mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 15:26:30 +00:00
add results pane
differentiate already processed videos
This commit is contained in:
@@ -153,6 +153,7 @@ public partial class MainWindow
|
||||
{
|
||||
Annotations = LoadAnnotations();
|
||||
_formState.AnnotationResults = LoadAnnotationResults();
|
||||
DgAnnotations.ItemsSource = _formState.AnnotationResults;
|
||||
}
|
||||
|
||||
private Dictionary<TimeSpan, List<YoloLabel>> LoadAnnotations()
|
||||
@@ -205,16 +206,23 @@ public partial class MainWindow
|
||||
var dir = new DirectoryInfo(_config.VideosDirectory);
|
||||
if (!dir.Exists)
|
||||
return;
|
||||
|
||||
var labelNames = new DirectoryInfo(_config.LabelsDirectory).GetFiles()
|
||||
.Select(x => x.Name[..^11])
|
||||
.GroupBy(x => x)
|
||||
.Select(gr => gr.Key)
|
||||
.ToDictionary(x => x);
|
||||
|
||||
var files = dir.GetFiles("mp4", "mov").Select(x =>
|
||||
{
|
||||
_mediaPlayer.Media = new Media(_libVLC, x.FullName);
|
||||
|
||||
|
||||
return new VideoFileInfo
|
||||
{
|
||||
Name = x.Name,
|
||||
Path = x.FullName,
|
||||
Duration = TimeSpan.FromMilliseconds(_mediaPlayer.Media.Duration)
|
||||
Duration = TimeSpan.FromMilliseconds(_mediaPlayer.Media.Duration),
|
||||
HasAnnotations = labelNames.ContainsKey(Path.GetFileNameWithoutExtension(x.Name).Replace(" ", ""))
|
||||
};
|
||||
}).ToList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user