add offset

fixes
add visual validation border and validate functionality
This commit is contained in:
Alex Bezdieniezhnykh
2024-12-28 15:51:27 +02:00
parent 5fe46cd6f5
commit 8b94837f18
27 changed files with 251 additions and 128 deletions
-54
View File
@@ -1,54 +0,0 @@
using System.IO;
using System.Windows.Media.Imaging;
using Azaion.Common.DTO.Config;
using Azaion.Common.DTO.Queue;
using Azaion.Common.Extensions;
using Azaion.CommonSecurity.DTO;
namespace Azaion.Common.DTO;
public class Annotation
{
private static string _labelsDir = null!;
private static string _imagesDir = null!;
private static string _thumbDir = null!;
public static void InitializeDirs(DirectoriesConfig config)
{
_labelsDir = config.LabelsDirectory;
_imagesDir = config.ImagesDirectory;
_thumbDir = config.ThumbnailsDirectory;
}
public string Name { get; set; } = null!;
public string ImageExtension { get; set; } = null!;
public DateTime CreatedDate { get; set; }
public string CreatedEmail { get; set; } = null!;
public RoleEnum CreatedRole { get; set; }
public SourceEnum Source { get; set; }
public AnnotationStatus AnnotationStatus { get; set; }
public IEnumerable<Detection> Detections { get; set; } = null!;
public double Lat { get; set; }
public double Lon { get; set; }
public List<int> Classes => Detections.Select(x => x.ClassNumber).ToList();
public string ImagePath => Path.Combine(_imagesDir, $"{Name}{ImageExtension}");
public string LabelPath => Path.Combine(_labelsDir, $"{Name}.txt");
public string ThumbPath => Path.Combine(_thumbDir, $"{Name}{Constants.THUMBNAIL_PREFIX}.jpg");
}
public enum AnnotationStatus
{
None = 0,
Created = 10,
Validated = 20
}
public class AnnotationName
{
public string Name { get; set; } = null!;
}
+2 -1
View File
@@ -1,4 +1,5 @@
using MediatR;
using Azaion.Common.Database;
using MediatR;
namespace Azaion.Common.DTO;
+2
View File
@@ -2,6 +2,7 @@
using System.IO;
using System.Runtime.CompilerServices;
using System.Windows.Media.Imaging;
using Azaion.Common.Database;
using Azaion.Common.Extensions;
namespace Azaion.Common.DTO;
@@ -27,6 +28,7 @@ public class AnnotationImageView(Annotation annotation) : INotifyPropertyChanged
}
public string ImageName => Path.GetFileName(Annotation.ImagePath);
public bool IsSeed => Annotation.AnnotationStatus == AnnotationStatus.Created;
public void Delete()
{
@@ -0,0 +1,13 @@
using MediatR;
namespace Azaion.Common.DTO;
public class AnnotatorControlEvent(PlaybackControlEnum playbackControlEnum) : INotification
{
public PlaybackControlEnum PlaybackControl { get; set; } = playbackControlEnum;
}
public class DatasetExplorerControlEvent(PlaybackControlEnum playbackControlEnum) : INotification
{
public PlaybackControlEnum PlaybackControl { get; set; } = playbackControlEnum;
}
+1 -1
View File
@@ -186,7 +186,7 @@ public class YoloLabel : Label
public class Detection : YoloLabel
{
public string AnnotationName { get; set; }
public string AnnotationName { get; set; } = null!;
public double? Probability { get; set; }
//For db
+2 -1
View File
@@ -15,5 +15,6 @@ public enum PlaybackControlEnum
TurnOnVolume = 10,
Previous = 11,
Next = 12,
Close = 13
Close = 13,
ValidateAnnotations = 15
}
@@ -1,4 +1,5 @@
using Azaion.CommonSecurity.DTO;
using Azaion.Common.Database;
using Azaion.CommonSecurity.DTO;
namespace Azaion.Common.DTO.Queue;
using MessagePack;