Skip to content

Commit e201d58

Browse files
authored
Merge pull request #425 from microsoft/user/sheilk/add-native-component
Add native component to enable C++ samples
2 parents a08bb78 + f98f397 commit e201d58

Some content is hidden

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

43 files changed

+864
-410
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ publish/
150150
*.azurePubxml
151151
# TODO: Comment the next line if you want to checkin your web deploy settings
152152
# but database connection strings (with potential passwords) will be unencrypted
153-
*.pubxml
154153
*.publishproj
155154

156155
# Microsoft Azure Web App publish settings. Comment the next line if you want to
Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,47 @@
11
# WinML Samples Gallery
22

3-
![WinML Samples Gallery Screenshot](README_Images/WinMLSamplesGalleryLanding.png)
3+
Demonstrates different machine learning scenarios and features using [Windows ML](https://docs.microsoft.com/en-us/windows/ai/windows-ml/) in an interactive format. This app is the interactive companion shows the integration of [Windows Machine Learning Library APIs](https://docs.microsoft.com/en-us/uwp/api/windows.ai.machinelearning) into a desktop [WinUI 3](https://github.com/microsoft/microsoft-ui-xaml) application.
44

5-
Demonstrates the different scenarios and features for [WinML](https://docs.microsoft.com/en-us/windows/ai/windows-ml/)
5+
<img src="docs/WinMLSamplesGalleryLanding.png" width="700"/>
66

7-
## The WinML Samples Gallery:
7+
- [Getting Started](#getting-started)
8+
- [Build From Source](#build-from-source)
9+
- [Samples](#samples)
10+
- [Feedback]($feedback)
11+
- [External Links](#links)
812

9-
- **Demonstrates different scenarios for which WinML excels**: Various use cases that deal with different types of inputs (image, audio, etc.) are demonstrated.
10-
- **Shows how to implement different scenarios and features**: Each sample comes with the corresponding code. Code snippets also presented in the app when applicable.
1113

12-
## 🐞 Found a bug? Want a new sample?
14+
## Getting Started
15+
- The WinML Samples Gallery is available in the Microsoft Store. Click [here](./) to download.
16+
- Check out the [source](https://github.com/microsoft/Windows-Machine-Learning/tree/master/Samples/WinMLSamplesGallery/WinMLSamplesGallery/Samples) for each sample.
1317

14-
If you find a bug **within the WinML Samples Gallery** or want to request a new sample, please [file an issue](https://github.com/microsoft/Windows-Machine-Learning/issues/new).
18+
## Build From Source
19+
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.
1520

16-
## Related topics
21+
### Prerequisites
22+
- [Visual Studio 2017 Version 15.7.4 or Newer](https://developer.microsoft.com/en-us/windows/downloads)
23+
- [Windows SDK - Build 18362 or Newer](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/)
1724

18-
[Windows Machine Learning Library (WinML)](https://docs.microsoft.com/en-us/windows/ai/windows-ml/)
25+
### Build
26+
- Clone this repository.
27+
- Navigate to **Windows-Machine-Learning/Samples/WinMLSamplesGallery**.
28+
- *(optional)* Make any changes to the *.csproj files needed to enable functionality.
29+
- Launch **WinMLSamplesGallery.sln**
30+
- Build and deploy the **WinMLSamplesGallery (Package)** project.
31+
32+
## Samples
33+
- [Image Classifiation](./WinMLSamplesGallery/Samples/ImageClassifier): Pick an image and classify the scene into 1000 categories such as keyboard, mouse, pencil, and many animals. This sample demonstrates image classification using a large number of models taken from the [ONNX Model Zoo](https://github.com/onnx/models).
34+
35+
- [Image Effects](./WinMLSamplesGallery/Samples/ImageEffects): Pick an image and apply a variety of effects powered by Windows AI MachineLearning like Blur, Sharpen, Contrast, and many more. These effects can be used to perform model input image preprocessing, or postprocessing for visualizing outputs.
36+
37+
- [Batched Inputs](./WinMLSamplesGallery/Samples/Batching): WinML enables batched inputs that allow callers to perform inference over multiple inputs at once in order to increase performance. Use this sample to compare inference runtime performace with and without batching.
38+
39+
## Feedback
40+
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.
41+
42+
## External Links
43+
44+
- [Windows ML Library (WinML)](https://docs.microsoft.com/en-us/windows/ai/windows-ml/)
45+
- [DirectML](https://github.com/microsoft/directml)
46+
- [ONNX Model Zoo](https://github.com/onnx/models)
47+
- [Windows UI Library (WinUI)](https://docs.microsoft.com/en-us/windows/apps/winui/)
Binary file not shown.

Samples/WinMLSamplesGallery/WinMLSamplesGallery (Package)/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Identity
1010
Name="42365107-cbb5-412e-80ac-554e5225ab17"
1111
Publisher="CN=Windows ML"
12-
Version="1.0.0.0" />
12+
Version="1.0.7.0" />
1313

1414
<Properties>
1515
<DisplayName>WinMLSamplesGallery (Package)</DisplayName>

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,31 @@
3636
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
3737
<PropertyGroup>
3838
<ProjectGuid>dea7791f-55cf-4ed5-bc99-3870997b1242</ProjectGuid>
39-
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
39+
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
4040
<AssetTargetFallback>net5.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
4141
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
4242
<DefaultLanguage>en-US</DefaultLanguage>
43-
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
43+
<AppxPackageSigningEnabled>False</AppxPackageSigningEnabled>
4444
<EntryPointProjectUniqueName>..\WinMLSamplesGallery\WinMLSamplesGallery.csproj</EntryPointProjectUniqueName>
4545
</PropertyGroup>
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm64'">
47+
<AppxBundle>Always</AppxBundle>
48+
</PropertyGroup>
49+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
50+
<AppxBundle>Always</AppxBundle>
51+
</PropertyGroup>
52+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm64'">
53+
<AppxBundle>Always</AppxBundle>
54+
</PropertyGroup>
55+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
56+
<AppxBundle>Always</AppxBundle>
57+
</PropertyGroup>
58+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
59+
<AppxBundle>Always</AppxBundle>
60+
</PropertyGroup>
61+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
62+
<AppxBundle>Always</AppxBundle>
63+
</PropertyGroup>
4664
<ItemGroup>
4765
<AppxManifest Include="Package.appxmanifest">
4866
<SubType>Designer</SubType>
@@ -100,13 +118,17 @@
100118
<Content Include="Images\Wide310x150Logo.scale-150.png" />
101119
<Content Include="Images\Wide310x150Logo.scale-200.png" />
102120
<Content Include="Images\Wide310x150Logo.scale-400.png" />
121+
<None Include="WinMLSamplesGallery %28Package%29_TemporaryKey.pfx" />
103122
</ItemGroup>
104123
<ItemGroup>
105124
<ProjectReference Include="..\WinMLSamplesGallery\WinMLSamplesGallery.csproj">
106125
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
107126
<PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
108127
</ProjectReference>
109128
</ItemGroup>
129+
<ItemGroup>
130+
<None Include="$(SolutionDir)$(Platform)\$(Configuration)\WinMLSamplesGalleryNative\*.dll" Link="%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
131+
</ItemGroup>
110132
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
111133
<ItemGroup>
112134
<PackageReference Include="Microsoft.AI.MachineLearning" Version="1.9.1" />

Samples/WinMLSamplesGallery/WinMLSamplesGallery.sln

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@ Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "WinMLSamplesGallery (Packag
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinMLSamplesGallery", "WinMLSamplesGallery\WinMLSamplesGallery.csproj", "{37DBE3F7-0DB2-4A96-954F-219294A757E1}"
99
EndProject
10+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinMLSamplesGalleryNative", "WinMLSamplesGalleryNative\WinMLSamplesGalleryNative.vcxproj", "{69E284E8-4542-4B92-A8CF-AD84D44FE553}"
11+
EndProject
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinMLSamplesGalleryNative.Interop", "WinMLSamplesGalleryNative.Interop\WinMLSamplesGalleryNative.Interop.csproj", "{8E1F2E33-58A3-4454-926E-1C98B93A2A30}"
13+
EndProject
1014
Global
1115
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12-
Debug|ARM = Debug|ARM
1316
Debug|arm64 = Debug|arm64
1417
Debug|x64 = Debug|x64
1518
Debug|x86 = Debug|x86
16-
Release|ARM = Release|ARM
1719
Release|arm64 = Release|arm64
1820
Release|x64 = Release|x64
1921
Release|x86 = Release|x86
2022
EndGlobalSection
2123
GlobalSection(ProjectConfigurationPlatforms) = postSolution
22-
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Debug|ARM.ActiveCfg = Debug|x86
2324
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Debug|arm64.ActiveCfg = Debug|arm64
2425
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Debug|arm64.Build.0 = Debug|arm64
2526
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Debug|arm64.Deploy.0 = Debug|arm64
@@ -29,7 +30,6 @@ Global
2930
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Debug|x86.ActiveCfg = Debug|x86
3031
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Debug|x86.Build.0 = Debug|x86
3132
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Debug|x86.Deploy.0 = Debug|x86
32-
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Release|ARM.ActiveCfg = Release|x86
3333
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Release|arm64.ActiveCfg = Release|arm64
3434
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Release|arm64.Build.0 = Release|arm64
3535
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Release|arm64.Deploy.0 = Release|arm64
@@ -39,20 +39,42 @@ Global
3939
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Release|x86.ActiveCfg = Release|x86
4040
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Release|x86.Build.0 = Release|x86
4141
{DEA7791F-55CF-4ED5-BC99-3870997B1242}.Release|x86.Deploy.0 = Release|x86
42-
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Debug|ARM.ActiveCfg = Debug|x86
4342
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Debug|arm64.ActiveCfg = Debug|arm64
4443
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Debug|arm64.Build.0 = Debug|arm64
4544
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Debug|x64.ActiveCfg = Debug|x64
4645
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Debug|x64.Build.0 = Debug|x64
4746
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Debug|x86.ActiveCfg = Debug|x86
4847
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Debug|x86.Build.0 = Debug|x86
49-
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Release|ARM.ActiveCfg = Release|x86
5048
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Release|arm64.ActiveCfg = Release|arm64
5149
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Release|arm64.Build.0 = Release|arm64
5250
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Release|x64.ActiveCfg = Release|x64
5351
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Release|x64.Build.0 = Release|x64
5452
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Release|x86.ActiveCfg = Release|x86
5553
{37DBE3F7-0DB2-4A96-954F-219294A757E1}.Release|x86.Build.0 = Release|x86
54+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Debug|arm64.ActiveCfg = Debug|arm64
55+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Debug|arm64.Build.0 = Debug|arm64
56+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Debug|x64.ActiveCfg = Debug|x64
57+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Debug|x64.Build.0 = Debug|x64
58+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Debug|x86.ActiveCfg = Debug|Win32
59+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Debug|x86.Build.0 = Debug|Win32
60+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Release|arm64.ActiveCfg = Release|arm64
61+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Release|arm64.Build.0 = Release|arm64
62+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Release|x64.ActiveCfg = Release|x64
63+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Release|x64.Build.0 = Release|x64
64+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Release|x86.ActiveCfg = Release|Win32
65+
{69E284E8-4542-4B92-A8CF-AD84D44FE553}.Release|x86.Build.0 = Release|Win32
66+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Debug|arm64.ActiveCfg = Debug|arm64
67+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Debug|arm64.Build.0 = Debug|arm64
68+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Debug|x64.ActiveCfg = Debug|x64
69+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Debug|x64.Build.0 = Debug|x64
70+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Debug|x86.ActiveCfg = Debug|x86
71+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Debug|x86.Build.0 = Debug|x86
72+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Release|arm64.ActiveCfg = Release|arm64
73+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Release|arm64.Build.0 = Release|arm64
74+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Release|x64.ActiveCfg = Release|x64
75+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Release|x64.Build.0 = Release|x64
76+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Release|x86.ActiveCfg = Release|x86
77+
{8E1F2E33-58A3-4454-926E-1C98B93A2A30}.Release|x86.Build.0 = Release|x86
5678
EndGlobalSection
5779
GlobalSection(SolutionProperties) = preSolution
5880
HideSolutionNode = FALSE

Samples/WinMLSamplesGallery/WinMLSamplesGallery/MainWindow.xaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
<NavigationViewItem Icon="Flag" Content="Home" Tag="home" />
2626
<NavigationViewItem Icon="Library" Content="All samples" Tag="all_samples" />
2727
<NavigationViewItemSeparator />
28+
<!--
2829
<NavigationViewItemHeader>Workloads</NavigationViewItemHeader>
29-
<NavigationViewItem Icon="Library" Content="Image" Tag="image" />
30-
<NavigationViewItem Icon="Library" Content="Video" Tag="video" />
31-
<NavigationViewItem Icon="Library" Content="Audio" Tag="audio" />
30+
<NavigationViewItem Icon="Library" Content="Image" Tag="image" IsEnabled="False" />
31+
<NavigationViewItem Icon="Library" Content="Video" Tag="video" IsEnabled="False" />
32+
<NavigationViewItem Icon="Library" Content="Audio" Tag="audio" IsEnabled="False" />
3233
<NavigationViewItemSeparator />
33-
<NavigationViewItem Icon="Library" Content="Benchmark" Tag="benchmark" />
34+
<NavigationViewItem Icon="Library" Content="Benchmark" Tag="benchmark" IsEnabled="False" />
35+
-->
3436
</NavigationView.MenuItems>
3537
<Frame x:Name="contentFrame" Navigated="contentFrame_Navigated" BorderBrush="#dbdbdb" BorderThickness="1,1,0,0" Margin="0,40,0,0"
3638
CornerRadius="5,0,0,0" Background="White" FontFamily="Arial"/>

Samples/WinMLSamplesGallery/WinMLSamplesGallery/MainWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public sealed partial class MainWindow : Window
2929
public MainWindow()
3030
{
3131
this.InitializeComponent();
32-
this.Title = "Windows AI Samples Gallery";
32+
this.Title = "Windows ML Samples Gallery";
3333
mainFrame = contentFrame;
3434
}
3535

Samples/WinMLSamplesGallery/WinMLSamplesGallery/Pages/HomePage.xaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top" Height="250">
1919
<Image Source="assets/winml_icon.ico" Stretch="UniformToFill" Height="200" VerticalAlignment="Center"/>
2020
<StackPanel Orientation="Vertical" Padding="25,0,0,0" VerticalAlignment="Center">
21-
<TextBlock Foreground="#12bef6" FontSize="60" FontFamily="Segoe UI Light" FontWeight="SemiBold" HorizontalAlignment="Center">Windows AI</TextBlock>
22-
<TextBlock Foreground="#12bef6" FontSize="50" FontFamily="Segoe UI Light" FontWeight="SemiBold" HorizontalAlignment="Center">1.8</TextBlock>
21+
<TextBlock Foreground="#12bef6" FontSize="60" FontFamily="Segoe UI Light" FontWeight="SemiBold" HorizontalAlignment="Center">Windows ML</TextBlock>
22+
<TextBlock Foreground="#12bef6" FontSize="50" FontFamily="Segoe UI Light" FontWeight="SemiBold" HorizontalAlignment="Center">1.9.1</TextBlock>
2323
</StackPanel>
2424
</StackPanel>
2525
</Grid>
@@ -35,7 +35,6 @@
3535
Padding="10,20,0,5"
3636
Typography.Capitals="SmallCaps"
3737
Typography.StylisticSet4="True">Recently Added</TextBlock>
38-
3938
<Frame x:Name="SamplesGrid" />
4039
</StackPanel>
4140
</ScrollViewer>

0 commit comments

Comments
 (0)