mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 09:26:31 +00:00
fix initialization, throttle operations
day/winter/night switcher fixes
This commit is contained in:
@@ -4,12 +4,32 @@ namespace Azaion.Common.DTO.Config;
|
||||
|
||||
public class AnnotationConfig
|
||||
{
|
||||
public List<DetectionClass> AnnotationClasses { get; set; } = null!;
|
||||
public List<DetectionClass> DetectionClasses { get; set; } = null!;
|
||||
|
||||
[JsonIgnore]
|
||||
private Dictionary<int, DetectionClass>? _detectionClassesDict;
|
||||
|
||||
[JsonIgnore]
|
||||
public Dictionary<int, DetectionClass> DetectionClassesDict => _detectionClassesDict ??= AnnotationClasses.ToDictionary(x => x.Id);
|
||||
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,
|
||||
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!;
|
||||
|
||||
Reference in New Issue
Block a user