Files
annotations/Azaion.Common/DTO/Config/AnnotationConfig.cs
T
Alex Bezdieniezhnykh 83ae6a0ae9 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)
2025-04-02 19:53:03 +03:00

39 lines
1.2 KiB
C#

using Newtonsoft.Json;
namespace Azaion.Common.DTO.Config;
public class AnnotationConfig
{
public List<DetectionClass> DetectionClasses { get; set; } = null!;
[JsonIgnore]
private Dictionary<int, DetectionClass>? _detectionClassesDict;
[JsonIgnore]
public Dictionary<int, DetectionClass> DetectionClassesDict
{
get
{
if (_detectionClassesDict != null)
return _detectionClassesDict;
var photoModes = Enum.GetValues(typeof(PhotoMode)).Cast<PhotoMode>().ToList();
_detectionClassesDict = DetectionClasses.SelectMany(cls => photoModes.Select(mode => new DetectionClass
{
Id = cls.Id,
Name = cls.Name,
Color = cls.Color,
ShortName = cls.ShortName,
PhotoMode = mode
}))
.ToDictionary(x => x.YoloId, x => x);
return _detectionClassesDict;
}
}
public List<string> VideoFormats { get; set; } = null!;
public List<string> ImageFormats { get; set; } = null!;
public string AnnotationsDbFile { get; set; } = null!;
}