mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 18:26:31 +00:00
fix detection label
fix schema migrator for enums
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
using System.Windows.Media;
|
||||
using Azaion.Common.DTO;
|
||||
using Azaion.Common.Extensions;
|
||||
|
||||
namespace Azaion.Common.Controls
|
||||
{
|
||||
public partial class DetectionLabelPanel
|
||||
{
|
||||
private AffiliationEnum _affiliation = AffiliationEnum.None;
|
||||
private double _confidence;
|
||||
|
||||
public AffiliationEnum Affiliation
|
||||
{
|
||||
@@ -18,18 +18,33 @@ namespace Azaion.Common.Controls
|
||||
}
|
||||
}
|
||||
|
||||
public DetectionClass DetectionClass { get; set; }
|
||||
private DetectionClass _detectionClass = new();
|
||||
public DetectionClass DetectionClass {
|
||||
get => _detectionClass;
|
||||
set
|
||||
{
|
||||
_detectionClass = value;
|
||||
SetClassName();
|
||||
}
|
||||
}
|
||||
|
||||
private double _confidence;
|
||||
public double Confidence
|
||||
{
|
||||
get => _confidence;
|
||||
set
|
||||
{
|
||||
_confidence = value;
|
||||
|
||||
SetClassName();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetClassName()
|
||||
{
|
||||
DetectionClassName.Content = _confidence >= 0.995 ? _detectionClass.UIName : $"{_detectionClass.UIName}: {_confidence * 100:F0}%";
|
||||
DetectionGrid.Background = new SolidColorBrush(_detectionClass.Color.ToConfidenceColor(_confidence));
|
||||
}
|
||||
|
||||
public DetectionLabelPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Reference in New Issue
Block a user