Skip to content

Commit c9a39a8

Browse files
author
Sheil Kumar
committed
PR comments
1 parent a39733f commit c9a39a8

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

Samples/WinMLSamplesGallery/WinMLSamplesGallery/SampleMetadata/SampleMetadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
},
3838
{
3939
"Title": "OpenCV Interop",
40-
"DescriptionShort": "The sample will use Windows ML to classify images that have been denoised using OpenCV.",
41-
"Description": "This sample demonstrates interop between Windows ML and OpenCV. The sample will classify images that have been denoised using OpenCV's medianBlur using the SqueezeNet model on Windows ML. Choose an image to get started.",
40+
"DescriptionShort": "The sample uses Windows ML to classify images that have been denoised using OpenCV.",
41+
"Description": "This sample demonstrates interop between Windows ML and OpenCV. The sample classifes images that have been denoised using OpenCV's medianBlur using the SqueezeNet model on Windows ML. Choose an image to get started.",
4242
"Icon": "\uE155",
4343
"Tag": "OpenCVInterop",
4444
"XAMLGithubLink": "https://github.com/microsoft/Windows-Machine-Learning/blob/master/Samples/WinMLSamplesGallery/WinMLSamplesGallery/Samples/OpenCVInterop/OpenCVInterop.xaml",

Samples/WinMLSamplesGallery/WinMLSamplesGallery/Samples/OpenCVInterop/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ See [ThirdPartyNotices.txt](../../../../../ThirdPartyNotices.txt) for relevant l
2323
## Getting Started
2424
In order to build this sample, OpenCV will need to be built and linked into the WinML Samples Gallery. The OpenCV project is included as a submodule, and will need to be synced and built for your Platform Architecture and Configuration before it will appear in the Windows ML Samples Gallery. To do so follow these instructions:
2525
- Launch a Visual Studio Developer Command Prompt.
26-
- Navigate to root.
26+
- Navigate to the `repository root` directory.
2727
- Sync submodules with `git submodule update --init --recursive`
2828
- Launch Powershell with `powershell`
2929
- Build the OpenCV project with
3030

31-
`.\external\tools\BuildOpenCV.ps1 -Architecture <ARCH> -Configuration <CONFIGURATION>`
31+
`.\external\tools\BuildOpenCV.ps1 -Architecture <ARCH> -Configuration <CONFIGURATION> -SetupDevEnv`
3232

3333
For example:
3434

external/tools/BuildOpenCV.ps1

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Param
1414
[string]$CMakeBuildDirectory = "$PSScriptRoot\..\..\build\external\opencv\cmake_config\$Architecture\",
1515

1616
# Cleans build files before proceeding.
17-
[switch]$Clean
17+
[switch]$Clean,
18+
19+
[switch]$SetupDevEnv = $False
1820
)
1921

2022
if ($Clean) {
@@ -23,10 +25,23 @@ if ($Clean) {
2325

2426
& $PSScriptRoot\CMakeConfigureOpenCV.ps1 -Architecture $Architecture
2527

28+
$msbuild = "msbuild"
29+
30+
if ($SetupDevEnv)
31+
{
32+
Install-Module VSSetup -Scope CurrentUser -Force
33+
$latestVS = Get-VSSetupInstance -All -Prerelease | Sort-Object -Property InstallationVersion -Descending | Select-Object -First 1
34+
if ($latestVS.InstallationVersion -like "15.*") {
35+
$msbuild = "$($latestVS.InstallationPath)\MSBuild\15.0\Bin\msbuild.exe"
36+
} else {
37+
$msbuild = "$($latestVS.InstallationPath)\MSBuild\Current\Bin\msbuild.exe"
38+
}
39+
}
40+
2641
# Build OpenCV
2742
$solution = $CMakeBuildDirectory + "OpenCV.sln"
28-
msbuild /p:Configuration=$Configuration /t:Build /p:LinkIncremental=false /p:DebugSymbols=false /p:DebugType=None $solution
43+
& $msbuild /p:Configuration=$Configuration /t:Build /p:LinkIncremental=false /p:DebugSymbols=false /p:DebugType=None $solution
2944

3045
# Install
3146
$installProject = $CMakeBuildDirectory + "INSTALL.vcxproj"
32-
msbuild /p:Configuration=$Configuration /p:LinkIncremental=false /p:DebugSymbols=false /p:DebugType=None $installProject
47+
& $msbuild /p:Configuration=$Configuration /p:LinkIncremental=false /p:DebugSymbols=false /p:DebugType=None $installProject

0 commit comments

Comments
 (0)