move detection classes and other system values from local config to remote

forbid non validators to read from queue
create better visualization in detector control
make colors for detection classes more distinguishable
fix bug with removing detection (probably completely)
This commit is contained in:
Alex Bezdieniezhnykh
2025-04-02 19:53:03 +03:00
parent e182547dc8
commit 83ae6a0ae9
19 changed files with 209 additions and 169 deletions
+7 -10
View File
@@ -169,7 +169,8 @@ public class CanvasEditor : Canvas
Width = width,
Height = height,
X = Math.Min(endPos.X, _newAnnotationStartPos.X),
Y = Math.Min(endPos.Y, _newAnnotationStartPos.Y)
Y = Math.Min(endPos.Y, _newAnnotationStartPos.Y),
Confidence = 1
});
}
@@ -312,25 +313,21 @@ public class CanvasEditor : Canvas
{
foreach (var detection in detections)
{
var annClass = DetectionClass.FromYoloId(detection.ClassNumber, detectionClasses);
var detectionClass = DetectionClass.FromYoloId(detection.ClassNumber, detectionClasses);
var canvasLabel = new CanvasLabel(detection, RenderSize, videoSize, detection.Confidence);
CreateDetectionControl(annClass, time, canvasLabel);
CreateDetectionControl(detectionClass, time, canvasLabel);
}
}
private void CreateDetectionControl(DetectionClass annClass, TimeSpan time, CanvasLabel canvasLabel)
private void CreateDetectionControl(DetectionClass detectionClass, TimeSpan time, CanvasLabel canvasLabel)
{
var detectionControl = new DetectionControl(annClass, time, AnnotationResizeStart, canvasLabel.Confidence)
{
Width = canvasLabel.Width,
Height = canvasLabel.Height
};
var detectionControl = new DetectionControl(detectionClass, time, AnnotationResizeStart, canvasLabel);
detectionControl.MouseDown += AnnotationPositionStart;
SetLeft(detectionControl, canvasLabel.X );
SetTop(detectionControl, canvasLabel.Y);
Children.Add(detectionControl);
CurrentDetections.Add(detectionControl);
_newAnnotationRect.Fill = new SolidColorBrush(annClass.Color);
_newAnnotationRect.Fill = new SolidColorBrush(detectionClass.Color);
}
#endregion