mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:16:30 +00:00
make python app load a bit eariler, making startup a bit faster
This commit is contained in:
@@ -41,7 +41,6 @@ public partial class Annotator
|
||||
private readonly AnnotationService _annotationService;
|
||||
private readonly IDbFactory _dbFactory;
|
||||
private readonly IInferenceService _inferenceService;
|
||||
private readonly IResourceLoader _resourceLoader;
|
||||
|
||||
private ObservableCollection<DetectionClass> AnnotationClasses { get; set; } = new();
|
||||
private bool _suspendLayout;
|
||||
@@ -71,8 +70,7 @@ public partial class Annotator
|
||||
ILogger<Annotator> logger,
|
||||
AnnotationService annotationService,
|
||||
IDbFactory dbFactory,
|
||||
IInferenceService inferenceService,
|
||||
IResourceLoader resourceLoader)
|
||||
IInferenceService inferenceService)
|
||||
{
|
||||
InitializeComponent();
|
||||
_appConfig = appConfig.Value;
|
||||
@@ -86,7 +84,6 @@ public partial class Annotator
|
||||
_annotationService = annotationService;
|
||||
_dbFactory = dbFactory;
|
||||
_inferenceService = inferenceService;
|
||||
_resourceLoader = resourceLoader;
|
||||
|
||||
Loaded += OnLoaded;
|
||||
Closed += OnFormClosed;
|
||||
@@ -401,7 +398,6 @@ public partial class Annotator
|
||||
|
||||
private void OnFormClosed(object? sender, EventArgs e)
|
||||
{
|
||||
_resourceLoader.StopPython();
|
||||
MainCancellationSource.Cancel();
|
||||
DetectionCancellationSource.Cancel();
|
||||
_mediaPlayer.Stop();
|
||||
@@ -454,6 +450,7 @@ public partial class Annotator
|
||||
|
||||
_appConfig.DirectoriesConfig.VideosDirectory = dlg.FileName;
|
||||
TbFolder.Text = dlg.FileName;
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private void TbFilter_OnTextChanged(object sender, TextChangedEventArgs e)
|
||||
@@ -497,8 +494,6 @@ public partial class Annotator
|
||||
LvFilesContextMenu.DataContext = listItem!.DataContext;
|
||||
}
|
||||
|
||||
private (TimeSpan Time, List<Detection> Detections)? _previousDetection;
|
||||
|
||||
public void AutoDetect(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (IsInferenceNow)
|
||||
@@ -560,7 +555,7 @@ public partial class Annotator
|
||||
try
|
||||
{
|
||||
var annotation = await _annotationService.SaveAnnotation(annotationImage);
|
||||
if (annotation.OriginalMediaName != _formState.CurrentMedia.FName)
|
||||
if (annotation.OriginalMediaName != _formState.CurrentMedia?.FName)
|
||||
return;
|
||||
AddAnnotation(annotation);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user