mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 15:06:29 +00:00
add editor, fix some bugs
WIP
This commit is contained in:
@@ -69,8 +69,6 @@ public class PlayerControlHandler :
|
||||
|
||||
public async Task Handle(KeyEvent notification, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation($"Catch {notification.Args.Key} by {notification.Sender.GetType().Name}");
|
||||
|
||||
var key = notification.Args.Key;
|
||||
var keyNumber = (int?)null;
|
||||
|
||||
@@ -79,7 +77,7 @@ public class PlayerControlHandler :
|
||||
if ((int)key >= (int)Key.NumPad1 && (int)key <= (int)Key.NumPad9)
|
||||
keyNumber = key - Key.NumPad1;
|
||||
if (keyNumber.HasValue)
|
||||
SelectClass(_mainWindow.AnnotationClasses[keyNumber.Value]);
|
||||
SelectClass((AnnotationClass)_mainWindow.LvClasses.Items[keyNumber.Value]);
|
||||
|
||||
if (_keysControlEnumDict.TryGetValue(key, out var value))
|
||||
await ControlPlayback(value);
|
||||
@@ -234,16 +232,9 @@ public class PlayerControlHandler :
|
||||
var currentAnns = _mainWindow.Editor.CurrentAnns
|
||||
.Select(x => new YoloLabel(x.Info, _mainWindow.Editor.RenderSize, _formState.CurrentVideoSize))
|
||||
.ToList();
|
||||
var labels = string.Join(Environment.NewLine, currentAnns.Select(x => x.ToString()));
|
||||
|
||||
if (!Directory.Exists(_config.LabelsDirectory))
|
||||
Directory.CreateDirectory(_config.LabelsDirectory);
|
||||
if (!Directory.Exists(_config.ImagesDirectory))
|
||||
Directory.CreateDirectory(_config.ImagesDirectory);
|
||||
if (!Directory.Exists(_config.ResultsDirectory))
|
||||
Directory.CreateDirectory(_config.ResultsDirectory);
|
||||
await YoloLabel.WriteToFile(currentAnns, Path.Combine(_config.LabelsDirectory, $"{fName}.txt"));
|
||||
|
||||
await File.WriteAllTextAsync(Path.Combine(_config.LabelsDirectory, $"{fName}.txt"), labels);
|
||||
var resultHeight = (uint)Math.Round(RESULT_WIDTH / _formState.CurrentVideoSize.Width * _formState.CurrentVideoSize.Height);
|
||||
|
||||
await _mainWindow.AddAnnotation(time, currentAnns);
|
||||
|
||||
Reference in New Issue
Block a user