mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:06:30 +00:00
fc6e5db795
zoom on video on pause (temp image)
55 lines
1.4 KiB
C#
55 lines
1.4 KiB
C#
using System.Windows.Media;
|
|
using Azaion.Common.DTO;
|
|
|
|
namespace Azaion.Common.Controls
|
|
{
|
|
public partial class DetectionLabelPanel
|
|
{
|
|
private AffiliationEnum _affiliation = AffiliationEnum.None;
|
|
private double _confidence;
|
|
|
|
public AffiliationEnum Affiliation
|
|
{
|
|
get => _affiliation;
|
|
set
|
|
{
|
|
_affiliation = value;
|
|
UpdateAffiliationImage();
|
|
}
|
|
}
|
|
|
|
public DetectionClass DetectionClass { get; set; }
|
|
|
|
public double Confidence
|
|
{
|
|
get => _confidence;
|
|
set
|
|
{
|
|
_confidence = value;
|
|
|
|
}
|
|
}
|
|
|
|
public DetectionLabelPanel()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private string _detectionLabelText(string detectionClassName) =>
|
|
_confidence >= 0.98 ? detectionClassName : $"{detectionClassName}: {_confidence * 100:F0}%";
|
|
|
|
private void UpdateAffiliationImage()
|
|
{
|
|
if (_affiliation == AffiliationEnum.None)
|
|
{
|
|
AffiliationImage.Source = null;
|
|
return;
|
|
}
|
|
|
|
if (TryFindResource(_affiliation.ToString()) is DrawingImage drawingImage)
|
|
AffiliationImage.Source = drawingImage;
|
|
else
|
|
AffiliationImage.Source = null;
|
|
}
|
|
}
|
|
} |