mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 22:56:29 +00:00
83ae6a0ae9
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)
39 lines
1.2 KiB
C#
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!;
|
|
} |