Skip to content

Commit 209fdc2

Browse files
authored
Merge branch 'main' into milly/idisp
2 parents 7aa4541 + b3153cd commit 209fdc2

File tree

10 files changed

+19
-11
lines changed

10 files changed

+19
-11
lines changed

AIDevGallery/Controls/ModelPicker/AddHFModelView.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@
5656
Grid.Row="1"
5757
HorizontalAlignment="Center"
5858
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
59-
Text="Browse and download generative language models from Hugging Face." />
59+
Text="Browse and download generative language models from Hugging Face."
60+
TextAlignment="Center"
61+
TextWrapping="Wrap" />
6062
<Grid
6163
Grid.Row="2"
6264
MaxWidth="560"

AIDevGallery/Samples/Open Source Models/Image Models/ESRGAN/SuperResolution.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ private async void UploadButton_Click(object sender, RoutedEventArgs e)
139139

140140
// Pick a file
141141
var file = await picker.PickSingleFileAsync();
142+
UploadButton.Focus(FocusState.Programmatic);
142143
if (file != null)
143144
{
144145
// Call function to run inference and classify image
145-
UploadButton.Focus(FocusState.Programmatic);
146146
SendSampleInteractedEvent("FileSelected"); // <exclude-line>
147147
await EnhanceImage(file.Path);
148148
}

AIDevGallery/Samples/Open Source Models/Image Models/FFNet/SegmentStreets.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
Visibility="Collapsed" />
3636
<Grid
3737
Margin="8"
38+
Padding="2"
3839
HorizontalAlignment="Right"
3940
VerticalAlignment="Top"
4041
Background="{ThemeResource AcrylicBackgroundFillColorDefaultBrush}"
@@ -44,6 +45,7 @@
4445
Padding="8"
4546
AutomationProperties.Name="Select image"
4647
Click="UploadButton_Click"
48+
FocusVisualMargin="-3"
4749
ToolTipService.ToolTip="Select image">
4850

4951
<FontIcon FontSize="16" Glyph="&#xEE71;" />

AIDevGallery/Samples/Open Source Models/Image Models/FFNet/SegmentStreets.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ private async void UploadButton_Click(object sender, RoutedEventArgs e)
134134
picker.ViewMode = PickerViewMode.Thumbnail;
135135

136136
var file = await picker.PickSingleFileAsync();
137+
UploadButton.Focus(FocusState.Programmatic);
137138
if (file != null)
138139
{
139-
UploadButton.Focus(FocusState.Programmatic);
140140
SendSampleInteractedEvent("FileSelected"); // <exclude-line>
141141
await Segment(file.Path);
142142
}
@@ -154,7 +154,7 @@ private async Task Segment(string filePath)
154154
UploadButton.Visibility = Visibility.Collapsed;
155155

156156
DefaultImage.Source = new BitmapImage(new Uri(filePath));
157-
NarratorHelper.AnnounceImageChanged(DefaultImage, "Image changed: new upload."); // <exclude-line>
157+
NarratorHelper.AnnounceImageChanged(DefaultImage, "Content changed: new upload."); // <exclude-line>
158158

159159
using Bitmap originalImage = new(filePath);
160160
int originalImageWidth = originalImage.Width;
@@ -277,7 +277,7 @@ private async Task Segment(string filePath)
277277
// Convert the final overlay to BitmapImage for display
278278
BitmapImage outputImage = BitmapFunctions.ConvertBitmapToBitmapImage(processedImage);
279279

280-
NarratorHelper.AnnounceImageChanged(DefaultImage, "Image changed: all regions segmented."); // <exclude-line>
280+
NarratorHelper.AnnounceImageChanged(DefaultImage, "Content changed: all regions segmented."); // <exclude-line>
281281

