diff --git a/Azaion.Annotator/Azaion.Annotator/Azaion.Annotator.csproj b/Azaion.Annotator/Azaion.Annotator/Azaion.Annotator.csproj
index 858bf21..697ac2e 100644
--- a/Azaion.Annotator/Azaion.Annotator/Azaion.Annotator.csproj
+++ b/Azaion.Annotator/Azaion.Annotator/Azaion.Annotator.csproj
@@ -19,4 +19,11 @@
+
+
+
+ PreserveNewest
+
+
+
diff --git a/Azaion.Annotator/Azaion.Annotator/Controls/CanvasEditor.cs b/Azaion.Annotator/Azaion.Annotator/Controls/CanvasEditor.cs
index 1ffe950..9dcd98d 100644
--- a/Azaion.Annotator/Azaion.Annotator/Controls/CanvasEditor.cs
+++ b/Azaion.Annotator/Azaion.Annotator/Controls/CanvasEditor.cs
@@ -1,5 +1,6 @@
using System.Windows;
using System.Windows.Controls;
+using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;
@@ -19,6 +20,7 @@ public class CanvasEditor : Canvas
private readonly Line _horizontalLine;
private readonly Line _verticalLine;
+ private readonly TextBlock _classNameHint;
private Rectangle _curRec;
private AnnotationControl _curAnn;
@@ -38,6 +40,9 @@ public class CanvasEditor : Canvas
_verticalLine.Fill = value.ColorBrush;
_horizontalLine.Stroke = value.ColorBrush;
_horizontalLine.Fill = value.ColorBrush;
+ _classNameHint.Text = value.Name;
+ _classNameHint.Foreground = value.ColorBrush;
+
_newAnnotationRect.Stroke = value.ColorBrush;
_newAnnotationRect.Fill = value.ColorBrush;
_currentAnnClass = value;
@@ -64,6 +69,14 @@ public class CanvasEditor : Canvas
StrokeDashArray = [5],
StrokeThickness = 2
};
+ _classNameHint = new TextBlock
+ {
+ Text = CurrentAnnClass?.Name ?? "asd",
+ Foreground = new SolidColorBrush(Colors.Blue),
+ Cursor = Cursors.Arrow,
+ FontSize = 16,
+ FontWeight = FontWeights.Bold
+ };
_newAnnotationRect = new Rectangle
{
Name = "selector",
@@ -94,6 +107,7 @@ public class CanvasEditor : Canvas
Children.Add(_newAnnotationRect);
Children.Add(_horizontalLine);
Children.Add(_verticalLine);
+ Children.Add(_classNameHint);
}
private void CanvasMouseDown(object sender, MouseButtonEventArgs e)
@@ -107,6 +121,8 @@ public class CanvasEditor : Canvas
var pos = e.GetPosition(this);
_horizontalLine.Y1 = _horizontalLine.Y2 = pos.Y;
_verticalLine.X1 = _verticalLine.X2 = pos.X;
+ SetLeft(_classNameHint, pos.X + 10);
+ SetTop(_classNameHint, pos.Y - 30);
if (e.LeftButton != MouseButtonState.Pressed)
return;
diff --git a/Azaion.Annotator/Azaion.Annotator/DTO/AnnotationInfo.cs b/Azaion.Annotator/Azaion.Annotator/DTO/AnnotationInfo.cs
index e253023..fa5b0e7 100644
--- a/Azaion.Annotator/Azaion.Annotator/DTO/AnnotationInfo.cs
+++ b/Azaion.Annotator/Azaion.Annotator/DTO/AnnotationInfo.cs
@@ -65,8 +65,8 @@ public class AnnotationInfo
var annInfo = new AnnotationInfo { ClassNumber = this.ClassNumber };
- double left = annInfo.X - annInfo.Width * 2;
- double top = annInfo.Y - annInfo.Height * 2;
+ double left = X - Width / 2;
+ double top = Y - Height / 2;
if (videoAR > canvasAR) //100% width
{
diff --git a/Azaion.Annotator/Azaion.Annotator/DTO/FormState.cs b/Azaion.Annotator/Azaion.Annotator/DTO/FormState.cs
index a754936..e8d5d23 100644
--- a/Azaion.Annotator/Azaion.Annotator/DTO/FormState.cs
+++ b/Azaion.Annotator/Azaion.Annotator/DTO/FormState.cs
@@ -6,9 +6,11 @@ namespace Azaion.Annotator.DTO;
public class FormState
{
public SelectionState SelectionState { get; set; } = SelectionState.None;
+
public string CurrentFile { get; set; } = null!;
public Size CurrentVideoSize { get; set; }
+ public string VideoName => Path.GetFileNameWithoutExtension(CurrentFile).Replace(" ", "");
+ public TimeSpan CurrentVideoLength { get; set; }
- public string VideoName => Path.GetFileNameWithoutExtension(CurrentFile).Replace(" ", "");
public string GetTimeName(TimeSpan ts) => $"{VideoName}_{ts:hmmssf}";
}
diff --git a/Azaion.Annotator/Azaion.Annotator/DTO/KeyEvent.cs b/Azaion.Annotator/Azaion.Annotator/DTO/MediatrEvents.cs
similarity index 58%
rename from Azaion.Annotator/Azaion.Annotator/DTO/KeyEvent.cs
rename to Azaion.Annotator/Azaion.Annotator/DTO/MediatrEvents.cs
index 54dfad1..1a818dd 100644
--- a/Azaion.Annotator/Azaion.Annotator/DTO/KeyEvent.cs
+++ b/Azaion.Annotator/Azaion.Annotator/DTO/MediatrEvents.cs
@@ -8,3 +8,8 @@ public class KeyEvent(object sender, KeyEventArgs args) : INotification
public object Sender { get; set; } = sender;
public KeyEventArgs Args { get; set; } = args;
}
+
+public class PlaybackControlEvent(PlaybackControlEnum playbackControlEnum) : INotification
+{
+ public PlaybackControlEnum PlaybackControl { get; set; } = playbackControlEnum;
+}
diff --git a/Azaion.Annotator/Azaion.Annotator/DTO/PlaybackControlEnum.cs b/Azaion.Annotator/Azaion.Annotator/DTO/PlaybackControlEnum.cs
new file mode 100644
index 0000000..c2389b5
--- /dev/null
+++ b/Azaion.Annotator/Azaion.Annotator/DTO/PlaybackControlEnum.cs
@@ -0,0 +1,14 @@
+namespace Azaion.Annotator.DTO;
+
+public enum PlaybackControlEnum
+{
+ None = 0,
+ Play = 1,
+ Pause = 2,
+ Stop = 3,
+ PreviousFrame = 4,
+ NextFrame = 5,
+ SaveAnnotations = 6,
+ RemoveSelectedAnns = 7,
+ RemoveAllAnns = 8
+}
\ No newline at end of file
diff --git a/Azaion.Annotator/Azaion.Annotator/HelpTexts.cs b/Azaion.Annotator/Azaion.Annotator/HelpTexts.cs
new file mode 100644
index 0000000..d936aa4
--- /dev/null
+++ b/Azaion.Annotator/Azaion.Annotator/HelpTexts.cs
@@ -0,0 +1,24 @@
+namespace Azaion.Annotator;
+
+public enum HelpTextEnum
+{
+ None = 0,
+ Initial = 1,
+ PlayVideo = 2,
+ PauseForAnnotations = 3,
+ AnnotationHelp = 4
+}
+
+public class HelpTexts
+{
+ public static Dictionary HelpTextsDict = new()
+ {
+ { HelpTextEnum.None, "" },
+ { HelpTextEnum.Initial, "Натисніть Файл - Відкрити папку... та виберіть папку з вашими відео для анотації" },
+ { HelpTextEnum.PlayVideo, "В списку відео виберіть потрібне та [подвійний клік] чи [Eнтер] на ньому - запустіть його на перегляд" },
+ { HelpTextEnum.PauseForAnnotations, "В потрібному місці відео де є один з об'єктів для анотації зупиніть його [Пробіл] або кн. на панелі" },
+ { HelpTextEnum.AnnotationHelp, "Клавішами [1] - [9] або мишкою оберіть потрібний клас та виділіть область з об'єктом. Виділяйте всі що є об'єкти. " +
+ "При потребі [Ctrl] виділяйте анотації та [Del] для видалення. [Eнтер] для збереження і перегляду далі" },
+
+ };
+}
diff --git a/Azaion.Annotator/Azaion.Annotator/MainWindow.xaml b/Azaion.Annotator/Azaion.Annotator/MainWindow.xaml
index 262564a..559b9b7 100644
--- a/Azaion.Annotator/Azaion.Annotator/MainWindow.xaml
+++ b/Azaion.Annotator/Azaion.Annotator/MainWindow.xaml
@@ -67,10 +67,10 @@
Grid.Column="0"
Grid.ColumnSpan="3"
Background="Black">
-