#!/usr/bin/env bash # Run final test on PSM using the TalkingHeadBench test subset. # Reuses an existing checkpoint (no training). # # Usage: # bash scripts/test_psm_thb.sh # uses outputs/psm/checkpoints/last.ckpt # bash scripts/test_psm_thb.sh /path/to/other.ckpt # explicit checkpoint # # NOTE: The THB test set now includes fake videos from configured generators # AND real videos from the THB real split (e.g. FaceForensics++ Test), # so both test/acc and test/auc are informative. set -euo pipefail cd "$(dirname "$0")/.." # load .env if present [ -f .env ] && set -a && . ./.env && set +a CKPT="${1:-outputs/psm/checkpoints/last.ckpt}" shift || true if [ ! -f "$CKPT" ]; then echo "[test_psm_thb] checkpoint not found: $CKPT" exit 1 fi echo "[test_psm_thb] using checkpoint: $CKPT" echo "[test_psm_thb] fake test set: \${THB_ROOT:-/apdcephfs_gy4/share_303628665/joywu/dataset/TalkingHeadBench}/fake/*/test" echo "[test_psm_thb] real test set: \${THB_ROOT:-/apdcephfs_gy4/share_303628665/joywu/dataset/TalkingHeadBench}/real (subsets from data config, e.g. FaceForensics++)" python3 src/train.py \ method=psm \ data=fairtalking_thb \ trainer=ddp \ backbone=timesformer \ +test_only=true \ +test_ckpt="$CKPT" \ "$@"