更新 math Q1 Q2 实验与特征

This commit is contained in:
gloamxun committed 2026-09-25 08:58:10 +08:00
1 parent ca5be95757
commit 83ec3d1a83
168 files changed
+150303 -2874

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
param(
[Parameter(Mandatory = $true)]
[string]$VideoRelativePath,
[Parameter(Mandatory = $true)]
[string]$OutputName
)
$ErrorActionPreference = 'Stop'
$q1Directory = $PSScriptRoot
$repositoryDirectory = Split-Path (Split-Path $q1Directory -Parent) -Parent
$packageDirectory = Join-Path $q1Directory 'cache/openface/OpenFace_2.2.0_win_x64'
$executable = Join-Path $packageDirectory 'FeatureExtraction.exe'
$videoPath = Join-Path $repositoryDirectory ($VideoRelativePath -replace '/', '\')
$outputDirectory = Join-Path $q1Directory 'cache/openface_outputs'
$null = New-Item -ItemType Directory -Force -Path $outputDirectory
if (-not (Test-Path -LiteralPath $executable -PathType Leaf)) {
throw "OpenFace 2.2.0 executable not found: $executable"
}
if (-not (Test-Path -LiteralPath $videoPath -PathType Leaf)) {
throw "Input video not found: $videoPath"
}
Push-Location $packageDirectory
try {
& $executable -mloc model/main_clnf_general.txt -f $videoPath -out_dir $outputDirectory -of $OutputName -2Dfp -pose -aus -gaze
if ($LASTEXITCODE -ne 0) {
throw "OpenFace FeatureExtraction failed with exit code $LASTEXITCODE for $VideoRelativePath"
}
}
finally {
Pop-Location
}