282282
DispatcherQueue.TryEnqueue(() =>
283283
{

AIDevGallery/Samples/Open Source Models/Image Models/Faster RCNN/ObjectDetection.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ private async void UploadButton_Click(object sender, RoutedEventArgs e)
136136
picker.ViewMode = PickerViewMode.Thumbnail;
137137

138138
var file = await picker.PickSingleFileAsync();
139+
UploadButton.Focus(FocusState.Programmatic);
139140
if (file != null)
140141
{
141-
UploadButton.Focus(FocusState.Programmatic);
142142
SendSampleInteractedEvent("FileSelected"); // <exclude-line>
143143
await DetectObjects(file.Path);
144144
}

AIDevGallery/Samples/Open Source Models/Image Models/HRNetPose/PoseDetection.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
Visibility="Collapsed" />
3636
<Grid
3737
Margin="8"
38+
Padding="2"
3839
HorizontalAlignment="Right"
3940
VerticalAlignment="Top"
4041
Background="{ThemeResource AcrylicBackgroundFillColorDefaultBrush}"
@@ -44,6 +45,7 @@
4445
Padding="8"
4546
AutomationProperties.Name="Select image"
4647
Click="UploadButton_Click"
48+
FocusVisualMargin="-3"
4749
ToolTipService.ToolTip="Select image">
4850

4951
<FontIcon FontSize="16" Glyph="&#xEE71;" />

AIDevGallery/Samples/Open Source Models/Image Models/HRNetPose/PoseDetection.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ private async void UploadButton_Click(object sender, RoutedEventArgs e)
133133
picker.ViewMode = PickerViewMode.Thumbnail;
134134

135135
var file = await picker.PickSingleFileAsync();
136+
UploadButton.Focus(FocusState.Programmatic);
136137
if (file != null)
137138
{
138-
UploadButton.Focus(FocusState.Programmatic);
139139
SendSampleInteractedEvent("FileSelected"); // <exclude-line>
140140
await DetectPose(file.Path);
141141
}
@@ -152,7 +152,7 @@ private async Task DetectPose(string filePath)
152152
Loader.Visibility = Visibility.Visible;
153153
UploadButton.Visibility = Visibility.Collapsed;
154154
DefaultImage.Source = new BitmapImage(new Uri(filePath));
155-
NarratorHelper.AnnounceImageChanged(DefaultImage, "Image changed: new upload."); // <exclude-line>
155+
NarratorHelper.AnnounceImageChanged(DefaultImage, "Content changed: new upload."); // <exclude-line>
156156

157157
using Bitmap originalImage = new(filePath);
158158

@@ -188,7 +188,7 @@ private async Task DetectPose(string filePath)
188188

189189
using Bitmap output = PoseHelper.RenderPredictions(originalImage, predictions, .02f);
190190
BitmapImage outputImage = BitmapFunctions.ConvertBitmapToBitmapImage(output);
191-
NarratorHelper.AnnounceImageChanged(DefaultImage, "Image changed: key points rendered."); // <exclude-line>
191+
NarratorHelper.AnnounceImageChanged(DefaultImage, "Content changed: key points rendered."); // <exclude-line>
192192

193193
DispatcherQueue.TryEnqueue(() =>
194194
{

AIDevGallery/Samples/Open Source Models/Image Models/MultiHRNetPose/Multipose.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
Visibility="Collapsed" />
3636
<Grid
3737
Margin="8"
38+
Padding="2"
3839
HorizontalAlignment="Right"
3940
VerticalAlignment="Top"
4041
Background="{ThemeResource AcrylicBackgroundFillColorDefaultBrush}"
@@ -44,6 +45,7 @@
4445
Padding="8"
4546
AutomationProperties.Name="Select image"
4647
Click="UploadButton_Click"
48+
FocusVisualMargin="-3"
4749
ToolTipService.ToolTip="Select image">
4850

4951
<FontIcon FontSize="16" Glyph="&#xEE71;" />

AIDevGallery/Samples/Open Source Models/Image Models/MultiHRNetPose/Multipose.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ private async void UploadButton_Click(object sender, RoutedEventArgs e)
152152
picker.ViewMode = PickerViewMode.Thumbnail;
153153

154154
var file = await picker.PickSingleFileAsync();
155+
UploadButton.Focus(FocusState.Programmatic);
155156
if (file != null)
156157
{
157158
// Call function to run inference and classify image
158-
UploadButton.Focus(FocusState.Programmatic);
159159
SendSampleInteractedEvent("FileSelected"); // <exclude-line>
160160
await RunPipeline(file.Path);
161161
}

AIDevGallery/Samples/Open Source Models/Image Models/YOLOv4/YOLOObjectDetection.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ private async void UploadButton_Click(object sender, RoutedEventArgs e)
142142

143143
// Pick a file
144144
var file = await picker.PickSingleFileAsync();
145+
UploadButton.Focus(FocusState.Programmatic);
145146
if (file != null)
146147
{
147148
// Call function to run inference and classify image
148-
UploadButton.Focus(FocusState.Programmatic);
149149
SendSampleInteractedEvent("FileSelected"); // <exclude-line>
150150
await DetectObjects(file.Path);
151151
}

0 commit comments

Comments
 (0)