Files
NODEDC_MISSION_CORE/simulation/ai-polygon/segformer/Prepare-Cityscapes.ps1
T
DCCONSTRUCTIONS d0e5f90952 Preserve installed operator workspace before consolidation
Local preservation snapshot, not a new deployment or simulation acceptance.
2026-10-08 09:59:51 +03:00

27 lines
1.7 KiB
PowerShell

param([string]$Root = 'D:\NDC_MISSIONCORE\runtime\simulation')
$ErrorActionPreference='Stop'
$ProgressPreference='SilentlyContinue'
[Console]::OutputEncoding=[System.Text.Encoding]::UTF8
$revision='d633b2072669ca68d8f8e309de9b52bfdbf6bf72'
$out=Join-Path $Root ('assets\segformer-b2-cityscapes\'+$revision)
New-Item -ItemType Directory -Force $out | Out-Null
$files=@{
'config.json'='3bafe3a84c87270732bb383f6ef33801d1cd441907da8cedc2c8a4986276945d'
'preprocessor_config.json'='d96ab2cb112985c19d5ea32f1d1f2369104fc78b1379f5ce26e33ca8646202a7'
'README.md'='dee0efc3c26c7f670a15fb47ea01e92c884f985304944db8b881f057bb31a81e'
'pytorch_model.bin'='584d72ace8c17c5683c198e1a4c3eda2e1026bafc02711ac5e5a4dc097bd05fe'
}
foreach($name in $files.Keys) {
$path=Join-Path $out $name
if (!(Test-Path $path)) {
$part=$path+'.part'
Invoke-WebRequest -UseBasicParsing -Uri "https://huggingface.co/nvidia/segformer-b2-finetuned-cityscapes-1024-1024/resolve/$revision/$name" -OutFile $part
if ((Get-FileHash $part -Algorithm SHA256).Hash.ToLower() -ne $files[$name]) { throw "Downloaded model checksum mismatch: $name" }
Move-Item $part $path
}
if ((Get-FileHash $path -Algorithm SHA256).Hash.ToLower() -ne $files[$name]) { throw "Installed model checksum mismatch: $name" }
}
$receipt=@{schema_version='missioncore.ai-polygon-cityscapes-install/v1';revision=$revision;files=$files;assets=$out;installed_at=[DateTime]::UtcNow.ToString('o');scope='simulation evaluation';rollback='Remove this optional provider from composition; existing models preserved'}
[IO.File]::WriteAllText((Join-Path $out 'installation.json'),($receipt|ConvertTo-Json -Depth 4),[Text.UTF8Encoding]::new($false))
$receipt|ConvertTo-Json -Depth 4 -Compress