2021-02-20 16:28:07 +08:00
|
|
|
#!/usr/bin/env pwsh
|
2019-04-12 16:31:39 +08:00
|
|
|
|
2021-02-20 16:28:07 +08:00
|
|
|
$install_cuda = $false
|
2021-02-19 05:22:39 +08:00
|
|
|
|
2021-02-20 16:28:07 +08:00
|
|
|
if ($null -eq (Get-Command "choco.exe" -ErrorAction SilentlyContinue)) {
|
|
|
|
# Download and install Chocolatey
|
|
|
|
Set-ExecutionPolicy unrestricted -Scope CurrentUser
|
2021-02-19 05:22:39 +08:00
|
|
|
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
2021-04-22 00:25:46 +08:00
|
|
|
Throw "Please close and re-open powershell and then re-run setup.ps1 script"
|
2021-02-19 05:22:39 +08:00
|
|
|
}
|
2021-02-20 16:28:07 +08:00
|
|
|
|
|
|
|
Start-Process -FilePath "choco" -Verb runAs -ArgumentList " install -y cmake ninja powershell git vscode"
|
|
|
|
Start-Process -FilePath "choco" -Verb runAs -ArgumentList " install -y visualstudio2019buildtools --package-parameters `"--add Microsoft.VisualStudio.Component.VC.CoreBuildTools --includeRecommended --includeOptional --passive --locale en-US --lang en-US`""
|
2021-04-22 00:25:46 +08:00
|
|
|
Push-Location $PSScriptRoot
|
2019-04-12 16:31:39 +08:00
|
|
|
|
|
|
|
if ($install_cuda) {
|
2021-04-22 00:25:46 +08:00
|
|
|
& ./deploy-cuda.ps1
|
2019-08-22 14:36:01 +08:00
|
|
|
$features = "full"
|
2019-04-12 16:31:39 +08:00
|
|
|
}
|
|
|
|
else {
|
2021-02-19 05:22:39 +08:00
|
|
|
if (-not $null -eq $env:CUDA_PATH) {
|
|
|
|
$features = "full"
|
|
|
|
}
|
|
|
|
else{
|
2021-04-14 21:19:06 +08:00
|
|
|
$features = "opencv-base"
|
2021-02-19 05:22:39 +08:00
|
|
|
}
|
2019-04-12 16:31:39 +08:00
|
|
|
}
|
|
|
|
|
2021-04-22 00:25:46 +08:00
|
|
|
git.exe clone https://github.com/microsoft/vcpkg ../vcpkg
|
|
|
|
Set-Location ..\vcpkg
|
2020-08-08 22:25:53 +08:00
|
|
|
.\bootstrap-vcpkg.bat -disableMetrics
|
2019-08-22 14:36:01 +08:00
|
|
|
.\vcpkg.exe install darknet[${features}]:x64-windows
|
2021-04-22 00:25:46 +08:00
|
|
|
Pop-Location
|
|
|
|
|
|
|
|
Write-Host "Darknet installed in $pwd\x64-windows\tools\darknet" -ForegroundColor Yellow
|