mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:36:30 +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:
@@ -18,5 +18,8 @@ public class AIRecognitionConfig
|
||||
[Key("m_bs")] public int ModelBatchSize { get; set; } = 4;
|
||||
|
||||
[Key("ov_p")] public double BigImageTileOverlapPercent { get; set; }
|
||||
[Key("tile_size")] public int TileSize { get; set; }
|
||||
|
||||
[Key("cam_a")] public double Altitude { get; set; }
|
||||
[Key("cam_fl")] public double CameraFocalLength { get; set; }
|
||||
[Key("cam_sw")] public double CameraSensorWidth { get; set; }
|
||||
}
|
||||
@@ -28,6 +28,8 @@ public class AppConfig
|
||||
public MapConfig MapConfig{ get; set; } = null!;
|
||||
|
||||
public GpsDeniedConfig GpsDeniedConfig { get; set; } = null!;
|
||||
|
||||
public CameraConfig CameraConfig { get; set; } = null!;
|
||||
}
|
||||
|
||||
public interface IConfigUpdater
|
||||
@@ -61,7 +63,8 @@ public class ConfigUpdater : IConfigUpdater
|
||||
config.InferenceClientConfig,
|
||||
config.GpsDeniedClientConfig,
|
||||
config.DirectoriesConfig,
|
||||
config.UIConfig
|
||||
config.UIConfig,
|
||||
config.CameraConfig
|
||||
};
|
||||
|
||||
await File.WriteAllTextAsync(Constants.CONFIG_PATH, JsonConvert.SerializeObject(publicConfig, Formatting.Indented), Encoding.UTF8);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Azaion.Common.DTO.Config;
|
||||
|
||||
public class CameraConfig
|
||||
{
|
||||
public decimal Altitude { get; set; }
|
||||
public decimal CameraFocalLength { get; set; }
|
||||
public decimal CameraSensorWidth { get; set; }
|
||||
}
|
||||
@@ -12,6 +12,8 @@ public class DetectionClass : ICloneable
|
||||
|
||||
public Color Color { get; set; }
|
||||
|
||||
public int MaxSizeM { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string UIName
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Azaion.Common.DTO;
|
||||
using Azaion.Common.DTO.Config;
|
||||
|
||||
namespace Azaion.Common.DTO;
|
||||
|
||||
public class InitConfig
|
||||
{
|
||||
@@ -6,4 +8,5 @@ public class InitConfig
|
||||
public InferenceClientConfig InferenceClientConfig { get; set; } = null!;
|
||||
public GpsDeniedClientConfig GpsDeniedClientConfig { get; set; } = null!;
|
||||
public DirectoriesConfig DirectoriesConfig { get; set; } = null!;
|
||||
public CameraConfig CameraConfig { get; set; } = null!;
|
||||
}
|
||||
@@ -218,27 +218,3 @@ public class YoloLabel : Label
|
||||
|
||||
public override string ToString() => $"{ClassNumber} {CenterX:F5} {CenterY:F5} {Width:F5} {Height:F5}".Replace(',', '.');
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class Detection : YoloLabel
|
||||
{
|
||||
[JsonProperty(PropertyName = "an")][Key("an")] public string AnnotationName { get; set; } = null!;
|
||||
[JsonProperty(PropertyName = "p")][Key("p")] public double Confidence { get; set; }
|
||||
[JsonProperty(PropertyName = "dn")][Key("dn")] public string Description { get; set; }
|
||||
[JsonProperty(PropertyName = "af")][Key("af")] public AffiliationEnum Affiliation { get; set; }
|
||||
|
||||
//For db & serialization
|
||||
public Detection(){}
|
||||
|
||||
public Detection(string annotationName, YoloLabel label, string description = "", double confidence = 1)
|
||||
{
|
||||
AnnotationName = annotationName;
|
||||
Description = description;
|
||||
ClassNumber = label.ClassNumber;
|
||||
CenterX = label.CenterX;
|
||||
CenterY = label.CenterY;
|
||||
Height = label.Height;
|
||||
Width = label.Width;
|
||||
Confidence = confidence;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user