| # Run final test on CTA using the MMDF test subset. | |
| # Reuses an existing checkpoint (no training). | |
| # | |
| # Usage: | |
| # bash scripts/test_cta_mmdf.sh # uses outputs/cta/checkpoints/last.ckpt | |
| # bash scripts/test_cta_mmdf.sh /path/to/other.ckpt # explicit checkpoint | |
| # | |
| # NOTE: The MMDF test set now includes fake videos from configured generators | |
| # AND real videos from the MMDF real split (if available), | |
| # 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_mmdf] checkpoint not found: $CKPT" | |
| exit 1 | |
| fi | |
| echo "[test_cta_mmdf] using checkpoint: $CKPT" | |
| echo "[test_cta_mmdf] fake test set: \${MMDF_ROOT:-/apdcephfs_gy4/share_303628665/joywu/dataset/MMDF_test_only}/test/fake/*" | |
| echo "[test_cta_mmdf] real test set: \${MMDF_ROOT:-/apdcephfs_gy4/share_303628665/joywu/dataset/MMDF_test_only}/real (if available)" | |
| python3 src/train.py \ | |
| method=cta \ | |
| data=fairtalking_mmdf \ | |
| trainer=ddp \ | |
| backbone=timesformer \ | |
| +test_only=true \ | |
| +test_ckpt="$CKPT" \ | |
| "$@" |