From 1be183a918a1dcc8248d30894a01f388e0399fb6 Mon Sep 17 00:00:00 2001 From: Amrutha Srinivasan Date: Tue, 19 Oct 2021 10:46:46 -0700 Subject: [PATCH 1/2] Added null check --- .../ProjectBangaloreNugetTest/MainPage.xaml.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/MainPage.xaml.cs b/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/MainPage.xaml.cs index 3682dd2..652ba01 100644 --- a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/MainPage.xaml.cs +++ b/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/MainPage.xaml.cs @@ -48,12 +48,17 @@ private async void ButtonRun_Click(object sender, RoutedEventArgs e) //Call ClassifyImage to get image classes - List list = await SqueezeNetImageClassifier.ClassifyImage(selectedStorageFile, 3); - - //Display Image and result - ResultsBlock.Text = "1st guess: " + list[0].category + "\nwith confidence: " + list[0].confidence + " \n\n\n2nd guess: " + list[1].category + "\nwith confidence: " + list[1].confidence + " \n\n\n3rd guess: " + list[2].category + "\nwith confidence: " + list[2].confidence; - await DisplayImage(selectedStorageFile); - + if (selectedStorageFile != null) + { + List list = await SqueezeNetImageClassifier.ClassifyImage(selectedStorageFile, 3); + //Display Image and result + ResultsBlock.Text = "1st guess: " + list[0].category + "\nwith confidence: " + list[0].confidence + " \n\n\n2nd guess: " + list[1].category + "\nwith confidence: " + list[1].confidence + " \n\n\n3rd guess: " + list[2].category + "\nwith confidence: " + list[2].confidence; + await DisplayImage(selectedStorageFile); + } + else + { + ResultsBlock.Text = "Select a file"; + } } private async Task DisplayImage(StorageFile selectedStorageFile) From 3c810f0134799b76d1987acba41d073d9a217671 Mon Sep 17 00:00:00 2001 From: Amrutha Srinivasan Date: Tue, 19 Oct 2021 15:49:34 -0700 Subject: [PATCH 2/2] Folder restructuring --- .../.gitattributes | 0 .../.gitignore | 0 .../ImageClassificationTest.sln | 2 +- .../App.xaml | 0 .../App.xaml.cs | 0 .../Assets/LockScreenLogo.scale-200.png | Bin .../Assets/SplashScreen.scale-200.png | Bin .../Assets/Square150x150Logo.scale-200.png | Bin .../Assets/Square44x44Logo.scale-200.png | Bin ...uare44x44Logo.targetsize-24_altform-unplated.png | Bin .../Assets/StoreLogo.png | Bin .../Assets/Wide310x150Logo.scale-200.png | Bin .../ImageClassificationTestProject.csproj | 4 ++-- .../MainPage.xaml | 0 .../MainPage.xaml.cs | 0 .../Package.appxmanifest | 0 .../Properties/AssemblyInfo.cs | 0 .../Properties/Default.rd.xml | 0 18 files changed, 3 insertions(+), 3 deletions(-) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest => }/.gitattributes (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest => }/.gitignore (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest => }/ImageClassificationTest.sln (95%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/App.xaml (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/App.xaml.cs (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/Assets/LockScreenLogo.scale-200.png (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/Assets/SplashScreen.scale-200.png (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/Assets/Square150x150Logo.scale-200.png (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/Assets/Square44x44Logo.scale-200.png (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/Assets/Square44x44Logo.targetsize-24_altform-unplated.png (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/Assets/StoreLogo.png (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/Assets/Wide310x150Logo.scale-200.png (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/ImageClassificationTestProject.csproj (98%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/MainPage.xaml (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/MainPage.xaml.cs (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/Package.appxmanifest (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/Properties/AssemblyInfo.cs (100%) rename samples/WinML-IntelligentAPI/{IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest => ImageClassificationTestProject}/Properties/Default.rd.xml (100%) diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/.gitattributes b/samples/WinML-IntelligentAPI/.gitattributes similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/.gitattributes rename to samples/WinML-IntelligentAPI/.gitattributes diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/.gitignore b/samples/WinML-IntelligentAPI/.gitignore similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/.gitignore rename to samples/WinML-IntelligentAPI/.gitignore diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ImageClassificationTest.sln b/samples/WinML-IntelligentAPI/ImageClassificationTest.sln similarity index 95% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ImageClassificationTest.sln rename to samples/WinML-IntelligentAPI/ImageClassificationTest.sln index 708ffde..9d01aac 100644 --- a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ImageClassificationTest.sln +++ b/samples/WinML-IntelligentAPI/ImageClassificationTest.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.31205.134 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageClassificationTestProject", "ProjectBangaloreNugetTest\ImageClassificationTestProject.csproj", "{E99D1A06-2477-4A98-A227-3485C79F25F3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageClassificationTestProject", "ImageClassificationTestProject\ImageClassificationTestProject.csproj", "{E99D1A06-2477-4A98-A227-3485C79F25F3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/App.xaml b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/App.xaml similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/App.xaml rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/App.xaml diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/App.xaml.cs b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/App.xaml.cs similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/App.xaml.cs rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/App.xaml.cs diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/LockScreenLogo.scale-200.png b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/LockScreenLogo.scale-200.png similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/LockScreenLogo.scale-200.png rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/LockScreenLogo.scale-200.png diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/SplashScreen.scale-200.png b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/SplashScreen.scale-200.png similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/SplashScreen.scale-200.png rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/SplashScreen.scale-200.png diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/Square150x150Logo.scale-200.png b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/Square150x150Logo.scale-200.png similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/Square150x150Logo.scale-200.png rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/Square150x150Logo.scale-200.png diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/Square44x44Logo.scale-200.png b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/Square44x44Logo.scale-200.png similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/Square44x44Logo.scale-200.png rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/Square44x44Logo.scale-200.png diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/Square44x44Logo.targetsize-24_altform-unplated.png similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/Square44x44Logo.targetsize-24_altform-unplated.png rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/Square44x44Logo.targetsize-24_altform-unplated.png diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/StoreLogo.png b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/StoreLogo.png similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/StoreLogo.png rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/StoreLogo.png diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/Wide310x150Logo.scale-200.png b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/Wide310x150Logo.scale-200.png similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Assets/Wide310x150Logo.scale-200.png rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/Assets/Wide310x150Logo.scale-200.png diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/ImageClassificationTestProject.csproj b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/ImageClassificationTestProject.csproj similarity index 98% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/ImageClassificationTestProject.csproj rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/ImageClassificationTestProject.csproj index 766deaa..bf08aa5 100644 --- a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/ImageClassificationTestProject.csproj +++ b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/ImageClassificationTestProject.csproj @@ -7,8 +7,8 @@ {E99D1A06-2477-4A98-A227-3485C79F25F3} AppContainerExe Properties - ProjectBangaloreNugetTest - ProjectBangaloreNugetTest + ImageClassificationTest + ImageClassificationTest en-US UAP 10.0.19041.0 diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/MainPage.xaml b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/MainPage.xaml similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/MainPage.xaml rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/MainPage.xaml diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/MainPage.xaml.cs b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/MainPage.xaml.cs similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/MainPage.xaml.cs rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/MainPage.xaml.cs diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Package.appxmanifest b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/Package.appxmanifest similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Package.appxmanifest rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/Package.appxmanifest diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Properties/AssemblyInfo.cs b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/Properties/AssemblyInfo.cs similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Properties/AssemblyInfo.cs rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/Properties/AssemblyInfo.cs diff --git a/samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Properties/Default.rd.xml b/samples/WinML-IntelligentAPI/ImageClassificationTestProject/Properties/Default.rd.xml similarity index 100% rename from samples/WinML-IntelligentAPI/IntelligentAPIs_ImageClassificationTest/ProjectBangaloreNugetTest/Properties/Default.rd.xml rename to samples/WinML-IntelligentAPI/ImageClassificationTestProject/Properties/Default.rd.xml