splitting python complete

This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-08-12 14:48:56 +03:00
parent fc6e5db795
commit ad782bcbaa
31 changed files with 834 additions and 369 deletions
+25 -23
View File
@@ -3,31 +3,33 @@ using Azaion.Common.Database;
namespace Azaion.Common.DTO;
public class AnnotationResult
{
public Annotation Annotation { get; set; }
public List<(Color Color, double Confidence)> Colors { get; private set; }
// public class AnnotationResult
//{
//public Annotation Annotation { get; set; }
public string ImagePath { get; set; }
public string TimeStr { get; set; }
public string ClassName { get; set; }
//public string ImagePath { get; set; }
//public string TimeStr { get; set; }
//public List<(Color Color, double Confidence)> Colors { get; private set; }
// public string ClassName { get; set; }
public AnnotationResult(Dictionary<int, DetectionClass> allDetectionClasses, Annotation annotation)
{
// public AnnotationResult(Dictionary<int, DetectionClass> allDetectionClasses, Annotation annotation)
// {
Annotation = annotation;
//Annotation = annotation;
TimeStr = $"{annotation.Time:h\\:mm\\:ss}";
ImagePath = annotation.ImagePath;
//TimeStr = $"{annotation.Time:h\\:mm\\:ss}";
//ImagePath = annotation.ImagePath;
var detectionClasses = annotation.Detections.Select(x => x.ClassNumber).Distinct().ToList();
Colors = annotation.Detections
.Select(d => (allDetectionClasses[d.ClassNumber].Color, d.Confidence))
.ToList();
ClassName = detectionClasses.Count > 1
? string.Join(", ", detectionClasses.Select(x => allDetectionClasses[x].UIName))
: allDetectionClasses[detectionClasses.FirstOrDefault()].UIName;
}
}
// var detectionClasses = annotation.Detections.Select(x => x.ClassNumber).Distinct().ToList();
// ClassName = detectionClasses.Count > 1
// ? string.Join(", ", detectionClasses.Select(x => allDetectionClasses[x].UIName))
// : allDetectionClasses[detectionClasses.FirstOrDefault()].UIName;
//
// Colors = annotation.Detections
// .Select(d => (allDetectionClasses[d.ClassNumber].Color, d.Confidence))
// .ToList();
// }
// }