Gaze-LIPE / scripts /run_remaining_clean_kd.ps1
thanhhuyvan's picture
Publish KD reproducibility investigation
178f61f
Raw
History Blame Contribute Delete
3.11 kB
param(
[string]$Python = "C:\Users\A\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe",
[int]$TeacherBatchSize = 8
)
$ErrorActionPreference = "Stop"
$Root = "E:\Gaze_estimation"
$Participants = @("p00", "p02", "p03", "p04", "p05", "p06", "p07", "p09", "p10", "p12", "p13", "p14")
Set-Location -LiteralPath $Root
foreach ($Participant in $Participants) {
$Validation = Join-Path $Root "data\processed_kd_clean_v1\manifests\$Participant.source.validation.json"
if (-not (Test-Path -LiteralPath $Validation)) {
& $Python scripts\build_kd_clean_manifest.py --participant $Participant
if ($LASTEXITCODE -ne 0) { throw "manifest build failed for $Participant" }
& $Python scripts\validate_kd_clean_manifest.py --participant $Participant
if ($LASTEXITCODE -ne 0) { throw "manifest validation failed for $Participant" }
}
$PointValidation = Join-Path $Root "data\processed_kd_clean_v1\cache\$Participant.official448_pointkd.validation.json"
if (Test-Path -LiteralPath $PointValidation) {
$Report = Get-Content -LiteralPath $PointValidation -Raw | ConvertFrom-Json
if (-not $Report.pass) { throw "existing point-KD validation fails for $Participant" }
continue
}
$FullCache = Join-Path $Root "data\processed_kd_clean_v1\cache\$Participant.official448_full.h5"
$FullSummary = Join-Path $Root "data\processed_kd_clean_v1\cache\$Participant.official448_full.summary.json"
$FullValidation = Join-Path $Root "data\processed_kd_clean_v1\cache\$Participant.official448_full.validation.json"
if (-not (Test-Path -LiteralPath $FullValidation)) {
if (-not (Test-Path -LiteralPath $FullCache)) {
& $Python scripts\generate_kd_clean_cache_batched.py --participant $Participant --tag official448_full --device cpu --teacher-batch-size $TeacherBatchSize
if ($LASTEXITCODE -ne 0) { throw "full cache generation failed for $Participant" }
} elseif (-not (Test-Path -LiteralPath $FullSummary)) {
throw "incomplete immutable full cache exists for $Participant; inspect manually"
}
& $Python scripts\validate_kd_clean_cache.py --participant $Participant --tag official448_full
if ($LASTEXITCODE -ne 0) { throw "full cache validation failed for $Participant" }
}
$PointCache = Join-Path $Root "data\processed_kd_clean_v1\cache\$Participant.official448_pointkd.h5"
$PointSummary = Join-Path $Root "data\processed_kd_clean_v1\cache\$Participant.official448_pointkd.summary.json"
if (-not (Test-Path -LiteralPath $PointCache)) {
& $Python scripts\assemble_pointkd_cache.py --participant $Participant
if ($LASTEXITCODE -ne 0) { throw "point-KD assembly failed for $Participant" }
} elseif (-not (Test-Path -LiteralPath $PointSummary)) {
throw "incomplete immutable point-KD cache exists for $Participant; inspect manually"
}
& $Python scripts\validate_pointkd_cache.py --participant $Participant
if ($LASTEXITCODE -ne 0) { throw "point-KD validation failed for $Participant" }
}