mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:56:30 +00:00
fix ai detection bugs #2
This commit is contained in:
@@ -13,12 +13,9 @@ public class AnnotationResult
|
||||
[JsonProperty(PropertyName = "t")]
|
||||
public TimeSpan Time { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "p")]
|
||||
public double Percentage { get; set; }
|
||||
|
||||
public double Lat { get; set; }
|
||||
public double Lon { get; set; }
|
||||
public List<YoloLabel> Labels { get; set; } = new();
|
||||
public List<Detection> Detections { get; set; } = new();
|
||||
|
||||
#region For Display in the grid
|
||||
|
||||
@@ -32,10 +29,10 @@ public class AnnotationResult
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Labels.Count == 0)
|
||||
if (Detections.Count == 0)
|
||||
return "";
|
||||
|
||||
var groups = Labels.Select(x => x.ClassNumber).GroupBy(x => x).ToList();
|
||||
var groups = Detections.Select(x => x.ClassNumber).GroupBy(x => x).ToList();
|
||||
return groups.Count > 1
|
||||
? string.Join(",", groups.Select(x => x.Key + 1))
|
||||
: _config.AnnotationClassesDict[groups.FirstOrDefault().Key].Name;
|
||||
@@ -49,10 +46,10 @@ public class AnnotationResult
|
||||
get
|
||||
{
|
||||
var defaultColor = (Color)ColorConverter.ConvertFromString("#404040");
|
||||
if (Labels.Count == 0)
|
||||
if (Detections.Count == 0)
|
||||
return defaultColor;
|
||||
|
||||
var groups = Labels.Select(x => x.ClassNumber).GroupBy(x => x).ToList();
|
||||
var groups = Detections.Select(x => x.ClassNumber).GroupBy(x => x).ToList();
|
||||
|
||||
return groups.Count > 1
|
||||
? defaultColor
|
||||
@@ -64,12 +61,11 @@ public class AnnotationResult
|
||||
#endregion
|
||||
|
||||
public AnnotationResult() { }
|
||||
public AnnotationResult(TimeSpan time, string timeName, List<YoloLabel> labels, Config config)
|
||||
public AnnotationResult(TimeSpan time, string timeName, List<Detection> detections, Config config)
|
||||
{
|
||||
_config = config;
|
||||
Labels = labels;
|
||||
Detections = detections;
|
||||
Time = time;
|
||||
Image = $"{timeName}.jpg";
|
||||
Percentage = 100;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user