mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:16:30 +00:00
added better logging to python
add day / winter / night switcher
This commit is contained in:
@@ -93,38 +93,20 @@ public partial class DatasetExplorer
|
||||
AllDetectionClasses = new ObservableCollection<DetectionClass>(
|
||||
new List<DetectionClass> { new() {Id = -1, Name = "All", ShortName = "All"}}
|
||||
.Concat(_annotationConfig.AnnotationClasses));
|
||||
LvClasses.ItemsSource = AllDetectionClasses;
|
||||
LvClasses.DetectionDataGrid.ItemsSource = AllDetectionClasses;
|
||||
|
||||
LvClasses.MouseUp += async (_, _) =>
|
||||
LvClasses.DetectionClassChanged += async (_, args) =>
|
||||
{
|
||||
var selectedClass = (DetectionClass)LvClasses.SelectedItem;
|
||||
ExplorerEditor.CurrentAnnClass = selectedClass;
|
||||
_annotationConfig.LastSelectedExplorerClass = selectedClass.Id;
|
||||
ExplorerEditor.CurrentAnnClass = args.DetectionClass;
|
||||
|
||||
if (Switcher.SelectedIndex == 0)
|
||||
await ReloadThumbnails();
|
||||
else
|
||||
foreach (var ann in ExplorerEditor.CurrentDetections.Where(x => x.IsSelected))
|
||||
ann.DetectionClass = selectedClass;
|
||||
ann.DetectionClass = args.DetectionClass;
|
||||
};
|
||||
|
||||
LvClasses.SelectionChanged += (_, _) =>
|
||||
{
|
||||
if (Switcher.SelectedIndex != 1)
|
||||
return;
|
||||
|
||||
var selectedClass = (DetectionClass)LvClasses.SelectedItem;
|
||||
if (selectedClass == null)
|
||||
return;
|
||||
|
||||
ExplorerEditor.CurrentAnnClass = selectedClass;
|
||||
|
||||
foreach (var ann in ExplorerEditor.CurrentDetections.Where(x => x.IsSelected))
|
||||
ann.DetectionClass = selectedClass;
|
||||
};
|
||||
|
||||
LvClasses.SelectedIndex = _annotationConfig.LastSelectedExplorerClass ?? 0;
|
||||
ExplorerEditor.CurrentAnnClass = (DetectionClass)LvClasses.SelectedItem;
|
||||
ExplorerEditor.CurrentAnnClass = (DetectionClass)LvClasses.CurrentDetectionClass;
|
||||
|
||||
await _dbFactory.Run(async db =>
|
||||
{
|
||||
@@ -256,18 +238,18 @@ public partial class DatasetExplorer
|
||||
{
|
||||
AnnotationsTab.Visibility = Visibility.Collapsed;
|
||||
EditorTab.Visibility = Visibility.Visible;
|
||||
_tempSelectedClassIdx = LvClasses.SelectedIndex;
|
||||
LvClasses.ItemsSource = _annotationConfig.AnnotationClasses;
|
||||
_tempSelectedClassIdx = LvClasses.CurrentClassNumber;
|
||||
LvClasses.DetectionDataGrid.ItemsSource = _annotationConfig.AnnotationClasses;
|
||||
|
||||
Switcher.SelectedIndex = 1;
|
||||
LvClasses.SelectedIndex = Math.Max(0, _tempSelectedClassIdx - 1);
|
||||
LvClasses.SelectNum(Math.Max(0, _tempSelectedClassIdx - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
AnnotationsTab.Visibility = Visibility.Visible;
|
||||
EditorTab.Visibility = Visibility.Collapsed;
|
||||
LvClasses.ItemsSource = AllDetectionClasses;
|
||||
LvClasses.SelectedIndex = _tempSelectedClassIdx;
|
||||
LvClasses.DetectionDataGrid.ItemsSource = AllDetectionClasses;
|
||||
LvClasses.SelectNum(_tempSelectedClassIdx);
|
||||
Switcher.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user