fix saving scale for datasetexplorer and annotation

This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-10-01 14:29:23 +03:00
parent 9b80eaf435
commit 99b9058187
4 changed files with 38 additions and 23 deletions
+9 -3
View File
@@ -37,6 +37,7 @@ public partial class DatasetExplorer
private readonly IConfigUpdater _configUpdater;
public bool ThumbnailLoading { get; set; }
public string CurrentFilter { get; set; } = "";
public AnnotationThumbnail? CurrentAnnotation { get; set; }
@@ -201,7 +202,7 @@ public partial class DatasetExplorer
SwitchTab(toEditor: true);
ExplorerEditor.RemoveAllAnns();
ExplorerEditor.CreateDetections(ann, _appConfig.AnnotationConfig.DetectionClasses, new Size(image.PixelWidth, image.PixelHeight));
ExplorerEditor.CreateDetections(ann, _appConfig.AnnotationConfig.DetectionClasses, image.Size());
}
catch (Exception e)
{
@@ -261,7 +262,7 @@ public partial class DatasetExplorer
SelectedAnnotationDict.Clear();
var annThumbnails = _annotationsDict[ExplorerEditor.CurrentAnnClass.YoloId]
.WhereIf(withDetectionsOnly, x => x.Value.Detections.Any())
.WhereIf(TbSearch.Text.Length > 2, x => x.Key.ToLower().Contains(TbSearch.Text))
.WhereIf(!string.IsNullOrEmpty(CurrentFilter), x => x.Key.Contains(CurrentFilter, StringComparison.CurrentCultureIgnoreCase))
.Select(x => new AnnotationThumbnail(x.Value, _azaionApi.CurrentUser.Role.IsValidator()))
.OrderBy(x => !x.IsSeed)
.ThenByDescending(x =>x.Annotation.CreatedDate);
@@ -300,6 +301,11 @@ public partial class DatasetExplorer
private void TbSearch_OnTextChanged(object sender, TextChangedEventArgs e)
{
TbSearch.Foreground = TbSearch.Text.Length > 2 ? Brushes.Black : Brushes.Gray;
ThrottleExt.Throttle(ReloadThumbnails, SearchActionId, TimeSpan.FromMilliseconds(400));;
if (TbSearch.Text.Length > 2 || string.IsNullOrEmpty(TbSearch.Text))
{
CurrentFilter = TbSearch.Text;
ThrottleExt.Throttle(ReloadThumbnails, SearchActionId, TimeSpan.FromMilliseconds(400));
}
}
}