fix bug with annotation result gradient stops

add tensorrt engine
This commit is contained in:
Alex Bezdieniezhnykh
2025-04-02 00:29:21 +03:00
parent e0c88bd8fb
commit b21f8e320f
36 changed files with 544 additions and 206 deletions
+8 -8
View File
@@ -26,22 +26,22 @@ public class CanvasLabel : Label
public double Y { get; set; }
public double Width { get; set; }
public double Height { get; set; }
public double? Probability { get; }
public double? Confidence { get; }
public CanvasLabel()
{
}
public CanvasLabel(int classNumber, double x, double y, double width, double height, double? probability = null) : base(classNumber)
public CanvasLabel(int classNumber, double x, double y, double width, double height, double? confidence = null) : base(classNumber)
{
X = x;
Y = y;
Width = width;
Height = height;
Probability = probability;
Confidence = confidence;
}
public CanvasLabel(YoloLabel label, Size canvasSize, Size? videoSize = null, double? probability = null)
public CanvasLabel(YoloLabel label, Size canvasSize, Size? videoSize = null, double confidence = 1)
{
var cw = canvasSize.Width;
var ch = canvasSize.Height;
@@ -75,7 +75,7 @@ public class CanvasLabel : Label
Width = label.Width * realWidth;
Height = label.Height * ch;
}
Probability = probability;
Confidence = confidence;
}
}
@@ -189,12 +189,12 @@ public class YoloLabel : Label
public class Detection : YoloLabel
{
[JsonProperty(PropertyName = "an")][Key("an")] public string AnnotationName { get; set; } = null!;
[JsonProperty(PropertyName = "p")][Key("p")] public double? Probability { get; set; }
[JsonProperty(PropertyName = "p")][Key("p")] public double Confidence { get; set; }
//For db & serialization
public Detection(){}
public Detection(string annotationName, YoloLabel label, double? probability = null)
public Detection(string annotationName, YoloLabel label, double confidence = 1)
{
AnnotationName = annotationName;
ClassNumber = label.ClassNumber;
@@ -202,6 +202,6 @@ public class Detection : YoloLabel
CenterY = label.CenterY;
Height = label.Height;
Width = label.Width;
Probability = probability;
Confidence = confidence;
}
}