move detection classes and other system values from local config to remote

forbid non validators to read from queue
create better visualization in detector control
make colors for detection classes more distinguishable
fix bug with removing detection (probably completely)
This commit is contained in:
Alex Bezdieniezhnykh
2025-04-02 19:53:03 +03:00
parent e182547dc8
commit 83ae6a0ae9
19 changed files with 209 additions and 169 deletions
@@ -36,7 +36,4 @@ public class AnnotationConfig
public List<string> ImageFormats { get; set; } = null!;
public string AnnotationsDbFile { get; set; } = null!;
public double LeftPanelWidth { get; set; }
public double RightPanelWidth { get; set; }
}
+12 -9
View File
@@ -18,6 +18,8 @@ public class AppConfig
public AnnotationConfig AnnotationConfig { get; set; } = null!;
public UIConfig UIConfig { get; set; } = null!;
public AIRecognitionConfig AIRecognitionConfig { get; set; } = null!;
public ThumbnailConfig ThumbnailConfig { get; set; } = null!;
@@ -49,10 +51,13 @@ public class ConfigUpdater : IConfigUpdater
VideoFormats = Constants.DefaultVideoFormats,
ImageFormats = Constants.DefaultImageFormats,
AnnotationsDbFile = Constants.DEFAULT_ANNOTATIONS_DB_FILE
},
UIConfig = new UIConfig
{
LeftPanelWidth = Constants.DEFAULT_LEFT_PANEL_WIDTH,
RightPanelWidth = Constants.DEFAULT_RIGHT_PANEL_WIDTH,
AnnotationsDbFile = Constants.DEFAULT_ANNOTATIONS_DB_FILE
},
DirectoriesConfig = new DirectoriesConfig
@@ -84,15 +89,13 @@ public class ConfigUpdater : IConfigUpdater
public void Save(AppConfig config)
{
//Save without sensitive info
//Save only user's config
var publicConfig = new
{
InferenceClientConfig = config.InferenceClientConfig,
GpsDeniedClientConfig = config.GpsDeniedClientConfig,
DirectoriesConfig = config.DirectoriesConfig,
AnnotationConfig = config.AnnotationConfig,
AIRecognitionConfig = config.AIRecognitionConfig,
ThumbnailConfig = config.ThumbnailConfig
config.InferenceClientConfig,
config.GpsDeniedClientConfig,
config.DirectoriesConfig,
config.UIConfig
};
File.WriteAllText(SecurityConstants.CONFIG_PATH, JsonConvert.SerializeObject(publicConfig, Formatting.Indented), Encoding.UTF8);
+7
View File
@@ -0,0 +1,7 @@
namespace Azaion.Common.DTO.Config;
public class UIConfig
{
public double LeftPanelWidth { get; set; }
public double RightPanelWidth { get; set; }
}
+3 -1
View File
@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Azaion.Common.DTO;
public class DetectionClass
public class DetectionClass : ICloneable
{
public int Id { get; set; }
@@ -49,6 +49,8 @@ public class DetectionClass
detClass.PhotoMode = photoMode;
return detClass;
}
public object Clone() => MemberwiseClone();
}
public enum PhotoMode
+2 -2
View File
@@ -26,13 +26,13 @@ public class CanvasLabel : Label
public double Y { get; set; }
public double Width { get; set; }
public double Height { get; set; }
public double? Confidence { get; }
public double Confidence { get; set; }
public CanvasLabel()
{
}
public CanvasLabel(int classNumber, double x, double y, double width, double height, double? confidence = null) : base(classNumber)
public CanvasLabel(int classNumber, double x, double y, double width, double height, double confidence = 1) : base(classNumber)
{
X = x;
Y = y;