mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:46:31 +00:00
add altitude + camera spec component and calc tile size by this
also restrict detections to be no bigger than in classes.json
This commit is contained in:
+74
-66
@@ -22,6 +22,12 @@ public static class Constants
|
||||
|
||||
private const string DEFAULT_ZMQ_LOADER_HOST = "127.0.0.1";
|
||||
private const int DEFAULT_ZMQ_LOADER_PORT = 5025;
|
||||
private static readonly LoaderClientConfig DefaultLoaderClientConfig = new()
|
||||
{
|
||||
ZeroMqHost = DEFAULT_ZMQ_LOADER_HOST,
|
||||
ZeroMqPort = DEFAULT_ZMQ_LOADER_PORT,
|
||||
ApiUrl = DEFAULT_API_URL
|
||||
};
|
||||
|
||||
public const string EXTERNAL_LOADER_PATH = "azaion-loader.exe";
|
||||
public const string EXTERNAL_INFERENCE_PATH = "azaion-inference.exe";
|
||||
@@ -31,24 +37,32 @@ public static class Constants
|
||||
public const string DEFAULT_ZMQ_INFERENCE_HOST = "127.0.0.1";
|
||||
private const int DEFAULT_ZMQ_INFERENCE_PORT = 5227;
|
||||
|
||||
private static readonly InferenceClientConfig DefaultInferenceClientConfig = new()
|
||||
{
|
||||
ZeroMqHost = DEFAULT_ZMQ_INFERENCE_HOST,
|
||||
ZeroMqPort = DEFAULT_ZMQ_INFERENCE_PORT,
|
||||
ApiUrl = DEFAULT_API_URL
|
||||
};
|
||||
|
||||
private const string DEFAULT_ZMQ_GPS_DENIED_HOST = "127.0.0.1";
|
||||
private const int DEFAULT_ZMQ_GPS_DENIED_PORT = 5255;
|
||||
private const int DEFAULT_ZMQ_GPS_DENIED_PUBLISH_PORT = 5256;
|
||||
private static readonly GpsDeniedClientConfig DefaultGpsDeniedClientConfig = new()
|
||||
{
|
||||
ZeroMqHost = DEFAULT_ZMQ_GPS_DENIED_HOST,
|
||||
ZeroMqPort = DEFAULT_ZMQ_GPS_DENIED_PORT,
|
||||
ZeroMqReceiverPort = DEFAULT_ZMQ_GPS_DENIED_PUBLISH_PORT
|
||||
};
|
||||
|
||||
#endregion ExternalClientsConfig
|
||||
|
||||
# region Cache keys
|
||||
|
||||
public const string CURRENT_USER_CACHE_KEY = "CurrentUser";
|
||||
public const string HARDWARE_INFO_KEY = "HardwareInfo";
|
||||
|
||||
# endregion
|
||||
|
||||
public const string JPG_EXT = ".jpg";
|
||||
public const string TXT_EXT = ".txt";
|
||||
#region DirectoriesConfig
|
||||
|
||||
private const string DEFAULT_VIDEO_DIR = "video";
|
||||
public const string DEFAULT_VIDEO_DIR = "video";
|
||||
private const string DEFAULT_LABELS_DIR = "labels";
|
||||
private const string DEFAULT_IMAGES_DIR = "images";
|
||||
private const string DEFAULT_RESULTS_DIR = "results";
|
||||
@@ -58,31 +72,35 @@ public static class Constants
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region AnnotatorConfig
|
||||
|
||||
private static readonly List<DetectionClass> DefaultAnnotationClasses =
|
||||
public static readonly List<DetectionClass> DefaultAnnotationClasses =
|
||||
[
|
||||
new() { Id = 0, Name = "ArmorVehicle", ShortName = "Броня", Color = "#FF0000".ToColor() },
|
||||
new() { Id = 1, Name = "Truck", ShortName = "Вантаж.", Color = "#00FF00".ToColor() },
|
||||
new() { Id = 2, Name = "Vehicle", ShortName = "Машина", Color = "#0000FF".ToColor() },
|
||||
new() { Id = 3, Name = "Artillery", ShortName = "Арта", Color = "#FFFF00".ToColor() },
|
||||
new() { Id = 4, Name = "Shadow", ShortName = "Тінь", Color = "#FF00FF".ToColor() },
|
||||
new() { Id = 5, Name = "Trenches", ShortName = "Окопи", Color = "#00FFFF".ToColor() },
|
||||
new() { Id = 6, Name = "MilitaryMan", ShortName = "Військов", Color = "#188021".ToColor() },
|
||||
new() { Id = 7, Name = "TyreTracks", ShortName = "Накати", Color = "#800000".ToColor() },
|
||||
new() { Id = 8, Name = "AdditionArmoredTank",ShortName = "Танк.захист", Color = "#008000".ToColor() },
|
||||
new() { Id = 9, Name = "Smoke", ShortName = "Дим", Color = "#000080".ToColor() },
|
||||
new() { Id = 10, Name = "Plane", ShortName = "Літак", Color = "#000080".ToColor() },
|
||||
new() { Id = 11, Name = "Moto", ShortName = "Мото", Color = "#808000".ToColor() },
|
||||
new() { Id = 12, Name = "CamouflageNet", ShortName = "Сітка", Color = "#800080".ToColor() },
|
||||
new() { Id = 13, Name = "CamouflageBranches", ShortName = "Гілки", Color = "#2f4f4f".ToColor() },
|
||||
new() { Id = 14, Name = "Roof", ShortName = "Дах", Color = "#1e90ff".ToColor() },
|
||||
new() { Id = 15, Name = "Building", ShortName = "Будівля", Color = "#ffb6c1".ToColor() },
|
||||
new() { Id = 16, Name = "Caponier", ShortName = "Капонір", Color = "#ffb6c1".ToColor() },
|
||||
new() { Id = 0, Name = "ArmorVehicle", ShortName = "Броня", Color = "#FF0000".ToColor(), MaxSizeM = 7 },
|
||||
new() { Id = 1, Name = "Truck", ShortName = "Вантаж.", Color = "#00FF00".ToColor(), MaxSizeM = 8 },
|
||||
new() { Id = 2, Name = "Vehicle", ShortName = "Машина", Color = "#0000FF".ToColor(), MaxSizeM = 7 },
|
||||
new() { Id = 3, Name = "Artillery", ShortName = "Арта", Color = "#FFFF00".ToColor(), MaxSizeM = 14 },
|
||||
new() { Id = 4, Name = "Shadow", ShortName = "Тінь", Color = "#FF00FF".ToColor(), MaxSizeM = 9 },
|
||||
new() { Id = 5, Name = "Trenches", ShortName = "Окопи", Color = "#00FFFF".ToColor(), MaxSizeM = 10 },
|
||||
new() { Id = 6, Name = "MilitaryMan", ShortName = "Військов", Color = "#188021".ToColor(), MaxSizeM = 2 },
|
||||
new() { Id = 7, Name = "TyreTracks", ShortName = "Накати", Color = "#800000".ToColor(), MaxSizeM = 5 },
|
||||
new() { Id = 8, Name = "AdditionArmoredTank",ShortName = "Танк.захист", Color = "#008000".ToColor(), MaxSizeM = 7 },
|
||||
new() { Id = 9, Name = "Smoke", ShortName = "Дим", Color = "#000080".ToColor(), MaxSizeM = 8 },
|
||||
new() { Id = 10, Name = "Plane", ShortName = "Літак", Color = "#000080".ToColor(), MaxSizeM = 12 },
|
||||
new() { Id = 11, Name = "Moto", ShortName = "Мото", Color = "#808000".ToColor(), MaxSizeM = 3 },
|
||||
new() { Id = 12, Name = "CamouflageNet", ShortName = "Сітка", Color = "#800080".ToColor(), MaxSizeM = 14 },
|
||||
new() { Id = 13, Name = "CamouflageBranches", ShortName = "Гілки", Color = "#2f4f4f".ToColor(), MaxSizeM = 8 },
|
||||
new() { Id = 14, Name = "Roof", ShortName = "Дах", Color = "#1e90ff".ToColor(), MaxSizeM = 15 },
|
||||
new() { Id = 15, Name = "Building", ShortName = "Будівля", Color = "#ffb6c1".ToColor(), MaxSizeM = 20 },
|
||||
new() { Id = 16, Name = "Caponier", ShortName = "Капонір", Color = "#ffb6c1".ToColor(), MaxSizeM = 10 },
|
||||
new() { Id = 17, Name = "Ammo", ShortName = "БК", Color = "#33658a".ToColor(), MaxSizeM = 2 },
|
||||
new() { Id = 18, Name = "Protect.Struct", ShortName = "Зуби.драк", Color = "#969647".ToColor(), MaxSizeM = 2 }
|
||||
];
|
||||
|
||||
private static readonly List<string> DefaultVideoFormats = ["mp4", "mov", "avi"];
|
||||
private static readonly List<string> DefaultImageFormats = ["jpg", "jpeg", "png", "bmp"];
|
||||
public static readonly List<string> DefaultVideoFormats = ["mp4", "mov", "avi", "ts"];
|
||||
public static readonly List<string> DefaultImageFormats = ["jpg", "jpeg", "png", "bmp"];
|
||||
|
||||
private static readonly AnnotationConfig DefaultAnnotationConfig = new()
|
||||
{
|
||||
@@ -91,9 +109,26 @@ public static class Constants
|
||||
ImageFormats = DefaultImageFormats,
|
||||
AnnotationsDbFile = DEFAULT_ANNOTATIONS_DB_FILE
|
||||
};
|
||||
|
||||
private const int DEFAULT_LEFT_PANEL_WIDTH = 250;
|
||||
private const int DEFAULT_RIGHT_PANEL_WIDTH = 250;
|
||||
|
||||
#region UIConfig
|
||||
public const int DEFAULT_LEFT_PANEL_WIDTH = 200;
|
||||
public const int DEFAULT_RIGHT_PANEL_WIDTH = 200;
|
||||
#endregion UIConfig
|
||||
|
||||
#region CameraConfig
|
||||
|
||||
public const int DEFAULT_ALTITUDE = 400;
|
||||
public const decimal DEFAULT_CAMERA_FOCAL_LENGTH = 24m;
|
||||
public const decimal DEFAULT_CAMERA_SENSOR_WIDTH = 23.5m;
|
||||
|
||||
public static readonly CameraConfig DefaultCameraConfig = new()
|
||||
{
|
||||
Altitude = DEFAULT_ALTITUDE,
|
||||
CameraFocalLength = DEFAULT_CAMERA_FOCAL_LENGTH,
|
||||
CameraSensorWidth = DEFAULT_CAMERA_SENSOR_WIDTH
|
||||
};
|
||||
|
||||
#endregion CameraConfig
|
||||
|
||||
private const string DEFAULT_ANNOTATIONS_DB_FILE = "annotations.db";
|
||||
|
||||
@@ -154,6 +189,7 @@ public static class Constants
|
||||
public const string ANNOTATIONS_QUEUE_TABLENAME = "annotations_queue";
|
||||
public const string ADMIN_EMAIL = "admin@azaion.com";
|
||||
public const string DETECTIONS_TABLENAME = "detections";
|
||||
public const string MEDIAFILE_TABLENAME = "mediafiles";
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -170,28 +206,14 @@ public static class Constants
|
||||
|
||||
private static readonly InitConfig DefaultInitConfig = new()
|
||||
{
|
||||
LoaderClientConfig = new LoaderClientConfig
|
||||
{
|
||||
ZeroMqHost = DEFAULT_ZMQ_LOADER_HOST,
|
||||
ZeroMqPort = DEFAULT_ZMQ_LOADER_PORT,
|
||||
ApiUrl = DEFAULT_API_URL
|
||||
},
|
||||
InferenceClientConfig = new InferenceClientConfig
|
||||
{
|
||||
ZeroMqHost = DEFAULT_ZMQ_INFERENCE_HOST,
|
||||
ZeroMqPort = DEFAULT_ZMQ_INFERENCE_PORT,
|
||||
ApiUrl = DEFAULT_API_URL
|
||||
},
|
||||
GpsDeniedClientConfig = new GpsDeniedClientConfig
|
||||
{
|
||||
ZeroMqHost = DEFAULT_ZMQ_GPS_DENIED_HOST,
|
||||
ZeroMqPort = DEFAULT_ZMQ_GPS_DENIED_PORT,
|
||||
ZeroMqReceiverPort = DEFAULT_ZMQ_GPS_DENIED_PUBLISH_PORT
|
||||
},
|
||||
LoaderClientConfig = DefaultLoaderClientConfig,
|
||||
InferenceClientConfig = DefaultInferenceClientConfig,
|
||||
GpsDeniedClientConfig = DefaultGpsDeniedClientConfig,
|
||||
DirectoriesConfig = new DirectoriesConfig
|
||||
{
|
||||
ApiResourcesDirectory = ""
|
||||
}
|
||||
},
|
||||
CameraConfig = DefaultCameraConfig
|
||||
};
|
||||
|
||||
public static readonly AppConfig FailsafeAppConfig = new()
|
||||
@@ -220,24 +242,10 @@ public static class Constants
|
||||
AIRecognitionConfig = DefaultAIRecognitionConfig,
|
||||
GpsDeniedConfig = DefaultGpsDeniedConfig,
|
||||
|
||||
LoaderClientConfig = new LoaderClientConfig
|
||||
{
|
||||
ZeroMqHost = DEFAULT_ZMQ_LOADER_HOST,
|
||||
ZeroMqPort = DEFAULT_ZMQ_LOADER_PORT,
|
||||
ApiUrl = DEFAULT_API_URL
|
||||
},
|
||||
InferenceClientConfig = new InferenceClientConfig
|
||||
{
|
||||
ZeroMqHost = DEFAULT_ZMQ_INFERENCE_HOST,
|
||||
ZeroMqPort = DEFAULT_ZMQ_INFERENCE_PORT,
|
||||
ApiUrl = DEFAULT_API_URL
|
||||
},
|
||||
GpsDeniedClientConfig = new GpsDeniedClientConfig
|
||||
{
|
||||
ZeroMqHost = DEFAULT_ZMQ_GPS_DENIED_HOST,
|
||||
ZeroMqPort = DEFAULT_ZMQ_GPS_DENIED_PORT,
|
||||
ZeroMqReceiverPort = DEFAULT_ZMQ_GPS_DENIED_PUBLISH_PORT
|
||||
}
|
||||
LoaderClientConfig = DefaultLoaderClientConfig,
|
||||
InferenceClientConfig = DefaultInferenceClientConfig,
|
||||
GpsDeniedClientConfig = DefaultGpsDeniedClientConfig,
|
||||
CameraConfig = DefaultCameraConfig
|
||||
};
|
||||
|
||||
public static InitConfig ReadInitConfig(ILogger logger)
|
||||
|
||||
Reference in New Issue
Block a user