Update the STAR dataset description
#1
by wliafe - opened
README.md
CHANGED
|
@@ -174,54 +174,53 @@ dataset_info:
|
|
| 174 |
dataset_size: 39523806
|
| 175 |
---
|
| 176 |
|
| 177 |
-
# STAR
|
| 178 |
|
| 179 |
-
STAR
|
| 180 |
|
| 181 |
-
|
| 182 |
-
- train、validation 和 test 的结构化标注以 Parquet 保存。
|
| 183 |
-
- Dataset 中的 `image` 字段是图片相对于仓库根目录的路径,不包含图片字节,也不会自动解码为 PIL 对象。
|
| 184 |
|
| 185 |
-
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
│ │ └── 0000.png
|
| 195 |
-
│ ├── validation
|
| 196 |
-
│ │ └── 0002.png
|
| 197 |
-
│ └── test
|
| 198 |
-
│ └── 0004.png
|
| 199 |
-
└── data
|
| 200 |
-
├── train-*.parquet
|
| 201 |
-
├── validation-*.parquet
|
| 202 |
-
└── test-*.parquet
|
| 203 |
-
```
|
| 204 |
|
| 205 |
-
|
| 206 |
|
| 207 |
-
##
|
| 208 |
|
| 209 |
-
每行
|
| 210 |
|
| 211 |
-
- `id`:图片
|
| 212 |
- `image`:仓库相对路径,例如 `images/train/0000.png`。
|
| 213 |
-
- `width`、`height`:
|
| 214 |
-
- `
|
| 215 |
-
- `
|
| 216 |
-
- `
|
| 217 |
-
- `
|
| 218 |
-
- `relations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
|
| 220 |
-
|
| 221 |
|
| 222 |
-
|
|
|
|
|
|
|
| 223 |
|
| 224 |
-
|
|
|
|
|
|
|
| 225 |
|
| 226 |
```python
|
| 227 |
from pathlib import Path
|
|
@@ -230,26 +229,22 @@ from datasets import load_dataset
|
|
| 230 |
from huggingface_hub import snapshot_download
|
| 231 |
|
| 232 |
|
| 233 |
-
|
|
|
|
| 234 |
snapshot_download(
|
| 235 |
-
repo_id="wliafe/
|
| 236 |
repo_type="dataset",
|
|
|
|
| 237 |
)
|
| 238 |
)
|
| 239 |
-
dataset = load_dataset("wliafe/
|
| 240 |
|
| 241 |
sample = dataset["train"][0]
|
| 242 |
-
image_path =
|
| 243 |
-
|
| 244 |
-
print(sample["id"])
|
| 245 |
-
print(sample["image"])
|
| 246 |
-
print(image_path)
|
| 247 |
-
assert image_path.is_file()
|
| 248 |
```
|
| 249 |
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
### 使用 Pillow
|
| 253 |
|
| 254 |
```python
|
| 255 |
from PIL import Image
|
|
@@ -260,40 +255,26 @@ with Image.open(image_path) as image:
|
|
| 260 |
print(image.size)
|
| 261 |
```
|
| 262 |
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
```python
|
| 266 |
-
import cv2
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
image = cv2.imread(str(image_path), cv2.IMREAD_UNCHANGED)
|
| 270 |
-
if image is None:
|
| 271 |
-
raise RuntimeError(f"无法读取图片:{image_path}")
|
| 272 |
-
print(image.shape)
|
| 273 |
-
```
|
| 274 |
-
|
| 275 |
-
## 固定数据版本
|
| 276 |
|
| 277 |
-
|
| 278 |
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
from huggingface_hub import snapshot_download
|
| 284 |
|
|
|
|
| 285 |
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
```
|
| 298 |
-
|
| 299 |
-
这样 Parquet 标注与原始图片始终来自同一个仓库版本。
|
|
|
|
| 174 |
dataset_size: 39523806
|
| 175 |
---
|
| 176 |
|
| 177 |
+
# STAR Scene Graph Dataset
|
| 178 |
|
| 179 |
+
STAR(Scene graph generaTion in lArge-size satellite imageRy)是面向大幅高分辨率卫星影像场景图生成的数据集。本仓库依据官方 SGG-ToolKit 发布的 `STAR-SGG-with-attri.h5`、taxonomy 和图片元数据构建。
|
| 180 |
|
| 181 |
+
图片作为仓库普通文件保存在 `images/`,Parquet 中的 `image` 字段是仓库相对路径,不包含图片字节,也不会自动解码为 Pillow 对象。完整仓库约 127 GB,下载前请确认磁盘空间。
|
|
|
|
|
|
|
| 182 |
|
| 183 |
+
## Split
|
| 184 |
|
| 185 |
+
本仓库严格使用 H5 的内部 `split` 标记,并将官方测试标记作为 Hugging Face validation 发布:
|
| 186 |
|
| 187 |
+
| Hugging Face split | H5 标记 | 图片 | 对象 | 关系 |
|
| 188 |
+
| --- | ---: | ---: | ---: | ---: |
|
| 189 |
+
| `train` | `0` | 700 | 123,117 | 214,322 |
|
| 190 |
+
| `validation` | `2` | 573 | 96,003 | 187,044 |
|
| 191 |
+
| **总计** | | **1,273** | **219,120** | **401,366** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
+
仓库不提供 `test` split。`validation` 包含完整对象和关系 ground truth。
|
| 194 |
|
| 195 |
+
## 字段
|
| 196 |
|
| 197 |
+
每行对应一张图片:
|
| 198 |
|
| 199 |
+
- `id`:四位图片 ID。
|
| 200 |
- `image`:仓库相对路径,例如 `images/train/0000.png`。
|
| 201 |
+
- `width`、`height`:图片的实际像素尺寸。
|
| 202 |
+
- `boxes`:与对象平行的 `[x1, y1, x2, y2]` 水平框。
|
| 203 |
+
- `polygons`:与对象平行的四点 polygon,每点为 `[x, y]`。
|
| 204 |
+
- `labels`:对象类别。
|
| 205 |
+
- `attributes`:每个对象对应的 10 个官方属性槽;0 是 padding/background。
|
| 206 |
+
- `relations.subject_index`、`relations.object_index`:关系端点在当前对象数组中的零基索引。
|
| 207 |
+
- `relations.predicate`:关系谓词类别。
|
| 208 |
+
|
| 209 |
+
`boxes`、`polygons`、`labels` 和 `attributes` 长度相同。三个 `relations` 数组也彼此平行。本仓库保留 H5 的所有关系;不会执行训练代码中可选的重复关系随机采样。
|
| 210 |
+
|
| 211 |
+
原始目录中的 1273 个文件均使用 `.png` 扩展名;其中 1179 个实际采用 PNG 编码、94 个实际采用 JPEG 编码。发布过程通过硬链接保留官方源文件字节,不执行转码。
|
| 212 |
+
|
| 213 |
+
## SGG-ToolKit 坐标约定
|
| 214 |
|
| 215 |
+
公开字段遵循官方 SGG-ToolKit 的 H5 读取规则:
|
| 216 |
|
| 217 |
+
- `boxes_2000` 由中心点—宽高转换为角点框后乘以 `6000 / 2000`。
|
| 218 |
+
- `segmentation_2000` 同样乘以 `6000 / 2000`,并保留原始四点顺序。
|
| 219 |
+
- H5 中的全局关系端点已转换成每张图片内部的零基对象索引。
|
| 220 |
|
| 221 |
+
对象、谓词和属性 taxonomy 均在索引 0 保留 `__background__`。H5 的前景标签已经从 1 开始,因此其前景整数编号保持不变。
|
| 222 |
+
|
| 223 |
+
## 下载与读取
|
| 224 |
|
| 225 |
```python
|
| 226 |
from pathlib import Path
|
|
|
|
| 229 |
from huggingface_hub import snapshot_download
|
| 230 |
|
| 231 |
|
| 232 |
+
revision = "main"
|
| 233 |
+
repository = Path(
|
| 234 |
snapshot_download(
|
| 235 |
+
repo_id="wliafe/STAR",
|
| 236 |
repo_type="dataset",
|
| 237 |
+
revision=revision,
|
| 238 |
)
|
| 239 |
)
|
| 240 |
+
dataset = load_dataset("wliafe/STAR", revision=revision)
|
| 241 |
|
| 242 |
sample = dataset["train"][0]
|
| 243 |
+
image_path = repository / sample["image"]
|
| 244 |
+
print(sample["id"], image_path, sample["width"], sample["height"])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
```
|
| 246 |
|
| 247 |
+
使用 Pillow 打开图片:
|
|
|
|
|
|
|
| 248 |
|
| 249 |
```python
|
| 250 |
from PIL import Image
|
|
|
|
| 255 |
print(image.size)
|
| 256 |
```
|
| 257 |
|
| 258 |
+
训练或评测时,`snapshot_download()` 与 `load_dataset()` 应使用同一个完整 commit revision,以保证图片和 Parquet 标注来自同一版本。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
|
| 260 |
+
## 使用限制
|
| 261 |
|
| 262 |
+
- STAR 类别与谓词存在长尾分布。
|
| 263 |
+
- 大尺寸遥感影像需要较多下载空间、内存和 I/O 带宽。
|
| 264 |
+
- 标注可能包含遗漏、歧义或类别噪声。
|
| 265 |
+
- 使用者应遵守 STAR 原始发布方的许可、引用和使用要求。
|
|
|
|
| 266 |
|
| 267 |
+
## 引用
|
| 268 |
|
| 269 |
+
```bibtex
|
| 270 |
+
@article{li2025star,
|
| 271 |
+
title={STAR: A First-Ever Dataset and a Large-Scale Benchmark for Scene Graph Generation in Large-Size Satellite Imagery},
|
| 272 |
+
author={Li, Yansheng and Wang, Linlin and Wang, Tingzhu and others},
|
| 273 |
+
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
|
| 274 |
+
volume={47},
|
| 275 |
+
number={3},
|
| 276 |
+
pages={1832--1849},
|
| 277 |
+
year={2025},
|
| 278 |
+
doi={10.1109/TPAMI.2024.3508072}
|
| 279 |
+
}
|
| 280 |
```
|
|
|
|
|
|