-
Notifications
You must be signed in to change notification settings - Fork 326
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
91 lines (83 loc) · 4.08 KB
/
Copy pathMainWindow.xaml
File metadata and controls
91 lines (83 loc) · 4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!-- Copyright (c) Microsoft Corporation.
Licensed under the MIT License. -->
<Window
x:Class="WindowsMLSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WindowsMLSample"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="Windows ML Sample - SqueezeNet Image Classification">
<Grid Margin="24">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Title -->
<TextBlock Grid.Row="0"
Text="SqueezeNet Image Classification Sample"
Style="{StaticResource TitleTextBlockStyle}"
HorizontalAlignment="Center"
Margin="0,0,0,24"/>
<!-- Controls -->
<Grid Grid.Row="1" Margin="0,0,0,24">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Row 0: EP & Device selection + reload -->
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" Spacing="12">
<TextBlock Text="Execution Provider:" VerticalAlignment="Center"/>
<ComboBox x:Name="EpCombo" Width="220" VerticalAlignment="Center"/>
<TextBlock Text="Device:" VerticalAlignment="Center" Margin="16,0,0,0"/>
<ComboBox x:Name="DeviceCombo" Width="140" VerticalAlignment="Center" IsEnabled="False"/>
<TextBlock Text="Perf Mode:" VerticalAlignment="Center" Margin="16,0,0,0"/>
<RadioButton x:Name="PerfModeDefaultRadio" Content="Default" GroupName="PerfMode" IsChecked="True" VerticalAlignment="Center"/>
<RadioButton x:Name="PerfModeMaxPerfRadio" Content="Max Perf" GroupName="PerfMode" VerticalAlignment="Center"/>
<RadioButton x:Name="PerfModeMaxEffRadio" Content="Max Eff" GroupName="PerfMode" VerticalAlignment="Center"/>
<Button x:Name="ReloadModelButton"
Content="Load / Reload Model"
Click="ReloadModelButton_Click"/>
</StackPanel>
<!-- Row 1: Provider download checkbox -->
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,12,0,0">
<CheckBox x:Name="AllowProviderDownloadCheckBox"
Content="Allow execution provider downloads"/>
</StackPanel>
</Grid>
<!-- Image Display Area -->
<Border Grid.Row="2"
Background="LightGray"
BorderBrush="Gray"
BorderThickness="1"
CornerRadius="4"
Margin="0,0,0,24">
<Image x:Name="SelectedImage"
Stretch="Uniform"
HorizontalAlignment="Center"
VerticalAlignment="Center"
MaxHeight="300"/>
</Border>
<!-- Results Area -->
<ScrollViewer Grid.Row="3">
<StackPanel>
<TextBlock Text="Classification Results:"
Style="{StaticResource SubtitleTextBlockStyle}"
Margin="0,0,0,12"/>
<Border Background="{ThemeResource LayerFillColorDefaultBrush}"
BorderBrush="{ThemeResource ControlStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="4"
Padding="12">
<TextBlock x:Name="ResultsText"
Text="Loading..."
TextWrapping="Wrap"
FontFamily="Consolas"/>
</Border>
</StackPanel>
</ScrollViewer>
</Grid>
</Window>