Skip to content

Commit 6cc69e5

Browse files
authored
Merge pull request #450 from microsoft/user/sheilk/random-access-stream
Add Encrypted Models Sample
2 parents 0e4e66d + 31c8874 commit 6cc69e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1329
-347
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ These advanced samples show how to use various binding and evaluation features i
113113

114114
- **[YoloV4 Object Detection](https://github.com/Microsoft/Windows-AppConsult-Samples-UWP/tree/master/PlaneIdentifier)**: This tutorial shows how to build a UWP C# app that uses the YOLOv4 model to detect objects in video streams.
115115

116-
- **[OpenCV](Samples/WinMLSamplesGallery/WinMLSamplesGallery/Samples/OpenCVInterop)**: See how to integrate [Windows ML](https://docs.microsoft.com/en-us/windows/ai/windows-ml/) with [OpenCV](https://github.com/opencv/opencv).
117-
118-
- **[ImageSharp](Samples/WinMLSamplesGallery/WinMLSamplesGallery/Samples/ImageSharpInterop)**: See how to integrate [Windows ML](https://docs.microsoft.com/en-us/windows/ai/windows-ml/) with [ImageSharp](https://github.com/SixLabors/ImageSharp).
119-
120-
121116
## Developer Tools
122117

123118
- **Model Conversion**
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.cs]
2+
3+
# CA1416: Validate platform compatibility
4+
dotnet_diagnostic.CA1416.severity = silent
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.onnx
2-
!squeezenet1.1-7-batched.onnx
2+
!squeezenet1.1-7-batched.onnx
3+
!encrypted.onnx

Samples/WinMLSamplesGallery/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Demonstrates different machine learning scenarios and features using [Windows ML
1919
To learn how to implement these features in your application, or unlock additional functionality that may not be available in the Store Application, you may need to build the WinML Samples Gallery from source. Follow these instructions to build from source.
2020

2121
### Prerequisites
22-
- [Visual Studio 2017 Version 15.7.4 or Newer](https://developer.microsoft.com/en-us/windows/downloads)
22+
- [Visual Studio 2022](https://developer.microsoft.com/en-us/windows/downloads)
2323
- [Windows SDK - Build 18362 or Newer](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/)
2424

2525
### Build
@@ -39,6 +39,9 @@ To learn how to implement these features in your application, or unlock addition
3939
- [OpenCV](./WinMLSamplesGallery/Samples/OpenCVInterop): See how to integrate [Windows ML](https://docs.microsoft.com/en-us/windows/ai/windows-ml/) with [OpenCV](https://github.com/opencv/opencv).
4040

4141
- [ImageSharp](./WinMLSamplesGallery/Samples/ImageSharpInterop): See how to integrate [Windows ML](https://docs.microsoft.com/en-us/windows/ai/windows-ml/) with [ImageSharp](https://docs.sixlabors.com/articles/imagesharp/index.html).
42+
43+
- [Encrypted Model](./WinMLSamplesGallery/Samples/EncryptedModel): how to use [Windows ML](https://docs.microsoft.com/en-us/windows/ai/windows-ml/) to load encrypted models from embedded resources.
44+
4245
## Feedback
4346
Please file an issue [here](https://github.com/microsoft/Windows-Machine-Learning/issues/new) if you encounter any issues with the WinML Samples Gallery or wish to request a new sample.
4447

Samples/WinMLSamplesGallery/WinMLSamplesGallery (Package)/WinMLSamplesGallery (Package).wapproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@
128128
</ProjectReference>
129129
</ItemGroup>
130130
<ItemGroup>
131-
<None Include="$(SolutionDir)$(Platform)\$(Configuration)\WinMLSamplesGalleryNative\*.dll" Link="%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
132131
<None Include="$(SolutionDir)..\..\build\external\opencv\cmake_config\$(Platform)\bin\$(Configuration)\*.dll" Link="%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
133132
</ItemGroup>
134133
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />

Samples/WinMLSamplesGallery/WinMLSamplesGallery.sln

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.31112.23
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31919.166
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "WinMLSamplesGallery (Package)", "WinMLSamplesGallery (Package)\WinMLSamplesGallery (Package).wapproj", "{DEA7791F-55CF-4ED5-BC99-3870997B1242}"
77
EndProject
@@ -11,6 +11,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinMLSamplesGalleryNative",
1111
EndProject
1212
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinMLSamplesGalleryNative.Interop", "WinMLSamplesGalleryNative.Interop\WinMLSamplesGalleryNative.Interop.csproj", "{8E1F2E33-58A3-4454-926E-1C98B93A2A30}"
1313
EndProject
14+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7EDD189E-04E6-432A-80A6-7811E157E9F6}"
15+
ProjectSection(SolutionItems) = preProject
16+
.editorconfig = .editorconfig
17+
EndProjectSection
18+
EndProject
1419
Global
1520
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1621
Debug|arm64 = Debug|arm64

Samples/WinMLSamplesGallery/WinMLSamplesGallery/MainWindow.xaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
AlwaysShowHeader="False"
1818
PaneTitle="Windows ML"
1919
FontFamily="Arial"
20-
IsSettingsVisible="False">
20+
IsSettingsVisible="False"
21+
PaneClosing="nvSample_PaneClosing"
22+
PaneOpening="nvSample_PaneOpening">
2123
<NavigationView.Resources>
2224
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="#f5f5f5"/>
2325
<SolidColorBrush x:Key="NavigationViewDefaultPaneBackground" Color="#f5f5f5" />
@@ -26,11 +28,13 @@
2628
<NavigationViewItem Icon="Flag" Content="Home" Tag="home" />
2729
<NavigationViewItem Icon="Library" Content="All samples" Tag="all_samples" />
2830
<NavigationViewItemSeparator />
29-
<TextBlock>
30-
<Hyperlink TextDecorations="None" NavigateUri="https://docs.microsoft.com/en-us/windows/ai/windows-ml/">
31-
Learn more about Windows ML
32-
</Hyperlink>
33-
</TextBlock>
31+
<Grid>
32+
<TextBlock x:Name="LearnMoreLink">
33+
<Hyperlink TextDecorations="None" NavigateUri="https://docs.microsoft.com/en-us/windows/ai/windows-ml/">
34+
Learn more about Windows ML
35+
</Hyperlink>
36+
</TextBlock>
37+
</Grid>
3438
</NavigationView.MenuItems>
3539
<Frame x:Name="contentFrame" Navigated="contentFrame_Navigated" BorderBrush="#dbdbdb" BorderThickness="1,1,0,0" Margin="0,40,0,0"
3640
CornerRadius="5,0,0,0" Background="White" FontFamily="Arial"/>

Samples/WinMLSamplesGallery/WinMLSamplesGallery/MainWindow.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,15 @@ private void nvSample_Loaded(object sender, RoutedEventArgs e)
110110
// here to load the home page.
111111
NavView_Navigate("home", new Microsoft.UI.Xaml.Media.Animation.EntranceNavigationTransitionInfo());
112112
}
113+
114+
private void nvSample_PaneClosing(NavigationView sender, NavigationViewPaneClosingEventArgs args)
115+
{
116+
LearnMoreLink.Visibility = Visibility.Collapsed;
117+
}
118+
119+
private void nvSample_PaneOpening(NavigationView sender, object args)
120+
{
121+
LearnMoreLink.Visibility = Visibility.Visible;
122+
}
113123
}
114124
}
Binary file not shown.

Samples/WinMLSamplesGallery/WinMLSamplesGallery/Pages/AllSamplesPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public sealed partial class AllSamplesPage : Page
1010
public AllSamplesPage()
1111
{
1212
this.InitializeComponent();
13-
SamplesGrid.Navigate(typeof(SamplesGrid));
13+
SamplesGrid.Navigate(typeof(SamplesGrid), typeof(AllSamplesPage));
1414
}
1515
}
1616
}

0 commit comments

Comments
 (0)