mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 09:06:30 +00:00
fix inference
fix small issues
This commit is contained in:
@@ -520,21 +520,26 @@ public partial class Annotator
|
||||
var files = new List<string>();
|
||||
await Dispatcher.Invoke(async () =>
|
||||
{
|
||||
//Take not annotated medias
|
||||
files = (LvFiles.ItemsSource as IEnumerable<MediaFileInfo>)?.Skip(LvFiles.SelectedIndex)
|
||||
.Take(Constants.DETECTION_BATCH_SIZE)
|
||||
.Where(x => !x.HasAnnotations)
|
||||
.Select(x => x.Path)
|
||||
.ToList();
|
||||
await _mediator.Publish(new AnnotatorControlEvent(PlaybackControlEnum.Play), ct);
|
||||
await ReloadAnnotations();
|
||||
.ToList() ?? [];
|
||||
if (files.Count != 0)
|
||||
{
|
||||
await _mediator.Publish(new AnnotatorControlEvent(PlaybackControlEnum.Play), ct);
|
||||
await ReloadAnnotations();
|
||||
}
|
||||
});
|
||||
|
||||
if (files.Count == 0)
|
||||
break;
|
||||
|
||||
await _inferenceService.RunInference(files, async annotationImage => await ProcessDetection(annotationImage), ct);
|
||||
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
if (LvFiles.SelectedIndex + files.Count >= LvFiles.Items.Count)
|
||||
DetectionCancellationSource.Cancel();
|
||||
|
||||
LvFiles.SelectedIndex += files.Count;
|
||||
LvFiles.Items.Refresh();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user