8 lines
534 B
PowerShell

$ErrorActionPreference = 'Stop'
$root = Split-Path $PSScriptRoot -Parent
$env:PATH = (Join-Path $root 'lib') + ';' + $env:PATH
$config = Get-ChildItem (Join-Path $root 'models') -Filter '*.yaml' -File -Recurse | Select-Object -First 1 -ExpandProperty FullName
if ([string]::IsNullOrWhiteSpace($config)) { throw 'Packaged model YAML was not found.' }
& (Join-Path $root 'examples\bin\yolo_c_example.exe') --config $config --image (Join-Path $root 'examples\assets\sample.bmp') --json (Join-Path $root 'result.json')
exit $LASTEXITCODE