Datasets:
|
Download sref/README.md from Blue2Giant/FreeStyle_Dataset: direct link, hf CLI and curl.
- Browser
- Download file 5.23 kB
-
https://huggingface.co/datasets/Blue2Giant/FreeStyle_Dataset/resolve/523dc76b54793e5051faf0f30da7a7e94dea5bf2/sref/README.md
- Command line
-
hf download hf://datasets/Blue2Giant/FreeStyle_Dataset@523dc76b54793e5051faf0f30da7a7e94dea5bf2/sref/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Blue2Giant/FreeStyle_Dataset/resolve/523dc76b54793e5051faf0f30da7a7e94dea5bf2/sref/README.md
5.23 kB
| # FreeStyle Dataset — sref split | |
| This subfolder is the cref+sref+target triplet export of the | |
| `cref_sref_oneig_filter_part1..part5` vault sources used by the VGO project. | |
| The layout is intentionally simple so that downstream readers can use the | |
| dataset **with nothing more than Python's standard library + Pillow + pandas** | |
| — DuckDB and the internal `vault` package are **not** required. | |
| ## Contents | |
| ``` | |
| sref/ | |
| ├── README.md # this file | |
| ├── pairs.csv # one row per (sequence_id, choice_id) — fully self-contained | |
| ├── metadata.jsonl # one row per sequence_id, preserves the original vault structure | |
| ├── export_summary.json # counts and export-time metadata | |
| └── images/<uu>/<image_uuid>.<ext> | |
| # deduplicated image pool. <uu> is the first two hex chars of the uuid. | |
| ``` | |
| - Exported sources: 5 | |
| - `cref_sref_oneig_filter_part1` | |
| - `cref_sref_oneig_filter_part2` | |
| - `cref_sref_oneig_filter_part3` | |
| - `cref_sref_oneig_filter_part4` | |
| - `cref_sref_oneig_filter_part5` | |
| - Unique vault sequences exported: **417,761** | |
| - Rows in `pairs.csv` (= sequences × choices): **3,342,076** | |
| - Unique images in `images/`: **1,238,604** | |
| - Export wall-clock: started 2026-06-11T08:11:57.855884Z, finished 2026-06-11T08:33:59.192685Z | |
| ## Schema — `pairs.csv` | |
| | Column | Description | | |
| | --- | --- | | |
| | `sequence_id` | Vault sequence UUID. Eight rows share the same id, one per choice. | | |
| | `choice_id` | 0..7. Index of the instruction × caption × language combination. | | |
| | `source` | One of `cref_sref_oneig_filter_part{1..5}`. | | |
| | `task_type` | Always `edit` for this export. | | |
| | `cref_image` / `sref_image` / `target_image` | Relative path inside this folder, e.g. `images/ab/ab12….webp`. Open with PIL. | | |
| | `cref_width` / `cref_height` / `sref_*` / `target_*` | Pixel dimensions reported by the vault. | | |
| | `instruction` / `instruction_index` | Instruction text + its vault-internal key (`sample_instruction_en_123` etc). | | |
| | `target_caption` / `target_caption_index` | Target image caption + its vault key (`captions/scene_3` etc). | | |
| | `content_trigger_words` / `style_trigger_words` | Trigger phrases attached to the content/style references. | | |
| | `message_formatter` | The original modality template, always `<image_0><image_1><text_0><text_1><image_2>`. | | |
| | `require_loss_json` | JSON list aligned with the formatter modalities — `[false, false, false, false, true]` for edit. | | |
| | `uri` | Vault-side original uri string. | | |
| | `create_time` | ISO-8601 timestamp recorded in the vault. | | |
| ## Loading with pandas (no DuckDB needed) | |
| ```python | |
| import pandas as pd | |
| from PIL import Image | |
| from pathlib import Path | |
| root = Path("/path/to/sref") # local clone of this folder | |
| df = pd.read_csv(root / "pairs.csv") | |
| row = df.iloc[0] | |
| cref = Image.open(root / row["cref_image"]) | |
| sref = Image.open(root / row["sref_image"]) | |
| target = Image.open(root / row["target_image"]) | |
| prompt = row["instruction"] | |
| caption = row["target_caption"] | |
| ``` | |
| To keep only English instructions: | |
| ```python | |
| en_df = df[df["instruction_index"].str.endswith("_en_123")] | |
| ``` | |
| To deduplicate to one row per sequence (e.g. for visualizing pairs only): | |
| ```python | |
| unique = df.drop_duplicates(subset="sequence_id") | |
| ``` | |
| ## Loading with `datasets` | |
| ```python | |
| from datasets import load_dataset | |
| ds = load_dataset( | |
| "Blue2Giant/FreeStyle_Dataset", | |
| data_files="sref/pairs.csv", | |
| split="train", | |
| ) | |
| ``` | |
| Image columns are stored as relative paths inside this folder. After cloning | |
| the repo (or using `huggingface_hub.snapshot_download`), resolve them against | |
| the local snapshot root. | |
| ## Schema — `metadata.jsonl` (optional, for power users) | |
| Each line is a JSON object preserving the original vault structure for a | |
| single `sequence_id`. Useful if you need to: | |
| - Reconstruct the eight `sequence_choices` exactly as the trainer saw them. | |
| - Access the auxiliary texts that are not surfaced in `pairs.csv`, such as | |
| `captions/scene_1`, `captions/scene_2`, `target_caption`, and the | |
| per-language variants. | |
| ```json | |
| { | |
| "sequence_id": "...", | |
| "source": "cref_sref_oneig_filter_part1", | |
| "task_type": "edit", | |
| "uri": "...", | |
| "create_time": "2026-04-26T...", | |
| "images": [{"id": "...", "index": "cref_0", "width": 1024, "height": 1024, "file_name": "images/.../....webp"}, ...], | |
| "texts": [{"id": "...", "index": "...", "language": null, "content": "..."}, ...], | |
| "choices": [{"choice_id": 0, "message_formatter": "<image_0><image_1><text_0><text_1><image_2>", "image_indices": ["cref_0", "sref_0", "target"], "text_indices": ["sample_instruction_cn_123", "captions/scene_3_en"], "require_loss": [false, false, false, false, true]}, ...], | |
| "choices_weights": [] | |
| } | |
| ``` | |
| ## Image dedup | |
| Each image is stored once under its vault UUID, regardless of how many | |
| sequences reference it. `pairs.csv` rows for different sequences therefore | |
| reuse the same `cref_image` / `sref_image` paths whenever a cref/sref appears | |
| in multiple pairs — this is the intended dedup behaviour and **not** a bug. | |
| ## License & provenance | |
| These triplets were assembled by sampling cref/sref references from internal | |
| collections; please refer to the parent repository's top-level dataset card | |
| for licensing. | |