amir477 commited on
Commit
38243cc
·
verified ·
1 Parent(s): cea8b31

Add dataset card

Browse files
Files changed (1) hide show
  1. README.md +37 -18
README.md CHANGED
@@ -23,7 +23,7 @@ task_categories:
23
 
24
  ## Why this dataset
25
 
26
- Faces are one of the most perceptually sensitive regions in an image and there exist strong, well-studied priors for facial quality. Face2Scene leverages this: by treating the face as an oracle for degradation, the model learns to restore the surrounding scene. To support this, InScene provides images in which a consistent set of **identities** appear across many diverse scenes, together with the localization metadata (face boxes and landmarks) needed to isolate and reason about the facial region.
27
 
28
  ## Data generation
29
 
@@ -35,34 +35,44 @@ Please refer to that repository for the full generation details (identity condit
35
 
36
  ## Dataset structure
37
 
38
- The dataset is organized into `train/` and `val/` splits. Each split is a flat directory of **sample folders**, one folder per generated image. Every sample folder contains exactly two files that share the sample's name:
 
 
 
 
 
 
 
 
 
 
39
 
40
  ```
41
- train/
42
- iden_00001_img_11_sample_321_repeat_1/
43
- iden_00001_img_11_sample_321_repeat_1.png # 1024x1024 RGB image
44
- iden_00001_img_11_sample_321_repeat_1.json # metadata for that image
45
- ...
46
- val/
47
- ...
48
  ```
49
 
50
- The folder name encodes provenance: `iden_<identity>`, `img_<source-face-id>`, `sample_<sample-id>`, `repeat_<k>` (the same prompt/identity may be sampled multiple times).
 
51
 
52
  ### Splits
53
 
54
- | Split | Samples | Unique identities | Size |
55
- |---------|--------:|------------------:|------:|
56
- | `train` | 11,260 | 870 | 19 GB |
57
- | `val` | 1,329 | 100 | 3.4 GB |
58
 
59
- *(The `train` and `val` identity sets are disjoint.)*
60
 
61
  ### Per-sample JSON schema
62
 
 
 
63
  | Field | Type | Description |
64
  |--------------|-----------------|-----------------------------------------------------------------------------|
65
- | `image_name` | string | Filename of the paired PNG. |
66
  | `prompt` | string | Structured scene prompt used for generation (subject, framing, background, detail/style). |
67
  | `image_size` | object | `{ "width": 1024, "height": 1024 }`. |
68
  | `face_bbox` | list[int] | Face bounding box `[x1, y1, x2, y2]` in pixel coordinates. |
@@ -79,7 +89,7 @@ import glob, json, os
79
  from PIL import Image
80
  from huggingface_hub import snapshot_download
81
 
82
- # Download just the train split (use allow_patterns="val/*" for val)
83
  local = snapshot_download(
84
  "amir477/InScene",
85
  repo_type="dataset",
@@ -90,7 +100,7 @@ samples = sorted(glob.glob(os.path.join(local, "train", "*")))
90
  folder = samples[0]
91
  name = os.path.basename(folder)
92
 
93
- image = Image.open(os.path.join(folder, name + ".png")) # 1024x1024 RGB
94
  meta = json.load(open(os.path.join(folder, name + ".json")))
95
 
96
  print(image.size) # (1024, 1024)
@@ -99,6 +109,15 @@ print(meta["face_bbox"]) # [x1, y1, x2, y2]
99
  print(len(meta["landmark"])) # 68
100
  ```
101
 
 
 
 
 
 
 
 
 
 
102
  ## Citation
103
 
104
  If you find these images useful, please cite:
 
23
 
24
  ## Why this dataset
25
 
26
+ Faces are one of the most perceptually sensitive regions in an image and there exist strong, well-studied priors for facial quality. Face2Scene leverages this: by treating the face as an oracle for degradation, the model learns to restore the surrounding scene. To support this, InScene provides images in which a consistent set of **identities** appear across many diverse scenes, together with the localization metadata (face boxes and landmarks) needed to isolate and reason about the facial region. The `val` split additionally ships fixed **low-quality (degraded) inputs** paired with their clean targets, for consistent evaluation of restoration.
27
 
28
  ## Data generation
29
 
 
35
 
36
  ## Dataset structure
37
 
38
+ The dataset is split into `train/` and `val/`. Each split is a flat directory of **sample folders** (one folder per generated image). The folder name encodes provenance: `iden_<identity>_img_<source-face-id>_sample_<sample-id>_repeat_<k>` (the same prompt/identity may be sampled multiple times).
39
+
40
+ **`train`** — each folder holds the generated high-quality image and its metadata:
41
+
42
+ ```
43
+ train/iden_00001_img_11_sample_321_repeat_1/
44
+ iden_00001_img_11_sample_321_repeat_1.png # 1024x1024 RGB image (HQ)
45
+ iden_00001_img_11_sample_321_repeat_1.json # metadata
46
+ ```
47
+
48
+ **`val`** — each folder additionally holds a degraded, low-quality version of the image prefixed `LQ_`. The un-prefixed `*.png` is the **clean target** and the `LQ_*.png` is the **degraded restoration input**:
49
 
50
  ```
51
+ val/iden_00003_img_4_sample_473_repeat_1/
52
+ iden_00003_img_4_sample_473_repeat_1.png # 1024x1024 RGB image (HQ target)
53
+ LQ_iden_00003_img_4_sample_473_repeat_1.png # degraded input
54
+ iden_00003_img_4_sample_473_repeat_1.json # metadata
 
 
 
55
  ```
56
 
57
+ > Note: 6 of the val folders also contain a superseded copy of the trio prefixed `old_`
58
+ > (`old_*.png`, `old_LQ_*.png`, `old_*.json`), kept for provenance.
59
 
60
  ### Splits
61
 
62
+ | Split | Sample folders | Identities | Files | Size |
63
+ |---------|---------------:|-----------:|-------|------:|
64
+ | `train` | 11,260 | 870 | 11,260 HQ PNG + 11,260 JSON | 19 GB |
65
+ | `val` | 1,329 | 100 | 1,329 HQ PNG + 1,329 LQ PNG + 1,329 JSON (+ 18 `old_*` leftover files) | 3.4 GB |
66
 
67
+ *(The `train` and `val` identity sets are disjoint. `train` contains no LQ images — degradation for training is expected to be applied on the fly.)*
68
 
69
  ### Per-sample JSON schema
70
 
71
+ The JSON describes the **HQ** image (`image_name` is the un-prefixed PNG); for `val`, the degraded counterpart is the same name prefixed with `LQ_`.
72
+
73
  | Field | Type | Description |
74
  |--------------|-----------------|-----------------------------------------------------------------------------|
75
+ | `image_name` | string | Filename of the paired HQ PNG. |
76
  | `prompt` | string | Structured scene prompt used for generation (subject, framing, background, detail/style). |
77
  | `image_size` | object | `{ "width": 1024, "height": 1024 }`. |
78
  | `face_bbox` | list[int] | Face bounding box `[x1, y1, x2, y2]` in pixel coordinates. |
 
89
  from PIL import Image
90
  from huggingface_hub import snapshot_download
91
 
92
+ # Download one split (use allow_patterns="val/*" for val)
93
  local = snapshot_download(
94
  "amir477/InScene",
95
  repo_type="dataset",
 
100
  folder = samples[0]
101
  name = os.path.basename(folder)
102
 
103
+ image = Image.open(os.path.join(folder, name + ".png")) # 1024x1024 RGB (HQ)
104
  meta = json.load(open(os.path.join(folder, name + ".json")))
105
 
106
  print(image.size) # (1024, 1024)
 
109
  print(len(meta["landmark"])) # 68
110
  ```
111
 
112
+ For the `val` split, each sample also has a degraded input alongside the clean target:
113
+
114
+ ```python
115
+ val_folder = sorted(glob.glob(os.path.join(local_val, "val", "*")))[0]
116
+ name = os.path.basename(val_folder)
117
+ target = Image.open(os.path.join(val_folder, name + ".png")) # clean HQ target
118
+ degraded = Image.open(os.path.join(val_folder, "LQ_" + name + ".png")) # degraded input
119
+ ```
120
+
121
  ## Citation
122
 
123
  If you find these images useful, please cite: