You need to agree to share your Hugging Face information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

This dataset is derived from footage in HDTF, VFHQ, and FEED and is released for non-commercial academic research only, under the terms of the DirectSwap Data Research License (see LICENSE below). By checking the box and submitting this form you agree to be bound by that license: no redistribution, no commercial use, no identity misuse, and deletion of any affected clip upon takedown request.

Log in or Sign Up to review the conditions and access this dataset content.

HeadSwapBench (DirectSwap Data)

Training and evaluation data for DirectSwap, from the paper "DirectSwap: Paired, Mask-Free Video Head Swapping with Full-Reference Evaluation" (arXiv:2512.09417). Each sample is a synchronized triplet $(V_c, I_{ref}, V_a)$: a cross-identity driving video, a target-identity reference image, and the frame-aligned real target video, produced by an identity–expression decoupled synthesis pipeline from real footage (see the paper's data synthesis section).

The identity-disjoint test split (1,040 clips, 104 held-out subjects) is the paper's full-reference benchmark, HeadSwapBench.

Access is gated and manually reviewed — see the "Request access" panel above. Approval is based on institutional affiliation and stated research use; approval constitutes acceptance of the DirectSwap Data Research License (LICENSE).

Contents

Split Clips Subjects Size Layout
train/ 20,278 — ~49 GB 10 shards, shard-XXXX.tar, ~5 GB each (last one 3.2 GB)
val/ 40 16 ~120 MB one tar per modality
test/ (HeadSwapBench) 1,040 104 ~2.4 GB one tar per modality

Splits are identity-disjoint: identity groups are assigned to exactly one split (see the paper's benchmark construction section).

Each clip has three modality files, named to match the DirectSwap code's expected data layout:

  • ref.jpg — $I_{ref}$, target-identity reference image (512×512)
  • inpaint.mp4 — $V_c$, cross-identity driving video (512×512, 16 fps, ≤121 frames)
  • gt_frames.mp4 — $V_a$, frame-aligned ground-truth video (512×512, 16 fps, ≤121 frames)

train/ is packed by clip (webdataset-style): each shard is self-contained, so downloading a subset of shards is immediately usable for training. Shards hold between 1,224 and 3,343 clips each; metadata/train.csv gives the exact shard for every clip.

train/shard-0000.tar
  ├── Clip+.../ref.jpg
  ├── Clip+.../inpaint.mp4
  └── Clip+.../gt_frames.mp4
  ...

val/ and test/ are packed by modality, since most evaluation code only needs gt_frames:

val/ref.tar    val/inpaint.tar    val/gt_frames.tar
test/ref.tar   test/inpaint.tar   test/gt_frames.tar
test/gt_masks.tar   test/inpaint_head_mask.tar

metadata/{train,val,test}.csv lists every clip with its source YouTube id (where recoverable), person/clip index, frame range, byte size, and (for train) which shard it lives in.

The test split also ships two head-mask archives for the region-level evaluation (head vs. background split, eval_region.py in the code repository):

  • test/gt_masks.tar — head mask of $V_a$ (gt_masks/<clip>.mp4)
  • test/inpaint_head_mask.tar — head mask of $V_c$ (inpaint_head_mask/<clip>.mp4)

Training and inference read only the three main files above; the train and val splits have no masks.

Download

pip install -U huggingface_hub
hf auth login   # needs an approved account

# everything
hf download yananwang-MBZUAI/HeadSwapBench --repo-type dataset --local-dir ./HeadSwapBench

# just HeadSwapBench (the test split)
hf download yananwang-MBZUAI/HeadSwapBench --repo-type dataset \
  --include "test/*" "metadata/test.csv" --local-dir ./HeadSwapBench

# just val
hf download yananwang-MBZUAI/HeadSwapBench --repo-type dataset \
  --include "val/*" "metadata/val.csv" --local-dir ./HeadSwapBench

# a subset of train, e.g. the first 2 shards
hf download yananwang-MBZUAI/HeadSwapBench --repo-type dataset \
  --include "train/shard-000[01].tar" "metadata/train.csv" --local-dir ./HeadSwapBench

Unpacking into the code's data layout

The DirectSwap code expects one dataset root with train/{inpaint,ref,gt_frames}/ and test/{inpaint,ref,gt_frames}/, where the three files of a clip share a filename stem (see the code repository's data/README.md). Run the following from the download directory, so the data/ root sits next to train/, val/, test/, and metadata/.

# val and test: per-modality tars are flat
for split in val test; do
  for mod in ref inpaint gt_frames; do
    mkdir -p data/$split/$mod
    tar -xf $split/$mod.tar -C data/$split/$mod
  done
done

# test masks (region-level evaluation only)
for mod in gt_masks inpaint_head_mask; do
  mkdir -p data/test/$mod
  tar -xf test/$mod.tar -C data/test/$mod
done

# test.txt: clip list the code reads (one clip per line)
tail -n +2 metadata/test.csv | cut -d, -f1 > data/test/test.txt

Train shards are packed per clip, so they need regrouping by modality:

python3 - <<'PY'
import pathlib, shutil, tarfile

ROOT = pathlib.Path("data/train")
DIR = {"ref.jpg": "ref", "inpaint.mp4": "inpaint", "gt_frames.mp4": "gt_frames"}
for mod in DIR.values():
    (ROOT / mod).mkdir(parents=True, exist_ok=True)

for shard in sorted(pathlib.Path("train").glob("shard-*.tar")):
    with tarfile.open(shard) as tf:
        for m in tf:
            if not m.isfile():
                continue
            clip, name = m.name.split("/")
            dst = ROOT / DIR[name] / f"{clip}{pathlib.Path(name).suffix}"
            with tf.extractfile(m) as src, open(dst, "wb") as out:
                shutil.copyfileobj(src, out)
PY

Then point the code's --data (or DIRECTSWAP_DATA) at the data/ directory.

Naming convention

Clip ids follow Clip+<youtube_id>+P<person_idx>+C<clip_idx>+F<start_frame>-<end_frame>_... for HDTF/VFHQ-sourced clips; a subset from FEED and broadcast-interview sources keep their original corpus names (e.g. WDA_JohnSarbanes0_000_clip_2). metadata/*.csv parses this into columns where the pattern matches.

Data provenance and license

This dataset is synthesized from footage in three existing academic corpora — see NOTICE for full citations and their individual terms:

  • HDTF (Zhang et al., CVPR 2021) — distributed by its authors as a CC BY 4.0 URL list (i.e. pointers to YouTube videos, not the videos themselves).
  • VFHQ (Xie et al., CVPRW 2022) — distributed for non-commercial research.
  • FEED / EMOPortraits (Drobyshev et al., 2024) — distributed for non-commercial research.

Because the synthesized pairs retain content derived from this footage, the processed training and test sets are released under the DirectSwap Data Research License (LICENSE): non-commercial research use, no redistribution, no identity misuse, and a takedown policy. This is not an unrestricted public release.

If you appear in this dataset and want a clip removed, or you are a rights holder with a takedown request, contact the corresponding author (see LICENSE) — it will be removed within 30 days from this release and from all future releases.

Citation

@article{wang2025directswap,
  title   = {DirectSwap: Paired, Mask-Free Video Head Swapping with Full-Reference Evaluation},
  author  = {Wang, Yanan and Liao, Shengcai and Hu, Panwen and Li, Xin and
             Yang, Fan and Liu, Guangyi and Liang, Xiaodan},
  journal = {arXiv preprint arXiv:2512.09417},
  year    = {2025}
}
Downloads last month
25

Paper for yananwang-MBZUAI/HeadSwapBench