add manual Tile Processor

zoom on video on pause (temp image)
This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-07-28 12:39:52 +03:00
parent fefd054ea0
commit fc6e5db795
34 changed files with 716 additions and 209 deletions
+9
View File
@@ -0,0 +1,9 @@
namespace Azaion.Common.DTO;
public enum AffiliationEnum
{
None = 0,
Friendly = 10,
Hostile = 20,
Unknown = 30
}
@@ -12,6 +12,7 @@ public class AIRecognitionConfig
[Key("t_dc")] public double TrackingDistanceConfidence { get; set; }
[Key("t_pi")] public double TrackingProbabilityIncrease { get; set; }
[Key("t_it")] public double TrackingIntersectionThreshold { get; set; }
[Key("ov_p")] public double BigImageTileOverlapPercent { get; set; }
[Key("d")] public byte[] Data { get; set; } = null!;
[Key("p")] public List<string> Paths { get; set; } = null!;
+2 -2
View File
@@ -6,10 +6,10 @@ namespace Azaion.Common.DTO;
public class FormState
{
public MediaFileInfo? CurrentMedia { get; set; }
public string VideoName => CurrentMedia?.FName ?? "";
public string MediaName => CurrentMedia?.FName ?? "";
public string CurrentMrl { get; set; } = null!;
public Size CurrentVideoSize { get; set; }
public Size CurrentMediaSize { get; set; }
public TimeSpan CurrentVideoLength { get; set; }
public TimeSpan? BackgroundTime { get; set; }
+34 -5
View File
@@ -22,16 +22,36 @@ public abstract class Label
public class CanvasLabel : Label
{
public double X { get; set; }
public double Y { get; set; }
public double X { get; set; } //left
public double Y { get; set; } //top
public double Width { get; set; }
public double Height { get; set; }
public double Confidence { get; set; }
public CanvasLabel()
public double Bottom
{
get => Y + Height;
set => Height = value - Y;
}
public double Right
{
get => X + Width;
set => Width = value - X;
}
public CanvasLabel() { }
public CanvasLabel(double left, double right, double top, double bottom)
{
X = left;
Y = top;
Width = right - left;
Height = bottom - top;
Confidence = 1;
ClassNumber = -1;
}
public CanvasLabel(int classNumber, double x, double y, double width, double height, double confidence = 1) : base(classNumber)
{
X = x;
@@ -77,6 +97,13 @@ public class CanvasLabel : Label
}
Confidence = confidence;
}
public CanvasLabel ReframeToSmall(CanvasLabel smallTile) =>
new(ClassNumber, X - smallTile.X, Y - smallTile.Y, Width, Height, Confidence);
public CanvasLabel ReframeFromSmall(CanvasLabel smallTile) =>
new(ClassNumber, X + smallTile.X, Y + smallTile.Y, Width, Height, Confidence);
}
[MessagePackObject]
@@ -193,13 +220,15 @@ 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; }
//For db & serialization
public Detection(){}
public Detection(string annotationName, YoloLabel label, double confidence = 1)
public Detection(string annotationName, YoloLabel label, string description = "", double confidence = 1)
{
AnnotationName = annotationName;
Description = description;
ClassNumber = label.ClassNumber;
CenterX = label.CenterX;
CenterY = label.CenterY;