From 8869a9273083566ab79e138e39fee450bde1b082 Mon Sep 17 00:00:00 2001 From: Oleksandr Bezdieniezhnykh Date: Sat, 20 Jul 2024 18:34:37 +0300 Subject: [PATCH] get label files more carefully put warning min log level put filename to the title --- Azaion.Annotator/App.xaml.cs | 2 +- Azaion.Annotator/DTO/Config.cs | 3 --- Azaion.Annotator/MainWindow.xaml.cs | 2 +- Azaion.Annotator/PlayerControlHandler.cs | 1 + Azaion.Annotator/config.json | 4 ++-- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Azaion.Annotator/App.xaml.cs b/Azaion.Annotator/App.xaml.cs index f161719..d59187a 100644 --- a/Azaion.Annotator/App.xaml.cs +++ b/Azaion.Annotator/App.xaml.cs @@ -26,7 +26,7 @@ public partial class App : Application { Log.Logger = new LoggerConfiguration() .Enrich.FromLogContext() - .MinimumLevel.Information() + .MinimumLevel.Warning() .WriteTo.Console() .WriteTo.File( path: "Logs/log.txt", diff --git a/Azaion.Annotator/DTO/Config.cs b/Azaion.Annotator/DTO/Config.cs index 57263eb..7a19d51 100644 --- a/Azaion.Annotator/DTO/Config.cs +++ b/Azaion.Annotator/DTO/Config.cs @@ -49,9 +49,6 @@ public class FileConfigRepository(ILogger logger) : IConfi var exePath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)!; var configFilePath = Path.Combine(exePath, CONFIG_PATH); - logger.LogInformation($"exePath: {exePath}" ); - logger.LogInformation($"configFilePath: {configFilePath}"); - if (!File.Exists(configFilePath)) { return new Config diff --git a/Azaion.Annotator/MainWindow.xaml.cs b/Azaion.Annotator/MainWindow.xaml.cs index 2ca2c71..f348576 100644 --- a/Azaion.Annotator/MainWindow.xaml.cs +++ b/Azaion.Annotator/MainWindow.xaml.cs @@ -171,7 +171,7 @@ public partial class MainWindow if (!labelDir.Exists) return; - var labelFiles = labelDir.GetFiles($"{_formState.VideoName}_*"); + var labelFiles = labelDir.GetFiles($"{_formState.VideoName}_??????.txt"); foreach (var file in labelFiles) { var name = Path.GetFileNameWithoutExtension(file.Name); diff --git a/Azaion.Annotator/PlayerControlHandler.cs b/Azaion.Annotator/PlayerControlHandler.cs index 8cdbcc1..e15f137 100644 --- a/Azaion.Annotator/PlayerControlHandler.cs +++ b/Azaion.Annotator/PlayerControlHandler.cs @@ -182,6 +182,7 @@ public class PlayerControlHandler(LibVLC libVLC, MediaPlayer mediaPlayer, MainWi mediaPlayer.Stop(); mediaPlayer.Play(new Media(libVLC, fileInfo.Path)); + mainWindow.Title = $"Azaion Annotator - {fileInfo.Name}"; mainWindow.BlinkHelp(HelpTexts.HelpTextsDict[HelpTextEnum.PauseForAnnotations]); } diff --git a/Azaion.Annotator/config.json b/Azaion.Annotator/config.json index 26fac4e..22b6c0c 100644 --- a/Azaion.Annotator/config.json +++ b/Azaion.Annotator/config.json @@ -1,5 +1,5 @@ { - "VideosDirectory": "E:\\Azaion3\\VideosDone", + "VideosDirectory": "E:\\Azaion3\\Videos", "LabelsDirectory": "E:\\labels", "ImagesDirectory": "E:\\images", "ResultsDirectory": "E:\\results", @@ -54,7 +54,7 @@ }, { "Id": 8, - "Name": "Танк з додатковим захистом", + "Name": "Танк з захистом", "Color": "#80008000", "ColorBrush": "#80008000" },