| # Run final test on CTA using the TalkingHeadBench test subset. | |
| # Reuses an existing checkpoint (no training). | |
| # | |
| # Usage: | |
| # bash scripts/test_cta_thb.sh # uses outputs/cta/checkpoints/last.ckpt | |
| # bash scripts/test_cta_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/cta/checkpoints/last.ckpt}" | |
| shift || true | |
| if [ ! -f "$CKPT" ]; then | |
| echo "[test_cta_thb] checkpoint not found: $CKPT" | |
| exit 1 | |
| fi | |
| echo "[test_cta_thb] using checkpoint: $CKPT" | |
| echo "[test_cta_thb] fake test set: \${THB_ROOT:-/apdcephfs_gy4/share_303628665/joywu/dataset/TalkingHeadBench}/fake/*/test" | |
| echo "[test_cta_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=cta \ | |
| data=fairtalking_thb \ | |
| trainer=ddp \ | |
| backbone=timesformer \ | |
| +test_only=true \ | |
| +test_ckpt="$CKPT" \ | |
| "$@" | |