mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:26:30 +00:00
switcher dataset explorer
lat lon -> geopoint correct location for gps if small keypoints number
This commit is contained in:
@@ -16,6 +16,8 @@ public class DetectionControl : Border
|
||||
|
||||
private readonly Grid _grid;
|
||||
private readonly Label _detectionLabel;
|
||||
public readonly Canvas DetectionLabelContainer;
|
||||
|
||||
public TimeSpan Time { get; set; }
|
||||
private readonly double _confidence;
|
||||
private List<Rectangle> _resizedRectangles = new();
|
||||
@@ -51,6 +53,16 @@ public class DetectionControl : Border
|
||||
}
|
||||
}
|
||||
|
||||
public (HorizontalAlignment Horizontal, VerticalAlignment Vertical) DetectionLabelPosition
|
||||
{
|
||||
get => (DetectionLabelContainer.HorizontalAlignment, DetectionLabelContainer.VerticalAlignment);
|
||||
set
|
||||
{
|
||||
DetectionLabelContainer.HorizontalAlignment = value.Horizontal;
|
||||
DetectionLabelContainer.VerticalAlignment = value.Vertical;
|
||||
}
|
||||
}
|
||||
|
||||
private string _detectionLabelText(string detectionClassName) =>
|
||||
_confidence >= 0.995 ? detectionClassName : $"{detectionClassName}: {_confidence * 100:F0}%"; //double
|
||||
|
||||
@@ -62,23 +74,19 @@ public class DetectionControl : Border
|
||||
_resizeStart = resizeStart;
|
||||
_confidence = canvasLabel.Confidence;
|
||||
|
||||
var labelContainer = new Canvas
|
||||
DetectionLabelContainer = new Canvas
|
||||
{
|
||||
HorizontalAlignment = HorizontalAlignment.Right,
|
||||
VerticalAlignment = VerticalAlignment.Top,
|
||||
ClipToBounds = false,
|
||||
Margin = new Thickness(0, 0, 32, 0)
|
||||
};
|
||||
_detectionLabel = new Label
|
||||
{
|
||||
Content = _detectionLabelText(detectionClass.Name),
|
||||
HorizontalAlignment = HorizontalAlignment.Right,
|
||||
VerticalAlignment = VerticalAlignment.Top,
|
||||
Margin = new Thickness(0, -32, 0, 0),
|
||||
FontSize = 16,
|
||||
Visibility = Visibility.Visible
|
||||
};
|
||||
labelContainer.Children.Add(_detectionLabel);
|
||||
DetectionLabelContainer.Children.Add(_detectionLabel);
|
||||
|
||||
_selectionFrame = new Rectangle
|
||||
{
|
||||
@@ -108,7 +116,7 @@ public class DetectionControl : Border
|
||||
};
|
||||
foreach (var rect in _resizedRectangles)
|
||||
_grid.Children.Add(rect);
|
||||
_grid.Children.Add(labelContainer);
|
||||
_grid.Children.Add(DetectionLabelContainer);
|
||||
|
||||
Child = _grid;
|
||||
Cursor = Cursors.SizeAll;
|
||||
|
||||
Reference in New Issue
Block a user