zzsyppt commited on
Commit
d8eae7c
·
verified ·
1 Parent(s): 42a8085

Update Chinese README

Browse files
Files changed (1) hide show
  1. README_zh.md +183 -156
README_zh.md CHANGED
@@ -1,156 +1,183 @@
1
- ---
2
- pretty_name: Outpainted for Image Cropping
3
- license: other
4
- license_name: research-only-source-license-dependent
5
- task_categories:
6
- - image-to-image
7
- - object-detection
8
- tags:
9
- - image
10
- - computer-vision
11
- - image-cropping
12
- - bounding-box
13
- - outpainting
14
- - inpainting
15
- - stable-diffusion
16
- - composition
17
- - imagefolder
18
- size_categories:
19
- - 10K<n<100K
20
- ---
21
-
22
- # Outpainted for Image Cropping
23
-
24
- <p align="center">
25
- <a href="./README.md">English</a> | <a href="./README_zh.md">涓枃</a>
26
- </p>
27
-
28
- ## 鏁版嵁闆嗙畝浠?
29
- 鏈暟鎹泦鍖呭惈涓€鎵归€氳繃 **Stable Diffusion v2 Inpaint** 鎵╁浘寰楀埌鐨勫浘鍍忥紝浠ュ強姣忓紶鎵╁浘鍥惧儚涓€滃師濮嬪浘鍍忓尯鍩熲€濈殑杈圭晫妗嗘爣娉ㄣ€傛暟鎹泦涓昏闈㈠悜鍥惧儚瑁佸壀銆佸師濮嬬敾骞呮仮澶嶃€佹瀯鍥炬劅鐭ヨ鍓拰鎵╁浘鎰熺煡瑙嗚鐞嗚В绛夌爺绌朵换鍔°€?
30
- 姣忎釜鏍锋湰鍖呭惈锛?
31
- - 涓€寮犳墿鍥惧悗鐨勫浘鐗囷紱
32
- - `orig_bbox`锛氬師鍥惧湪鎵╁睍鐢诲竷涓殑浣嶇疆锛?- `composition_tags`锛氬浘鐗囨瀯鍥炬爣绛惧垪琛紝閮ㄥ垎涓虹┖銆?
33
- ## 鏁版嵁鐢熸垚娴佺▼
34
-
35
- ![image-20260503132555963](./assets/image-20260503132555963.png)
36
-
37
- 鏁版嵁鐢熸垚娴佺▼濡備笅锛?
38
- 1. 鏀堕泦涓撲笟鎽勫奖鍥剧墖鎴栭珮缇庡璇勫垎鍥剧墖銆?2. 鑾峰彇鎴栫敓鎴愬浘鍍忔弿杩帮紝渚嬪浣跨敤 BLIP 鐢熸垚 caption銆?3. 璁剧疆寰呮墿灞曡竟璺濄€?4. 浣跨敤 **Stable Diffusion v2 Inpaint** 瀵规墿灞曞尯鍩熻繘琛岃ˉ鍏ㄣ€?5. 浣跨敤姝i潰鎻愮ず璇嶇害鏉熺敓鎴愬唴瀹广€?6. 浣跨敤璐熼潰鎻愮ず璇嶅噺灏戜笉甯屾湜鍑虹幇鐨勫唴瀹癸紝渚嬪 `frame`銆乣border`銆乣text`銆乣watermark` 绛夈€?7. 瀵圭敓鎴愮粨鏋滆繘琛屼吉褰辨娴嬨€佷竴鑷存€ф娴嬨€?8. 杩涜浜哄伐鏍告煡銆?9. 淇濈暀閫氳繃璐ㄩ噺妫€鏌ョ殑鏍锋湰锛屽苟璁板綍鍘熷浘鍖哄煙 bbox锛屽舰鎴?training pairs銆?
39
-
40
-
41
- `orig_bbox` 浣跨敤濡備笅鏍煎紡锛?
42
- ```text
43
- [x_min, y_min, x_max, y_max]
44
- ```
45
-
46
- 璇?bbox 琛ㄧず鍘熷鍥惧儚鍖哄煙鍦ㄦ墿鍥惧悗鐢诲竷涓殑浣嶇疆锛岃€屼笉鏄洰鏍囨娴嬩腑鐨勭墿浣撴銆?
47
- ## 鏁版嵁鏉ユ簮
48
-
49
- 鏈暟鎹泦鐨勬簮鍥惧儚鏉ヨ嚜鎴栧弬鑰冧互涓嬪叕寮€鏁版嵁闆?浠撳簱锛?
50
- 1. **PICD: Photographic Image Composition Dataset**
51
- https://github.com/CV-xueba/PICD_ImageComposition
52
-
53
- 2. **LAION Aesthetics v2 4.75**
54
- https://huggingface.co/datasets/laion/aesthetics_v2_4.75
55
-
56
- 3. **Landscape-Dataset**
57
- https://github.com/koishi70/Landscape-Dataset/tree/master
58
-
59
-
60
- ## 鏁版嵁缁撴瀯
61
-
62
- ```text
63
- outpainted-for-image-cropping/
64
- 鈹溾攢鈹€ README.md
65
- 鈹溾攢鈹€ metadata.jsonl
66
- 鈹溾攢鈹€ stats.json
67
- 鈹斺攢鈹€ images/
68
- 鈹溾攢鈹€ img_000000.png
69
- 鈹溾攢鈹€ img_000001.png
70
- 鈹斺攢鈹€ ...
71
- ```
72
-
73
- `metadata.jsonl` 涓瘡涓€琛屽搴斾竴涓牱鏈紝渚嬪锛?
74
- ```json
75
- {
76
- "file_name": "images/img_000000.png",
77
- "orig_bbox": [281, 77, 881, 487],
78
- "composition_tags": ["HORI2"]
79
- }
80
- ```
81
-
82
- ### 瀛楁璇存槑
83
-
84
- - `file_name`锛氭墿鍥惧悗鍥剧墖鐨勭浉瀵硅矾寰勩€?- `orig_bbox`锛氬師鍥惧尯鍩熷湪鎵╁浘鐢诲竷涓殑杈圭晫妗嗭紝鏍煎紡涓?`[x_min, y_min, x_max, y_max]`銆?- `composition_tags`锛氫粠鍘熷鏁版嵁闆嗕腑瑙f瀽寰楀埌鐨勬瀯鍥炬爣绛惧垪琛ㄣ€傝嫢娌℃湁鍙潬鐨勬瀯鍥炬爣绛撅紝鍒欎负绌哄垪琛?`[]`銆?
85
- ## 鏁版嵁闆嗙粺璁?楂橀鏋勫浘鏍囩锛?
86
- | 鏍囩 | 鏁伴噺 |
87
- |---|---:|
88
- | HORI2 | 1,956 |
89
- | HORI3 | 1,694 |
90
- | DIFFUSE | 1,600 |
91
- | DENSE | 1,436 |
92
- | DIA | 1,305 |
93
- | LINE_VERTI3 | 1,156 |
94
- | PATTERN | 1,000 |
95
- | LINE_VERTI_MANY | 983 |
96
- | POINT_MULTI_HORI | 64 |
97
- | LINE_VERTI2 | 55 |
98
-
99
- ## 浣跨敤鏂瑰紡
100
-
101
- 浠?Hugging Face Hub 鍔犺浇锛?
102
- ```python
103
- from datasets import load_dataset
104
-
105
- dataset = load_dataset("zzsyppt/outpainted-for-image-cropping")
106
- print(dataset)
107
- print(dataset["train"][0])
108
- ```
109
-
110
- 鏈湴涓婁紶鍓嶆鏌ワ細
111
-
112
- ```python
113
- from datasets import load_dataset
114
-
115
- dataset = load_dataset("imagefolder", data_dir="./hf_dataset")
116
- print(dataset)
117
- print(dataset["train"][0])
118
- ```
119
-
120
- 棰勬湡瀛楁鍖呮嫭锛?
121
- ```text
122
- image
123
- orig_bbox
124
- composition_tags
125
- ```
126
-
127
- ## 寮曠敤
128
-
129
- 鏈暟鎹泦浠呯敤浜庝釜浜虹敤閫斻€傚鏋滀娇鐢ㄦ湰鏁版嵁闆嗭紝璇锋牴鎹疄闄呬娇鐢ㄧ殑鏍锋湰鏉ユ簮寮曠敤瀵瑰簲涓婃父鏁版嵁闆嗐€?
130
- ### PICD
131
-
132
- ```bibtex
133
- @inproceedings{zhao2025can,
134
- title={Can Machines Understand Composition? Dataset and Benchmark for Photographic Image Composition Embedding and Understanding},
135
- author={Zhao, Zhaoran and Lu, Peng and Zhang, Anran and Li, Peipei and Li, Xia and Liu, Xuannan and Hu, Yang and Chen, Shiyi and Wang, Liwei and Guo, Wenhao},
136
- booktitle={Proceedings of the Computer Vision and Pattern Recognition Conference},
137
- pages={14411--14421},
138
- year={2025}
139
- }
140
- ```
141
-
142
- ### LAION-Aesthetics
143
-
144
- 璇峰弬鑰?LAION 瀹樻柟椤甸潰鍜屽搴?Hugging Face 鏁版嵁闆嗛〉闈㈠紩鐢?LAION-Aesthetics / LAION-5B 鐩稿叧宸ヤ綔锛?
145
- - https://laion.ai/blog/laion-aesthetics/
146
- - https://huggingface.co/datasets/laion/aesthetics_v2_4.75
147
-
148
- ### Landscape-Dataset
149
-
150
- 璇峰弬鑰冨師濮嬩粨搴擄細
151
-
152
- - https://github.com/koishi70/Landscape-Dataset/tree/master
153
-
154
- ## 鑷磋阿
155
-
156
- 鏈暟鎹泦鐨勭敓鎴愪娇鐢ㄤ簡 Stable Diffusion v2 Inpaint锛屽苟鍙傝€冩垨浣跨敤浜嗗叕寮€鍥惧儚鏁版嵁婧愩€傛劅璋笂娓告暟鎹泦銆佷粨搴撳拰妯″瀷鐨勫垱寤鸿€呬笌缁存姢鑰呫€?
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: Outpainted for Image Cropping
3
+ license: other
4
+ license_name: research-only
5
+ task_categories:
6
+ - image-to-image
7
+ - object-detection
8
+ tags:
9
+ - image
10
+ - computer-vision
11
+ - image-cropping
12
+ - bounding-box
13
+ - outpainting
14
+ - inpainting
15
+ - stable-diffusion
16
+ - composition
17
+ - imagefolder
18
+ size_categories:
19
+ - 10K<n<100K
20
+ ---
21
+
22
+ # Outpainted for Image Cropping
23
+
24
+ <p align="center">
25
+ <a href="./README.md">English</a> | <a href="./README_zh.md">中文</a>
26
+ </p>
27
+
28
+ ## 数据集简介
29
+
30
+ 本数据集包含一批通过 **Stable Diffusion v2 Inpaint** 扩图得到的图像,以及每张扩图图像中“原始图像区域”的边界框标注。数据集主要面向图像裁剪、原始画幅恢复、构图感知裁剪和扩图感知视觉理解等研究任务。
31
+
32
+ 每个样本包含:
33
+
34
+ - 一张扩图后的图片;
35
+ - `orig_bbox`:原图在扩展画布中的位置;
36
+ - `composition_tags`:图片构图标签列表,部分为空。
37
+
38
+ ## 数据生成流程
39
+
40
+ ![image-20260503132555963](./assets/image-20260503132555963.png)
41
+
42
+ 数据生成流程如下:
43
+
44
+ 1. 收集专业摄影图片或高美学评分图片。
45
+ 2. 获取或生成图像描述,例如使用 BLIP 生成 caption。
46
+ 3. 设置待扩展边距。
47
+ 4. 使用 **Stable Diffusion v2 Inpaint** 对扩展区域进行补全。
48
+ 5. 使用正面提示词约束生成内容。
49
+ 6. 使用负面提示词减少不希望出现的内容,例如 `frame`、`border`、`text`、`watermark` 等。
50
+ 7. 对生成结果进行伪影检测、一致性检测。
51
+ 8. 进行人工核查。
52
+ 9. 保留通过质量检查的样本,并记录原图区域 bbox,形成 training pairs。
53
+
54
+
55
+ `orig_bbox` 使用如下格式:
56
+
57
+ ```text
58
+ [x_min, y_min, x_max, y_max]
59
+ ```
60
+
61
+ 该 bbox 表示原始图像区域在扩图后画布中的位置,而不是目标检测中的物体框。
62
+
63
+ ## 数据来源
64
+
65
+ 本数据集的源图像来自或参考以下公开数据集/仓库:
66
+
67
+ 1. **PICD: Photographic Image Composition Dataset**
68
+ https://github.com/CV-xueba/PICD_ImageComposition
69
+
70
+ 2. **LAION Aesthetics v2 4.75**
71
+ https://huggingface.co/datasets/laion/aesthetics_v2_4.75
72
+
73
+ 3. **Landscape-Dataset**
74
+ https://github.com/koishi70/Landscape-Dataset/tree/master
75
+
76
+
77
+ ## 数据结构
78
+
79
+ ```text
80
+ outpainted-for-image-cropping/
81
+ ├── README.md
82
+ ├── metadata.jsonl
83
+ ├── stats.json
84
+ └── images/
85
+ ├── img_000000.png
86
+ ├── img_000001.png
87
+ └── ...
88
+ ```
89
+
90
+ `metadata.jsonl` 中每一行对应一个样本,例如:
91
+
92
+ ```json
93
+ {
94
+ "file_name": "images/img_000000.png",
95
+ "orig_bbox": [281, 77, 881, 487],
96
+ "composition_tags": ["HORI2"]
97
+ }
98
+ ```
99
+
100
+ ### 字段说明
101
+
102
+ - `file_name`:扩图后图片的相对路径。
103
+ - `orig_bbox`:原图区域在扩图画布中的边界框,格式为 `[x_min, y_min, x_max, y_max]`。
104
+ - `composition_tags`:从原始数据集中解析得到的构图标签列表。若没有可靠的构图标签,则为空列表 `[]`。
105
+
106
+ ## 数据集统计
107
+ 高频构图标签:
108
+
109
+ | 标签 | 数量 |
110
+ |---|---:|
111
+ | HORI2 | 1,956 |
112
+ | HORI3 | 1,694 |
113
+ | DIFFUSE | 1,600 |
114
+ | DENSE | 1,436 |
115
+ | DIA | 1,305 |
116
+ | LINE_VERTI3 | 1,156 |
117
+ | PATTERN | 1,000 |
118
+ | LINE_VERTI_MANY | 983 |
119
+ | POINT_MULTI_HORI | 64 |
120
+ | LINE_VERTI2 | 55 |
121
+
122
+ ## 使用方式
123
+
124
+ 从 Hugging Face Hub 加载:
125
+
126
+ ```python
127
+ from datasets import load_dataset
128
+
129
+ dataset = load_dataset("zzsyppt/outpainted-for-image-cropping")
130
+ print(dataset)
131
+ print(dataset["train"][0])
132
+ ```
133
+
134
+ 本地上传前检查:
135
+
136
+ ```python
137
+ from datasets import load_dataset
138
+
139
+ dataset = load_dataset("imagefolder", data_dir="./hf_dataset")
140
+ print(dataset)
141
+ print(dataset["train"][0])
142
+ ```
143
+
144
+ 预期字段包括:
145
+
146
+ ```text
147
+ image
148
+ orig_bbox
149
+ composition_tags
150
+ ```
151
+
152
+ ## 引用
153
+
154
+ 本数据集仅用于个人用途。如果使用本数据集,请根据实际使用的样本来源引用对应上游数据集。
155
+
156
+ ### PICD
157
+
158
+ ```bibtex
159
+ @inproceedings{zhao2025can,
160
+ title={Can Machines Understand Composition? Dataset and Benchmark for Photographic Image Composition Embedding and Understanding},
161
+ author={Zhao, Zhaoran and Lu, Peng and Zhang, Anran and Li, Peipei and Li, Xia and Liu, Xuannan and Hu, Yang and Chen, Shiyi and Wang, Liwei and Guo, Wenhao},
162
+ booktitle={Proceedings of the Computer Vision and Pattern Recognition Conference},
163
+ pages={14411--14421},
164
+ year={2025}
165
+ }
166
+ ```
167
+
168
+ ### LAION-Aesthetics
169
+
170
+ 请参考 LAION 官方页面和对应 Hugging Face 数据集页面引用 LAION-Aesthetics / LAION-5B 相关工作:
171
+
172
+ - https://laion.ai/blog/laion-aesthetics/
173
+ - https://huggingface.co/datasets/laion/aesthetics_v2_4.75
174
+
175
+ ### Landscape-Dataset
176
+
177
+ 请参考原始仓库:
178
+
179
+ - https://github.com/koishi70/Landscape-Dataset/tree/master
180
+
181
+ ## 致谢
182
+
183
+ 本数据集的生成使用了 Stable Diffusion v2 Inpaint,并参考或使用了公开图像数据源。感谢上游数据集、仓库和模型的创建者与维护者。