Skip to content

Commit 5724223

Browse files
authored
Merge pull request #495 from microsoft/feature/stream-sample
Feature/stream sample
2 parents 4c96067 + 07b83e8 commit 5724223

File tree

73 files changed

+10661
-66
lines changed

Some content is hidden

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

73 files changed

+10661
-66
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,4 +289,7 @@ __pycache__/
289289
*.xsd.cs
290290

291291
# UWP Generated files
292-
**/Generated Files/
292+
**/Generated Files/
293+
/Samples/StyleTransfer/Assets
294+
/Samples/CustomTensorization/CustomTensorization/output_gpu.png
295+
/Samples/CustomTensorization/CustomTensorization/output_cpu.png
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
*.onnx
22
!squeezenet1.1-7-batched.onnx
33
!encrypted.onnx
4+
<<<<<<< HEAD
5+
!mosaic.onnx
46
!efficientnet-lite4-11.onnx
5-
!dx_preprocessor_efficient_net.onnx
7+
!dx_preprocessor_efficient_net.onnx
8+
=======
9+
!efficientnet-lite4-11.onnx
10+
!dx_preprocessor_efficient_net.onnx
11+
>>>>>>> master
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0'">
4+
<VisualStudioVersion>15.0</VisualStudioVersion>
5+
</PropertyGroup>
6+
<ItemGroup Label="ProjectConfigurations">
7+
<ProjectConfiguration Include="Debug|x86">
8+
<Configuration>Debug</Configuration>
9+
<Platform>x86</Platform>
10+
</ProjectConfiguration>
11+
<ProjectConfiguration Include="Release|x86">
12+
<Configuration>Release</Configuration>
13+
<Platform>x86</Platform>
14+
</ProjectConfiguration>
15+
<ProjectConfiguration Include="Debug|x64">
16+
<Configuration>Debug</Configuration>
17+
<Platform>x64</Platform>
18+
</ProjectConfiguration>
19+
<ProjectConfiguration Include="Release|x64">
20+
<Configuration>Release</Configuration>
21+
<Platform>x64</Platform>
22+
</ProjectConfiguration>
23+
<ProjectConfiguration Include="Debug|arm64">
24+
<Configuration>Debug</Configuration>
25+
<Platform>arm64</Platform>
26+
</ProjectConfiguration>
27+
<ProjectConfiguration Include="Release|arm64">
28+
<Configuration>Release</Configuration>
29+
<Platform>arm64</Platform>
30+
</ProjectConfiguration>
31+
</ItemGroup>
32+
<PropertyGroup>
33+
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
34+
<PathToXAMLWinRTImplementations>WinMLSamplesGallery\</PathToXAMLWinRTImplementations>
35+
</PropertyGroup>
36+
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
37+
<PropertyGroup>
38+
<ProjectGuid>dea7791f-55cf-4ed5-bc99-3870997b1242</ProjectGuid>
39+
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
40+
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
41+
<AssetTargetFallback>net5.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
42+
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
43+
<DefaultLanguage>en-US</DefaultLanguage>
44+
<AppxPackageSigningEnabled>False</AppxPackageSigningEnabled>
45+
<EntryPointProjectUniqueName>..\WinMLSamplesGallery\WinMLSamplesGallery.csproj</EntryPointProjectUniqueName>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm64'">
48+
<AppxBundle>Always</AppxBundle>
49+
</PropertyGroup>
50+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
51+
<AppxBundle>Always</AppxBundle>
52+
</PropertyGroup>
53+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm64'">
54+
<AppxBundle>Always</AppxBundle>
55+
</PropertyGroup>
56+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
57+
<AppxBundle>Always</AppxBundle>
58+
</PropertyGroup>
59+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
60+
<AppxBundle>Always</AppxBundle>
61+
</PropertyGroup>
62+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
63+
<AppxBundle>Always</AppxBundle>
64+
</PropertyGroup>
65+
<ItemGroup>
66+
<AppxManifest Include="Package.appxmanifest">
67+
<SubType>Designer</SubType>
68+
</AppxManifest>
69+
</ItemGroup>
70+
<ItemGroup>
71+
<Content Include="Images\LargeTile.scale-100.png" />
72+
<Content Include="Images\LargeTile.scale-125.png" />
73+
<Content Include="Images\LargeTile.scale-150.png" />
74+
<Content Include="Images\LargeTile.scale-200.png" />
75+
<Content Include="Images\LargeTile.scale-400.png" />
76+
<Content Include="Images\SmallTile.scale-100.png" />
77+
<Content Include="Images\SmallTile.scale-125.png" />
78+
<Content Include="Images\SmallTile.scale-150.png" />
79+
<Content Include="Images\SmallTile.scale-200.png" />
80+
<Content Include="Images\SmallTile.scale-400.png" />
81+
<Content Include="Images\SplashScreen.scale-100.png" />
82+
<Content Include="Images\SplashScreen.scale-125.png" />
83+
<Content Include="Images\SplashScreen.scale-150.png" />
84+
<Content Include="Images\SplashScreen.scale-200.png" />
85+
<Content Include="Images\LockScreenLogo.scale-200.png" />
86+
<Content Include="Images\SplashScreen.scale-400.png" />
87+
<Content Include="Images\Square150x150Logo.scale-100.png" />
88+
<Content Include="Images\Square150x150Logo.scale-125.png" />
89+
<Content Include="Images\Square150x150Logo.scale-150.png" />
90+
<Content Include="Images\Square150x150Logo.scale-200.png" />
91+
<Content Include="Images\Square150x150Logo.scale-400.png" />
92+
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-16.png" />
93+
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-24.png" />
94+
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-256.png" />
95+
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-32.png" />
96+
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-48.png" />
97+
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-16.png" />
98+
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-256.png" />
99+
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-32.png" />
100+
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-48.png" />
101+
<Content Include="Images\Square44x44Logo.scale-100.png" />
102+
<Content Include="Images\Square44x44Logo.scale-125.png" />
103+
<Content Include="Images\Square44x44Logo.scale-150.png" />
104+
<Content Include="Images\Square44x44Logo.scale-200.png" />
105+
<Content Include="Images\Square44x44Logo.scale-400.png" />
106+
<Content Include="Images\Square44x44Logo.targetsize-16.png" />
107+
<Content Include="Images\Square44x44Logo.targetsize-24.png" />
108+
<Content Include="Images\Square44x44Logo.targetsize-24_altform-unplated.png" />
109+
<Content Include="Images\Square44x44Logo.targetsize-256.png" />
110+
<Content Include="Images\Square44x44Logo.targetsize-32.png" />
111+
<Content Include="Images\Square44x44Logo.targetsize-48.png" />
112+
<Content Include="Images\StoreLogo.scale-100.png" />
113+
<Content Include="Images\StoreLogo.scale-125.png" />
114+
<Content Include="Images\StoreLogo.scale-150.png" />
115+
<Content Include="Images\StoreLogo.scale-200.png" />
116+
<Content Include="Images\StoreLogo.scale-400.png" />
117+
<Content Include="Images\Wide310x150Logo.scale-100.png" />
118+
<Content Include="Images\Wide310x150Logo.scale-125.png" />
119+
<Content Include="Images\Wide310x150Logo.scale-150.png" />
120+
<Content Include="Images\Wide310x150Logo.scale-200.png" />
121+
<Content Include="Images\Wide310x150Logo.scale-400.png" />
122+
<None Include="WinMLSamplesGallery %28Package%29_TemporaryKey.pfx" />
123+
</ItemGroup>
124+
<ItemGroup>
125+
<ProjectReference Include="..\WinMLSamplesGallery\WinMLSamplesGallery.csproj">
126+
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
127+
<PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
128+
</ProjectReference>
129+
</ItemGroup>
130+
<ItemGroup>
131+
<None Include="$(SolutionDir)..\..\build\external\opencv\cmake_config\$(Platform)\bin\$(Configuration)\*.dll" Link="%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
132+
</ItemGroup>
133+
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
134+
<ItemGroup>
135+
<PackageReference Include="Microsoft.AI.MachineLearning" Version="1.9.1" />
136+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0-stable" />
137+
</ItemGroup>
138+
</Project>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
4040
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
4141
<AssetTargetFallback>net5.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
42-
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
42+
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
4343
<DefaultLanguage>en-US</DefaultLanguage>
4444
<AppxPackageSigningEnabled>False</AppxPackageSigningEnabled>
4545
<EntryPointProjectUniqueName>..\WinMLSamplesGallery\WinMLSamplesGallery.csproj</EntryPointProjectUniqueName>
@@ -132,7 +132,7 @@
132132
</ItemGroup>
133133
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
134134
<ItemGroup>
135-
<PackageReference Include="Microsoft.AI.MachineLearning" Version="1.11.0" />
136-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0-stable" />
135+
<PackageReference Include="Microsoft.AI.MachineLearning" Version="1.12.1" />
136+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.4" />
137137
</ItemGroup>
138138
</Project>

Samples/WinMLSamplesGallery/WinMLSamplesGallery.sln

Lines changed: 2 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 17
4-
VisualStudioVersion = 17.0.31919.166
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.32407.337
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

Samples/WinMLSamplesGallery/WinMLSamplesGallery/Controls/DeviceComboBox.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ private void changeSelectedIndex(object sender, RoutedEventArgs e)
1717
SelectedIndex = DeviceBox.SelectedIndex;
1818
}
1919

20+
public int GetSelectedIndex()
21+
{
22+
return SelectedIndex;
23+
}
24+
2025
public LearningModelDeviceKind GetDeviceKind()
2126
{
2227
if (SelectedIndex == 0)

Samples/WinMLSamplesGallery/WinMLSamplesGallery/MainWindow.xaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55
xmlns:local="using:WinMLSamplesGallery"
66
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
77
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
89
mc:Ignorable="d">
910

10-
<Grid Background="#f5f5f5">
11+
<Grid Background="#f5f5f5">
12+
<Rectangle
13+
Fill="Blue"
14+
Width="100"
15+
Height="100"
16+
/>
1117
<NavigationView
1218
IsBackEnabled="True"
1319
x:Name="nvSample"

Samples/WinMLSamplesGallery/WinMLSamplesGallery/MainWindow.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ public sealed partial class MainWindow : Window
2525
};
2626

2727
public static Frame mainFrame;
28+
public static NavigationView navigationView;
2829

2930
public MainWindow()
3031
{
3132
this.InitializeComponent();
3233
this.Title = "Windows ML Samples Gallery";
3334
mainFrame = contentFrame;
35+
navigationView = nvSample;
3436
}
3537

3638
private void nvSample_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
Binary file not shown.

Samples/WinMLSamplesGallery/WinMLSamplesGallery/Pages/SampleBasePage.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ protected override async void OnNavigatedTo(NavigationEventArgs e)
4242
case "AdapterSelection":
4343
SampleFrame.Navigate(typeof(Samples.AdapterSelection));
4444
break;
45+
case "StreamEffect":
46+
SampleFrame.Navigate(typeof(Samples.StreamEffect));
47+
break;
4548
case "DXResourceBindingORT":
4649
SampleFrame.Navigate(typeof(Samples.DXResourceBindingORT));
4750
break;
@@ -60,6 +63,12 @@ protected override async void OnNavigatingFrom(NavigatingCancelEventArgs e)
6063
var page = (Samples.Batching)SampleFrame.Content;
6164
page.StopAllEvents();
6265
}
66+
// Batching Sample contains background thread events that may need to be stopped.
67+
else if (SampleFrame.SourcePageType == typeof(Samples.StreamEffect))
68+
{
69+
var page = (Samples.StreamEffect)SampleFrame.Content;
70+
page.CloseInferenceWindow();
71+
}
6372
else if(SampleFrame.SourcePageType == typeof(Samples.DXResourceBindingORT))
6473
{
6574
var page = (Samples.DXResourceBindingORT)SampleFrame.Content;

0 commit comments

Comments
 (0)