--- pretty_name: Outpainted for Image Cropping license: other license_name: research-only task_categories: - image-to-image - object-detection tags: - image - computer-vision - image-cropping - bounding-box - outpainting - inpainting - stable-diffusion - composition - imagefolder size_categories: - 10K English | 中文

## 数据集简介 本数据集包含一批通过 **Stable Diffusion v2 Inpaint** 扩图得到的图像,以及每张扩图图像中“原始图像区域”的边界框标注。数据集主要面向图像裁剪、原始画幅恢复、构图感知裁剪和扩图感知视觉理解等研究任务。 每个样本包含: - 一张扩图后的图片; - `orig_bbox`:原图在扩展画布中的位置; - `composition_tags`:图片构图标签列表,部分为空。 ## 数据生成流程 ![image-20260503132555963](./assets/image-20260503132555963.png) 数据生成流程如下: 1. 收集专业摄影图片或高美学评分图片。 2. 获取或生成图像描述,例如使用 BLIP 生成 caption。 3. 设置待扩展边距。 4. 使用 **Stable Diffusion v2 Inpaint** 对扩展区域进行补全。 5. 使用正面提示词约束生成内容。 6. 使用负面提示词减少不希望出现的内容,例如 `frame`、`border`、`text`、`watermark` 等。 7. 对生成结果进行伪影检测、一致性检测。 8. 进行人工核查。 9. 保留通过质量检查的样本,并记录原图区域 bbox,形成 training pairs。 `orig_bbox` 使用如下格式: ```text [x_min, y_min, x_max, y_max] ``` 该 bbox 表示原始图像区域在扩图后画布中的位置,而不是目标检测中的物体框。 ## 数据来源 本数据集的源图像来自或参考以下公开数据集/仓库: 1. **PICD: Photographic Image Composition Dataset** https://github.com/CV-xueba/PICD_ImageComposition 2. **LAION Aesthetics v2 4.75** https://huggingface.co/datasets/laion/aesthetics_v2_4.75 3. **Landscape-Dataset** https://github.com/koishi70/Landscape-Dataset/tree/master ## 数据结构 ```text outpainted-for-image-cropping/ ├── README.md ├── metadata.jsonl ├── stats.json └── images/ ├── img_000000.png ├── img_000001.png └── ... ``` `metadata.jsonl` 中每一行对应一个样本,例如: ```json { "file_name": "images/img_000000.png", "orig_bbox": [281, 77, 881, 487], "composition_tags": ["HORI2"] } ``` ### 字段说明 - `file_name`:扩图后图片的相对路径。 - `orig_bbox`:原图区域在扩图画布中的边界框,格式为 `[x_min, y_min, x_max, y_max]`。 - `composition_tags`:从原始数据集中解析得到的构图标签列表。若没有可靠的构图标签,则为空列表 `[]`。 ## 数据集统计 高频构图标签: | 标签 | 数量 | |---|---:| | HORI2 | 1,956 | | HORI3 | 1,694 | | DIFFUSE | 1,600 | | DENSE | 1,436 | | DIA | 1,305 | | LINE_VERTI3 | 1,156 | | PATTERN | 1,000 | | LINE_VERTI_MANY | 983 | | POINT_MULTI_HORI | 64 | | LINE_VERTI2 | 55 | ## 使用方式 从 Hugging Face Hub 加载: ```python from datasets import load_dataset dataset = load_dataset("zzsyppt/outpainted-for-image-cropping") print(dataset) print(dataset["train"][0]) ``` 本地上传前检查: ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="./hf_dataset") print(dataset) print(dataset["train"][0]) ``` 预期字段包括: ```text image orig_bbox composition_tags ``` ## 引用 本数据集仅用于个人用途。如果使用本数据集,请根据实际使用的样本来源引用对应上游数据集。 ### PICD ```bibtex @inproceedings{zhao2025can, title={Can Machines Understand Composition? Dataset and Benchmark for Photographic Image Composition Embedding and Understanding}, 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}, booktitle={Proceedings of the Computer Vision and Pattern Recognition Conference}, pages={14411--14421}, year={2025} } ``` ### LAION-Aesthetics 请参考 LAION 官方页面和对应 Hugging Face 数据集页面引用 LAION-Aesthetics / LAION-5B 相关工作: - https://laion.ai/blog/laion-aesthetics/ - https://huggingface.co/datasets/laion/aesthetics_v2_4.75 ### Landscape-Dataset 请参考原始仓库: - https://github.com/koishi70/Landscape-Dataset/tree/master ## 致谢 本数据集的生成使用了 Stable Diffusion v2 Inpaint,并参考或使用了公开图像数据源。感谢上游数据集、仓库和模型的创建者与维护者。