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