Sparkle is a large-scale video background replacement dataset comprising ~140K high-quality source–edited video pairs. It is fully open-sourced at 🤗stdKonjac/Sparkle. For full methodology and dataset details, please refer to our paper.
The dataset is organized into five themes along different background-change axes:
Theme
Description
location
Background replaced with a different physical environment (rural, nature, landmark, ...).
season
Background changed across seasons (spring, summer, autumn, winter).
time
Background changed across times of day (dawn, dusk, night, ...).
style
Background restyled (era, mood, cinematic, ...).
openve3m
A re-creation of the OpenVE-3M background-replacement subset using our pipeline, retained for direct comparison with prior work.
We follow the training data format of Kiwi-Edit for direct compatibility with downstream training pipelines.
Each theme's annotations live in prompts/{edit_type}_train.csv, a four-column table:
Column
Description
prompt
The natural-language editing instruction.
src_video
Path to the source video, e.g. location/source_video/Sparkle_location_000000.mp4.
tgt_video
Path to the edited video, e.g. location/edited_video/Sparkle_location_000000.mp4.
task
The unique sample id, e.g. Sparkle_location_000000. Joins to the id field in the JSONL metadata.
Per-task auxiliary metadata is stored alongside in prompts/{edit_type}_train_metadata.jsonl. Each line is one sample:
json
1{2"id":"Sparkle_location_000000",3"prompt":"Shift the background to a rooftop overlooking a modern city skyline at dusk, ...",4"metadata":{5"edit_type":"location",6"chosen_keyword":"urban: rooftop overlooking skyline",7"original_scene":"A cobblestone street in a historical European city, ..."8}9}
Field
Description
id
Sample id, matches the task column in the CSV.
prompt
Same as the prompt column in the CSV.
metadata.edit_type
One of the five themes: location / season / time / style / openve3m (denoted as openve3m_background_change).
metadata.chosen_keyword
The subtheme: scene label (e.g. "urban: rooftop overlooking skyline"). Not available for the openve3m theme.
metadata.original_scene
A description of the source video's first frame.
👀 Online Preview
The first 100 samples of every theme are stored as uncompressed .mp4 files under {edit_type}/source_video/ and {edit_type}/edited_video/, and can be played directly in the browser without downloading the full corpus.
For example, for the task Sparkle_location_000000 (the first row in the location theme of the dataset viewer), you can directly browse its Source Video and Edited Video.
The dataset viewer at the top of the HF page lets you scroll through all five themes and read the corresponding prompts inline.
⬇️ Downloading the Full Corpus
The full ~140K-sample corpus is sharded into ~5GB .tar archives at the repository root, named {edit_type}_{source_video|edited_video}_partXX.tar.
Step 1 — Download the tar shards. Download everything (recommended for full reproduction):
Step 2 — Extract the tars. Each tar is self-contained: its internal paths are {edit_type}/{source_video|edited_video}/{task}.mp4, so extracting any subset of shards in place will populate the corresponding folders correctly. There is no need to concatenate the parts before extraction.
bash
1cd ./Sparkle
2forfin *.tar;dotar -xf "$f";done
After extraction, the directory layout matches the online preview structure, and the relative paths in prompts/{edit_type}_train.csv (e.g. location/source_video/Sparkle_location_000000.mp4) will resolve directly.
🧪 Pipeline Intermediates
To support full reproducibility, transparency, and downstream research, we additionally release every intermediate artifact produced by the 5-stage Sparkle data pipeline (see Figure 2: Data Pipeline in our paper) under intermediate_data/. The first 100 samples of every theme are uncompressed and previewable directly in the browser, mirroring the layout of the {edit_type}/ preview folders described above.
Taking Sparkle_location_000000 as a running example, the artifact layout looks like:
Loading the foreground mask. The masks in source_video_mask/ are bit-packed for storage efficiency. Each .npz file contains two arrays: mask (a np.uint8 array of bits) and shape (the original (T, H, W) mask shape, where T ≤ 81). Unpack with:
python
1import numpy as np
23defload_mask(mask_path:str)-> np.ndarray:4 data = np.load(mask_path)5 packed_mask = data["mask"]6 shape =tuple(int(s)for s in data["shape"])7 total = shape[0]* shape[1]* shape[2]8 video_mask = np.unpackbits(packed_mask)[:total].reshape(shape).astype(bool)9return video_mask # boolean array of shape (T, H, W)
Downloading the full intermediates. Like the main corpus, the full intermediates for every theme are sharded into ~5GB .tar archives, stored under intermediate_data/ and named {edit_type}_{subdir}_partXX.tar where {subdir} is one of the six folder names above. Download and extract them as follows:
bash
1# Download all intermediates for a single theme (e.g. location)2hf download stdKonjac/Sparkle \3 --repo-type=dataset \4 --local-dir ./Sparkle \5 --include "intermediate_data/location_*_part*.tar"67# Extract in place; tar-internal paths are {edit_type}/{subdir}/{file},8# so the working directory must be intermediate_data/ for the layout to align.9cd ./Sparkle/intermediate_data
10forfin location_*_part*.tar;dotar -xf "$f";done
After extraction, the layout matches the online preview structure exactly, populating intermediate_data/location/{source_frame0, edited_frame0, ...}/.
📋 Per-task Pipeline Metadata
In addition to the per-task artifacts, each theme's intermediate_data/{edit_type}/ folder also contains five .jsonl files recording metadata produced at various stages of the pipeline (e.g., quality scores, foreground grounding labels). These records are useful for reproducing our quality filtering, inspecting per-stage rejection statistics, or building stricter / looser variants of Sparkle for downstream research.
edited_frame0_score.jsonl records per-sample EditScore evaluation of the Stage 2 output (edited_frame0/{task}.png). One JSON object per line:
json
1{2"id":"Sparkle_location_000000",3"prompt":"Shift the background to a rooftop overlooking a modern city skyline at dusk, ...",4"editscore":{5"prompt_following":9.7,6"consistency":8.8,7"perceptual_quality":8.5,8"overall":8.62887857991077,9"SC_reasoning":"The edited image perfectly follows the instruction: ...",10"PQ_reasoning":"The image displays a realistic cityscape with convincing lighting ..."11}12}
Field
Description
id
Sample id, matches the task column in the CSV.
prompt
The editing instruction.
editscore.prompt_following
Sub-score (0–10): how well the edit follows the instruction.
editscore.consistency
Sub-score (0–10): subject and identity consistency with the source frame.
editscore.perceptual_quality
Sub-score (0–10): perceptual quality of the edited image.
editscore.overall
Aggregated overall score. We filter out samples with overall < 8.
editscore.SC_reasoning
Free-text rationale for the consistency / instruction-following sub-scores.
editscore.PQ_reasoning
Free-text rationale for the perceptual-quality sub-score.
edited_frame0_foreground_removed_score.jsonl records per-sample EditScore evaluation of the Stage 3 intermediate output (edited_frame0_foreground_removed/{task}.png), measuring the foreground-removal quality. The schema is identical to edited_frame0_score.jsonl:
At this stage we apply a stricter threshold and filter out samples with overall < 8.5 to guarantee a perfectly clean background before the I2V generation that follows.
foreground_grounding_r1.jsonl records the first-round VLM grounding result that compares the source first frame and the Stage 2 edited first frame to identify foreground objects to preserve. This is the labeling step described in Stage 3 of the pipeline. One JSON object per line:
json
1{2"id":"Sparkle_location_000000",3"prompt":"Shift the background to a rooftop overlooking a modern city skyline at dusk, ...",4"edit_type":"location",5"round1_labels":[6"woman in brown hat and coat",7"clasped hands with ring",8"striped shirt under coat",9"brown wide-brimmed hat"10],11"round1_objects":[12{"bbox_2d":[447,27,765,998],"label":"woman in brown hat and coat"},13{"bbox_2d":[515,800,615,980],"label":"clasped hands with ring"},14{"bbox_2d":[490,398,615,800],"label":"striped shirt under coat"},15{"bbox_2d":[505,27,710,258],"label":"brown wide-brimmed hat"}16]17}
Field
Description
id
Sample id, matches the task column in the CSV.
prompt
The editing instruction.
edit_type
The theme this sample belongs to (location / season / time / style / openve3m).
round1_labels
List of foreground-object labels detected by the VLM.
round1_objects
Per-object detection records; each item has a bbox_2d and a label.
The bounding boxes are detected on the source first frame (source_frame0/{task}.png). Since our pipeline preserves the foreground identity and pose during background replacement, these boxes apply equally to the corresponding edited first frame (edited_frame0/{task}.png).
The bbox_2d field follows Qwen3-VL's normalized coordinate format with values in the range [0, 1000], representing [x1, y1, x2, y2] (top-left and bottom-right corners). Convert them to absolute pixel coordinates of the real frame as follows:
foreground_grounding_r2.jsonl records the second-round VLM grounding result that produces the temporal anchors for Stage 4 (BAIT Foreground Tracking). Building on the labels from foreground_grounding_r1.jsonl, Qwen3-VL is asked to re-locate every Round 1 label on frames sampled at 2 FPS from the source video, yielding per-frame bounding boxes that anchor the subsequent SAM3 multi-pass tracking. One JSON object per line:
json
1{2"id":"Sparkle_location_000000",3"prompt":"Shift the background to a rooftop overlooking a modern city skyline at dusk, ...",4"edit_type":"location",5"round1_labels":[...],6"round1_objects":[...],7"frame_objects":[8[9{"bbox_2d":[448,26,765,998],"label":"woman in brown hat and coat"},10{"bbox_2d":[521,795,618,968],"label":"clasped hands with ring"},11{"bbox_2d":[545,420,625,805],"label":"striped shirt under coat"},12{"bbox_2d":[507,26,712,270],"label":"brown wide-brimmed hat"}13],14[15{"bbox_2d":[452,34,764,998],"label":"woman in brown hat and coat"},16{"bbox_2d":[505,784,600,955],"label":"clasped hands with ring"},17 ...
18],19 ...
20]21}
The schema extends foreground_grounding_r1.jsonl with a single new field:
Field
Description
frame_objects
A 2D list of grounding results, one inner list per 2 FPS-sampled frame. Each inner list mirrors the round1_objects schema (a list of {"bbox_2d": [...], "label": "..."} items), giving the per-frame bbox of every Round 1 label on that frame.
The other fields (id, prompt, edit_type, round1_labels, round1_objects) are inherited unchanged from foreground_grounding_r1.jsonl. Use the same normalize_bbox helper to convert bbox_2d values to absolute pixel coordinates.
Note. Some entries in frame_objects may have an empty bbox_2d (e.g. {"bbox_2d": [], "label": "..."}), indicating that the VLM failed to localize that particular label on that frame. Our BAIT algorithm handles these gracefully by relying on the remaining frames' anchors and a pixel-wise majority vote across SAM3 tracking passes.
edited_video_score.jsonl records per-sample EditScore evaluation of the Stage 5 final synthesized video. Following the protocol in our paper, we uniformly sample four non-first frames from each video and score them independently. One JSON object per line:
json
1{2"id":"Sparkle_location_000000",3"prompt":"Shift the background to a rooftop overlooking a modern city skyline at dusk, ...",4"frame_indices":[1,26,51,76],5"editscore":[6{7"SC_score":9.0,8"PQ_score":8.5,9"O_score":8.719958110896453,10"SC_score_reasoning":"The editing successfully changed the background to a rooftop overlooking a modern city skyline at dusk, ...",11"PQ_score_reasoning":"The image has a mostly natural cityscape and lighting, but the person's hands appear slightly distorted ...",12"SC_raw_output":"...",13"PQ_raw_output":"..."14},15{"SC_score":8.3,"PQ_score":8.5,"O_score":8.388302424289282,"...":"..."},16{"SC_score":9.1,"PQ_score":7.4,"O_score":8.143194240945185,"...":"..."},17{"SC_score":8.9,"PQ_score":7.8,"O_score":8.318623075017307,"...":"..."}18]19}
Field
Description
id
Sample id, matches the task column in the CSV.
prompt
The editing instruction.
frame_indices
The 4 frame indices (0-based) sampled from the synthesized video for evaluation, e.g. [1, 26, 51, 76].
editscore
A length-4 list, one entry per sampled frame, in the same order as frame_indices.
editscore[i].SC_score
Sub-score (0–10) for instruction-following / consistency on frame i.
editscore[i].PQ_score
Sub-score (0–10) for perceptual quality on frame i.
editscore[i].O_score
Aggregated overall score on frame i.
editscore[i].SC_score_reasoning
Free-text rationale behind SC_score.
editscore[i].PQ_score_reasoning
Free-text rationale behind PQ_score.
editscore[i].SC_raw_output
Raw JSON string returned by the EditScore SC head (contains reasoning and per-criterion score array).
editscore[i].PQ_raw_output
Raw JSON string returned by the EditScore PQ head.
The final filtering rule is: average O_score across all four sampled frames; discard the sample if the mean is below 8.
Source videos in the openve3m theme are derived from OpenVE-3M and retain their original licenses; please consult the upstream source before redistribution.
🎯 Benchmark
Sparkle-Bench is the largest evaluation benchmark tailored for instruction-guided video background replacement, comprising 458 carefully curated videos across 4 themes, 21 subthemes, and 97 distinct scenes. It is fully open-sourced at 🤗stdKonjac/Sparkle-Bench. For evaluation methodology and our six-dimensional scoring protocol, please refer to our paper.
All source videos in the benchmark are uncompressed and previewable directly in the browser, so users can inspect any sample without downloading anything.
The benchmark is organized into four themes:
Theme
Description
location
Background replaced with a different physical environment (rural, nature, landmark, ...).
season
Background changed across seasons (spring, summer, autumn, winter).
time
Background changed across times of day (dawn, dusk, night, ...).
We follow the format of OpenVE-Bench for direct compatibility with existing evaluation pipelines.
Each theme's evaluation prompts live in {edit_type}_bench.csv, a three-column table:
Column
Description
edited_type
The theme of this sample, one of location / season / time / style.
prompt
The natural-language editing instruction.
original_video
Path to the source video, e.g. source_videos/location/Sparkle_location_010913.mp4.
Per-task auxiliary metadata is stored alongside in {edit_type}_metadata.jsonl. Each line is one sample:
json
1{2"id":"Sparkle_location_004302",3"prompt":"Put the subject against ancient stone ruins overgrown with wind-swept grass, ...",4"metadata":{5"edit_type":"location",6"chosen_keyword":"landmark: ancient stone ruins with wind-swept grass",7"original_scene":"A dimly lit indoor bar or restaurant with brick walls, framed artwork, and warm overhead lighting."8}9}
Field
Description
id
Sample id, e.g. Sparkle_location_004302. Matches the basename of the corresponding original_video path.
prompt
Same as the prompt column in the CSV.
metadata.edit_type
The theme this sample belongs to (location / season / time / style).
metadata.chosen_keyword
The subtheme: scene label (e.g. "landmark: ancient stone ruins with wind-swept grass").
metadata.original_scene
A description of the source video's first frame.
👀 Online Preview
All 458 source videos are stored as uncompressed .mp4 files under source_videos/{edit_type}/, and can be played directly in the browser without any download.
For example, the source video of task Sparkle_location_000011 (the first row in the location theme of the dataset viewer) is browsable at: Sparkle_location_000011.
The dataset viewer at the top of the HF page lets you scroll through all four themes and read the corresponding prompts inline.
⬇️ Downloading the Benchmark
Sparkle-Bench is small enough to download in one command. Pull the entire repo:
After downloading, the relative paths in {edit_type}_bench.csv (e.g. source_videos/location/Sparkle_location_010913.mp4) will resolve directly.
📊 Evaluation
We provide an end-to-end evaluation script, eval_sparkle_bench_gemini.py, that scores edited videos using Gemini-2.5-Pro under our six-dimensional rubric (see Section 3.7 in our paper). The six dimensions are: Instruction Compliance, Overall Visual Quality, Foreground Integrity, Foreground Motion Consistency, Background Dynamics, and Background Visual Quality, each scored on a 1–5 scale.
1. Prepare your inference outputs
The script expects edited videos to be organized in a specific directory tree. For every sample in Sparkle-Bench, the inference output should be saved as:
{save_dir} is your inference root (free to choose).
{edit_type} is one of location / season / time / style.
{subtheme}---{scene_key} is derived from the sample's chosen_keyword field in {edit_type}_metadata.jsonl. Specifically, splitting chosen_keyword on ": " yields subtheme: scene, then scene_key = scene.replace(" ", "_"). The triple-dash --- is the separator between the two parts.
{id} is the sample id, e.g. Sparkle_location_000172.
For example, the inference outputs across the four themes should look like:
By default the script uses Azure-hosted Gemini via the OpenAI-compatible API for convenient concurrency. Export two environment variables before running:
If you have direct access to the Gemini API, you can swap the GEMINI_API client at the top of the script for the native google-genai SDK. The request payload only needs (system prompt, source video, edited video), so the adaptation is straightforward. Just keep the temperature=0 / seed=42 settings for reproducibility.
3. Run the evaluation
Assuming Sparkle-Bench has been downloaded to data/Sparkle-Bench/ (the default --bench_root):
By default the script evaluates all four themes (location, season, time, style); pass --edit_types to restrict to a subset. Concurrency is controlled inside the script (default 20 workers).
4. Read the output
For each (save_dir, edit_type) pair, the script writes:
Each line is a per-sample record containing the six-dim scores plus the original Gemini reasoning:
json
1{2"id":"Sparkle_location_000172",3"prompt":"Put the subject against ancient stone ruins overgrown with wind-swept grass, ...",4"edit_type":"location",5"subtheme":"landmark",6"scene":"ancient stone ruins with wind-swept grass",7"scores":[5,5,5,5,5,5],8"result":"Brief reasoning: The edited background perfectly matches every detail of the prompt, ...\nInstruction Compliance: 5\nOverall Visual Quality: 5\nForeground Integrity: 5\nForeground Motion Consistency: 5\nBackground Dynamics: 5\nBackground Visual Quality: 5"9}
The scores array follows this fixed order: [Instruction Compliance, Overall Visual Quality, Foreground Integrity, Foreground Motion Consistency, Background Dynamics, Background Visual Quality]. Following the OpenVE-Bench protocol, the script automatically caps dimensions 2–6 at the Instruction Compliance score to prevent score hacking.
After scoring, the script aggregates per-theme and macro averages and prints a summary table to stdout. The evaluation is deterministic by design (temperature=0, fixed seed=42) for reproducibility.
🖼️ Reference Images (Optional, Use with Caution)
By construction, every Sparkle-Bench sample is a video that passed the first four stages of our pipeline but failed the final synthesis quality check in Stage 5 (see Section 3.7 of our paper). As a free byproduct, this means each sample comes with a pure background image generated by Stage 3 (Individual Background Generation), where the foreground has been removed from the preliminarily edited first frame.
We release these images under ref_images/{edit_type}/{id}.png, alongside the CSV/JSONL annotations. These images may be useful for reference-based background-replacement experiments (e.g., feeding the clean background as an extra visual condition to the editing model).
⚠️ Disclaimer. Our paper neither trains any reference-based model nor includes any reference-image-based evaluation. We release ref_images/ purely to facilitate future research in this direction. The images are not curated and may contain noise such as low-quality edits or imperfect foreground removal. Please use them with caution. We make no quality guarantees about this auxiliary asset.
Source videos are derived from OpenVE-3M and retain their original licenses; please consult the upstream source before redistribution.
🧠 Model
We release Kiwi-Sparkle, a video background-replacement model fine-tuned on the Sparkle dataset for 10K steps with a batch size of 128, starting from a Kiwi-Edit base. Since we apply no architectural modifications to Kiwi-Edit, Kiwi-Sparkle's weights are fully compatible with the Kiwi-Edit weights structure. Any inference, training, or deployment pipeline that runs Kiwi-Edit can run Kiwi-Sparkle as a drop-in replacement.
Kiwi-Sparkle is trained using the official Kiwi-Edit recipe in this script with no modifications. Two common entry points are supported:
Train from the Kiwi-Edit base on a Sparkle theme. Point --vid_dataset_metadata_path to the corresponding Sparkle training CSV, and load the foundation Kiwi-Edit-Stage2 checkpoint:
The rest of the script stays exactly as in the official Kiwi-Edit setup.
🎬 Inference
OpenVE-Bench
Since Kiwi-Sparkle is architecturally identical to Kiwi-Edit, you can simply follow the official OpenVE-Bench evaluation pipeline of Kiwi-Edit and swap the checkpoint to Kiwi-Sparkle. For example:
Step 1. Clone the Kiwi-Edit repository and copy our two scripts into the Kiwi-Edit repo root, alongside the official test_benchmark.py.
Step 2. Edit the shell script to point at your Kiwi-Sparkle checkpoint, then launch (defaults to 8 GPUs):
bash test_benchmark_sparkle_bench.sh
The script writes inference outputs to infer_results/Kiwi-Sparkle-720P-81F/sparkle_bench/{edit_type}/{subtheme}---{scene_key}/{id}_edited.mp4. Re-run it with a different EDIT_TYPE to cover all four themes.