mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:46:30 +00:00
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:
@@ -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; }
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Azaion.Common.DTO.Config;
|
||||
|
||||
public class UIConfig
|
||||
{
|
||||
public double LeftPanelWidth { get; set; }
|
||||
public double RightPanelWidth { get; set; }
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user