mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 09:06:30 +00:00
add manual Tile Processor
zoom on video on pause (temp image)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user