From 51581e54ad963a3d0dd051820542c268fde3c854 Mon Sep 17 00:00:00 2001 From: Young Kim Date: Thu, 23 Aug 2018 16:14:32 -0700 Subject: [PATCH 1/3] update style transfer --- Samples/FNSCandyStyleTransfer/UWP/cs/SnapCandy.csproj | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Samples/FNSCandyStyleTransfer/UWP/cs/SnapCandy.csproj b/Samples/FNSCandyStyleTransfer/UWP/cs/SnapCandy.csproj index 36d70794..23abf0fa 100644 --- a/Samples/FNSCandyStyleTransfer/UWP/cs/SnapCandy.csproj +++ b/Samples/FNSCandyStyleTransfer/UWP/cs/SnapCandy.csproj @@ -11,8 +11,8 @@ SnapCandy en-US UAP - 10.0.17704.0 - 10.0.17704.0 + 10.0.17738.0 + 10.0.17738.0 14 512 {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -104,6 +104,10 @@ MainPage.xaml + + + + From 2a0ba75cb474362a4e91d46aac887cee19a13987 Mon Sep 17 00:00:00 2001 From: Young Kim Date: Thu, 23 Aug 2018 16:19:14 -0700 Subject: [PATCH 2/3] remove mlgen files --- .../UWP/cs/Assets/rain_princess.cs | 43 +++++++++++++++++++ .../UWP/cs/Assets/udnie.cs | 43 +++++++++++++++++++ .../UWP/cs/Assets/wave.cs | 43 +++++++++++++++++++ .../winmlperf_coreml_FNS-Candy_prerelease.cs | 43 +++++++++++++++++++ 4 files changed, 172 insertions(+) create mode 100644 Samples/FNSCandyStyleTransfer/UWP/cs/Assets/rain_princess.cs create mode 100644 Samples/FNSCandyStyleTransfer/UWP/cs/Assets/udnie.cs create mode 100644 Samples/FNSCandyStyleTransfer/UWP/cs/Assets/wave.cs create mode 100644 Samples/FNSCandyStyleTransfer/UWP/cs/Assets/winmlperf_coreml_FNS-Candy_prerelease.cs diff --git a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/rain_princess.cs b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/rain_princess.cs new file mode 100644 index 00000000..44e4d71c --- /dev/null +++ b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/rain_princess.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Windows.Media; +using Windows.Storage; +using Windows.Storage.Streams; +using Windows.AI.MachineLearning; +namespace SnapCandy +{ + + public sealed class rain_princessInput + { + public TensorFloat img_placeholder__0; // shape(-1,3,720,883) + } + + public sealed class rain_princessOutput + { + public TensorFloat add_37__0; // shape(-1,3,720,884) + } + + public sealed class rain_princessModel + { + private LearningModel model; + private LearningModelSession session; + private LearningModelBinding binding; + public static async Task CreateFromStreamAsync(IRandomAccessStreamReference stream) + { + rain_princessModel learningModel = new rain_princessModel(); + learningModel.model = await LearningModel.LoadFromStreamAsync(stream); + learningModel.session = new LearningModelSession(learningModel.model); + learningModel.binding = new LearningModelBinding(learningModel.session); + return learningModel; + } + public async Task EvaluateAsync(rain_princessInput input) + { + binding.Bind("img_placeholder__0", input.img_placeholder__0); + var result = await session.EvaluateAsync(binding, "0"); + var output = new rain_princessOutput(); + output.add_37__0 = result.Outputs["add_37__0"] as TensorFloat; + return output; + } + } +} diff --git a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/udnie.cs b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/udnie.cs new file mode 100644 index 00000000..4b20e759 --- /dev/null +++ b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/udnie.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Windows.Media; +using Windows.Storage; +using Windows.Storage.Streams; +using Windows.AI.MachineLearning; +namespace SnapCandy +{ + + public sealed class udnieInput + { + public TensorFloat img_placeholder__0; // shape(-1,3,720,883) + } + + public sealed class udnieOutput + { + public TensorFloat add_37__0; // shape(-1,3,720,884) + } + + public sealed class udnieModel + { + private LearningModel model; + private LearningModelSession session; + private LearningModelBinding binding; + public static async Task CreateFromStreamAsync(IRandomAccessStreamReference stream) + { + udnieModel learningModel = new udnieModel(); + learningModel.model = await LearningModel.LoadFromStreamAsync(stream); + learningModel.session = new LearningModelSession(learningModel.model); + learningModel.binding = new LearningModelBinding(learningModel.session); + return learningModel; + } + public async Task EvaluateAsync(udnieInput input) + { + binding.Bind("img_placeholder__0", input.img_placeholder__0); + var result = await session.EvaluateAsync(binding, "0"); + var output = new udnieOutput(); + output.add_37__0 = result.Outputs["add_37__0"] as TensorFloat; + return output; + } + } +} diff --git a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/wave.cs b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/wave.cs new file mode 100644 index 00000000..6d147f6e --- /dev/null +++ b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/wave.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Windows.Media; +using Windows.Storage; +using Windows.Storage.Streams; +using Windows.AI.MachineLearning; +namespace SnapCandy +{ + + public sealed class waveInput + { + public TensorFloat img_placeholder__0; // shape(-1,3,720,883) + } + + public sealed class waveOutput + { + public TensorFloat add_37__0; // shape(-1,3,720,884) + } + + public sealed class waveModel + { + private LearningModel model; + private LearningModelSession session; + private LearningModelBinding binding; + public static async Task CreateFromStreamAsync(IRandomAccessStreamReference stream) + { + waveModel learningModel = new waveModel(); + learningModel.model = await LearningModel.LoadFromStreamAsync(stream); + learningModel.session = new LearningModelSession(learningModel.model); + learningModel.binding = new LearningModelBinding(learningModel.session); + return learningModel; + } + public async Task EvaluateAsync(waveInput input) + { + binding.Bind("img_placeholder__0", input.img_placeholder__0); + var result = await session.EvaluateAsync(binding, "0"); + var output = new waveOutput(); + output.add_37__0 = result.Outputs["add_37__0"] as TensorFloat; + return output; + } + } +} diff --git a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/winmlperf_coreml_FNS-Candy_prerelease.cs b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/winmlperf_coreml_FNS-Candy_prerelease.cs new file mode 100644 index 00000000..7be1ab34 --- /dev/null +++ b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/winmlperf_coreml_FNS-Candy_prerelease.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Windows.Media; +using Windows.Storage; +using Windows.Storage.Streams; +using Windows.AI.MachineLearning; +namespace SnapCandy +{ + + public sealed class Input + { + public TensorFloat inputImage; // shape(-1,3,720,720) + } + + public sealed class Output + { + public TensorFloat outputImage; // shape(-1,3,720,720) + } + + public sealed class Model + { + private LearningModel model; + private LearningModelSession session; + private LearningModelBinding binding; + public static async Task CreateFromStreamAsync(IRandomAccessStreamReference stream) + { + Model learningModel = new Model(); + learningModel.model = await LearningModel.LoadFromStreamAsync(stream); + learningModel.session = new LearningModelSession(learningModel.model); + learningModel.binding = new LearningModelBinding(learningModel.session); + return learningModel; + } + public async Task EvaluateAsync(Input input) + { + binding.Bind("inputImage", input.inputImage); + var result = await session.EvaluateAsync(binding, "0"); + var output = new Output(); + output.outputImage = result.Outputs["outputImage"] as TensorFloat; + return output; + } + } +} From 40cb47d44262af33962118218c7b51e1c907190c Mon Sep 17 00:00:00 2001 From: Young Kim Date: Thu, 23 Aug 2018 16:30:18 -0700 Subject: [PATCH 3/3] cleanup --- .../UWP/cs/Assets/rain_princess.cs | 43 ------------------- .../UWP/cs/Assets/udnie.cs | 43 ------------------- .../UWP/cs/Assets/wave.cs | 43 ------------------- .../winmlperf_coreml_FNS-Candy_prerelease.cs | 43 ------------------- .../UWP/cs/SnapCandy.csproj | 4 -- 5 files changed, 176 deletions(-) delete mode 100644 Samples/FNSCandyStyleTransfer/UWP/cs/Assets/rain_princess.cs delete mode 100644 Samples/FNSCandyStyleTransfer/UWP/cs/Assets/udnie.cs delete mode 100644 Samples/FNSCandyStyleTransfer/UWP/cs/Assets/wave.cs delete mode 100644 Samples/FNSCandyStyleTransfer/UWP/cs/Assets/winmlperf_coreml_FNS-Candy_prerelease.cs diff --git a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/rain_princess.cs b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/rain_princess.cs deleted file mode 100644 index 44e4d71c..00000000 --- a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/rain_princess.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Windows.Media; -using Windows.Storage; -using Windows.Storage.Streams; -using Windows.AI.MachineLearning; -namespace SnapCandy -{ - - public sealed class rain_princessInput - { - public TensorFloat img_placeholder__0; // shape(-1,3,720,883) - } - - public sealed class rain_princessOutput - { - public TensorFloat add_37__0; // shape(-1,3,720,884) - } - - public sealed class rain_princessModel - { - private LearningModel model; - private LearningModelSession session; - private LearningModelBinding binding; - public static async Task CreateFromStreamAsync(IRandomAccessStreamReference stream) - { - rain_princessModel learningModel = new rain_princessModel(); - learningModel.model = await LearningModel.LoadFromStreamAsync(stream); - learningModel.session = new LearningModelSession(learningModel.model); - learningModel.binding = new LearningModelBinding(learningModel.session); - return learningModel; - } - public async Task EvaluateAsync(rain_princessInput input) - { - binding.Bind("img_placeholder__0", input.img_placeholder__0); - var result = await session.EvaluateAsync(binding, "0"); - var output = new rain_princessOutput(); - output.add_37__0 = result.Outputs["add_37__0"] as TensorFloat; - return output; - } - } -} diff --git a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/udnie.cs b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/udnie.cs deleted file mode 100644 index 4b20e759..00000000 --- a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/udnie.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Windows.Media; -using Windows.Storage; -using Windows.Storage.Streams; -using Windows.AI.MachineLearning; -namespace SnapCandy -{ - - public sealed class udnieInput - { - public TensorFloat img_placeholder__0; // shape(-1,3,720,883) - } - - public sealed class udnieOutput - { - public TensorFloat add_37__0; // shape(-1,3,720,884) - } - - public sealed class udnieModel - { - private LearningModel model; - private LearningModelSession session; - private LearningModelBinding binding; - public static async Task CreateFromStreamAsync(IRandomAccessStreamReference stream) - { - udnieModel learningModel = new udnieModel(); - learningModel.model = await LearningModel.LoadFromStreamAsync(stream); - learningModel.session = new LearningModelSession(learningModel.model); - learningModel.binding = new LearningModelBinding(learningModel.session); - return learningModel; - } - public async Task EvaluateAsync(udnieInput input) - { - binding.Bind("img_placeholder__0", input.img_placeholder__0); - var result = await session.EvaluateAsync(binding, "0"); - var output = new udnieOutput(); - output.add_37__0 = result.Outputs["add_37__0"] as TensorFloat; - return output; - } - } -} diff --git a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/wave.cs b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/wave.cs deleted file mode 100644 index 6d147f6e..00000000 --- a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/wave.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Windows.Media; -using Windows.Storage; -using Windows.Storage.Streams; -using Windows.AI.MachineLearning; -namespace SnapCandy -{ - - public sealed class waveInput - { - public TensorFloat img_placeholder__0; // shape(-1,3,720,883) - } - - public sealed class waveOutput - { - public TensorFloat add_37__0; // shape(-1,3,720,884) - } - - public sealed class waveModel - { - private LearningModel model; - private LearningModelSession session; - private LearningModelBinding binding; - public static async Task CreateFromStreamAsync(IRandomAccessStreamReference stream) - { - waveModel learningModel = new waveModel(); - learningModel.model = await LearningModel.LoadFromStreamAsync(stream); - learningModel.session = new LearningModelSession(learningModel.model); - learningModel.binding = new LearningModelBinding(learningModel.session); - return learningModel; - } - public async Task EvaluateAsync(waveInput input) - { - binding.Bind("img_placeholder__0", input.img_placeholder__0); - var result = await session.EvaluateAsync(binding, "0"); - var output = new waveOutput(); - output.add_37__0 = result.Outputs["add_37__0"] as TensorFloat; - return output; - } - } -} diff --git a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/winmlperf_coreml_FNS-Candy_prerelease.cs b/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/winmlperf_coreml_FNS-Candy_prerelease.cs deleted file mode 100644 index 7be1ab34..00000000 --- a/Samples/FNSCandyStyleTransfer/UWP/cs/Assets/winmlperf_coreml_FNS-Candy_prerelease.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Windows.Media; -using Windows.Storage; -using Windows.Storage.Streams; -using Windows.AI.MachineLearning; -namespace SnapCandy -{ - - public sealed class Input - { - public TensorFloat inputImage; // shape(-1,3,720,720) - } - - public sealed class Output - { - public TensorFloat outputImage; // shape(-1,3,720,720) - } - - public sealed class Model - { - private LearningModel model; - private LearningModelSession session; - private LearningModelBinding binding; - public static async Task CreateFromStreamAsync(IRandomAccessStreamReference stream) - { - Model learningModel = new Model(); - learningModel.model = await LearningModel.LoadFromStreamAsync(stream); - learningModel.session = new LearningModelSession(learningModel.model); - learningModel.binding = new LearningModelBinding(learningModel.session); - return learningModel; - } - public async Task EvaluateAsync(Input input) - { - binding.Bind("inputImage", input.inputImage); - var result = await session.EvaluateAsync(binding, "0"); - var output = new Output(); - output.outputImage = result.Outputs["outputImage"] as TensorFloat; - return output; - } - } -} diff --git a/Samples/FNSCandyStyleTransfer/UWP/cs/SnapCandy.csproj b/Samples/FNSCandyStyleTransfer/UWP/cs/SnapCandy.csproj index 23abf0fa..90d1e39c 100644 --- a/Samples/FNSCandyStyleTransfer/UWP/cs/SnapCandy.csproj +++ b/Samples/FNSCandyStyleTransfer/UWP/cs/SnapCandy.csproj @@ -104,10 +104,6 @@ MainPage.xaml - - - -