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
+
|
| 461 |
+
# VG150
|
| 462 |
+
|
| 463 |
+
VG150 是从 [Visual Genome](https://visualgenome.org/) 派生的场景图生成
|
| 464 |
+
(Scene Graph Generation, SGG)基准数据集,包含 150 个对象类别、50 个
|
| 465 |
+
关系谓词类别和 200 个属性类别。图片直接嵌入 Parquet。
|
| 466 |
+
|
| 467 |
+
该数据集适用于场景图生成、场景图检测、视觉关系检测和相关多模态研究。
|
| 468 |
+
|
| 469 |
+
## 数据集规模
|
| 470 |
+
|
| 471 |
+
| Split | 图片数量 | 用途 |
|
| 472 |
+
| --- | ---: | --- |
|
| 473 |
+
| `train` | 57,723 | 模型训练 |
|
| 474 |
+
| `validation` | 5,000 | 验证与模型选择 |
|
| 475 |
+
| `test` | 26,446 | 最终评估 |
|
| 476 |
+
| **总计** | **89,169** | 仅包含同时具有对象和关系标注的图片 |
|
| 477 |
+
|
| 478 |
+
所有 split 均包含完整的对象、属性和关系标注。
|
| 479 |
+
|
| 480 |
+
## 加载
|
| 481 |
+
|
| 482 |
+
```python
|
| 483 |
+
from datasets import load_dataset
|
| 484 |
+
|
| 485 |
+
dataset = load_dataset("wliafe/VG150")
|
| 486 |
+
print(dataset)
|
| 487 |
+
|
| 488 |
+
sample = dataset["train"][0]
|
| 489 |
+
image = sample["image"] # PIL.Image.Image
|
| 490 |
+
image.show()
|
| 491 |
+
```
|
| 492 |
+
|
| 493 |
+
图片字节已经嵌入 Parquet,因此不需要额外下载或拼接 Visual Genome 图片目录。
|
| 494 |
+
`image` 使用 Hugging Face `Image` feature,默认读取时会解码为 Pillow 图像。
|
| 495 |
+
|
| 496 |
+
如需取得类别名称,可以读取 `ClassLabel` feature:
|
| 497 |
+
|
| 498 |
+
```python
|
| 499 |
+
features = dataset["train"].features
|
| 500 |
+
|
| 501 |
+
object_names = features["labels"].feature.names
|
| 502 |
+
predicate_names = features["relations"]["predicate"].feature.names
|
| 503 |
+
attribute_names = features["attributes"].feature.feature.names
|
| 504 |
+
|
| 505 |
+
sample = dataset["train"][0]
|
| 506 |
+
object_labels = [object_names[index] for index in sample["labels"]]
|
| 507 |
+
predicate_labels = [
|
| 508 |
+
predicate_names[index]
|
| 509 |
+
for index in sample["relations"]["predicate"]
|
| 510 |
+
]
|
| 511 |
+
attribute_labels = [
|
| 512 |
+
[attribute_names[index] for index in object_attributes]
|
| 513 |
+
for object_attributes in sample["attributes"]
|
| 514 |
+
]
|
| 515 |
+
```
|
| 516 |
+
|
| 517 |
+
## 数据字段
|
| 518 |
+
|
| 519 |
+
| 字段 | 类型 | 说明 |
|
| 520 |
+
| --- | --- | --- |
|
| 521 |
+
| `id` | `string` | Visual Genome 图片 ID |
|
| 522 |
+
| `image` | `Image` | 嵌入 Parquet 并可直接解码的图片 |
|
| 523 |
+
| `width` | `int32` | 实际 JPEG 宽度,单位为像素 |
|
| 524 |
+
| `height` | `int32` | 实际 JPEG 高度,单位为像素 |
|
| 525 |
+
| `boxes` | `List[[float32; 4]]` | 与对象平行的 `[x1, y1, x2, y2]` 边界框 |
|
| 526 |
+
| `labels` | `List[ClassLabel]` | 与 `boxes` 平行的对象类别 |
|
| 527 |
+
| `attributes` | `List[List[ClassLabel]]` | 每个对象对应的零个或多个属性 |
|
| 528 |
+
| `relations.subject_index` | `List[int64]` | 每条关系的主语对象索引 |
|
| 529 |
+
| `relations.object_index` | `List[int64]` | 每条关系的宾语对象索引 |
|
| 530 |
+
| `relations.predicate` | `List[ClassLabel]` | 每条关系的谓词类别 |
|
| 531 |
+
|
| 532 |
+
`boxes`、`labels` 和 `attributes` 的外层长度相同。三个关系数组也具有相同
|
| 533 |
+
长度;相同位置的主语索引、宾语索引和谓词共同构成一条有向关系:
|
| 534 |
+
|
| 535 |
+
```python
|
| 536 |
+
sample = dataset["train"][0]
|
| 537 |
+
|
| 538 |
+
for subject, object_, predicate in zip(
|
| 539 |
+
sample["relations"]["subject_index"],
|
| 540 |
+
sample["relations"]["object_index"],
|
| 541 |
+
sample["relations"]["predicate"],
|
| 542 |
+
):
|
| 543 |
+
print(
|
| 544 |
+
object_names[sample["labels"][subject]],
|
| 545 |
+
predicate_names[predicate],
|
| 546 |
+
object_names[sample["labels"][object_]],
|
| 547 |
+
)
|
| 548 |
+
```
|
| 549 |
+
|
| 550 |
+
## 类别编号
|
| 551 |
+
|
| 552 |
+
对象、谓词和属性 taxonomy 均在索引 `0` 保留 `__background__`:
|
| 553 |
+
|
| 554 |
+
- 对象前景类别编号为 `1`–`150`。
|
| 555 |
+
- 谓词前景类别编号为 `1`–`50`。
|
| 556 |
+
- 属性前景类别编号为 `1`–`200`。
|
| 557 |
+
|
| 558 |
+
没有属性的对象对应空列表,而不是包含 `__background__` 的列表。
|
| 559 |
+
|
| 560 |
+
## 边界框与图片尺寸
|
| 561 |
+
|
| 562 |
+
`boxes` 使用实际图片像素坐标下的 `[x1, y1, x2, y2]` 格式,坐标位于图片
|
| 563 |
+
边界内。`width` 和 `height` 与 `image` 的实际尺寸一致。关系端点使用当前样本
|
| 564 |
+
对象数组中的零基索引。
|
| 565 |
+
|
| 566 |
+
本仓库提供可直接加载的 Parquet 数据,不包含原始 H5 或 JSON 文件。对象、关系和
|
| 567 |
+
属性标注可能继承 Visual Genome 中的类别偏差、长尾分布、歧义和错误。
|
| 568 |
+
|
| 569 |
+
## 使用限制
|
| 570 |
+
|
| 571 |
+
- VG150 只保留高频类别,不能代表 Visual Genome 的完整开放词汇分布。
|
| 572 |
+
- 关系类别分布高度不均衡,模型结果可能被少数高频谓词主导。
|
| 573 |
+
- `boxes` 是对象边界框,不是实例分割轮廓。
|
| 574 |
+
- 本仓库不重新授予原始图片版权。使用者应同时遵守 Visual Genome 的使用条款,
|
| 575 |
+
并确认原始图片适用于自己的研究或发布场景。
|
| 576 |
+
- 比较论文结果时,应确认对方使用相同的 VG150 taxonomy、过滤规则和 split。
|
| 577 |
+
|
| 578 |
+
## 引用
|
| 579 |
+
|
| 580 |
+
使用本数据集时,请引用 Visual Genome:
|
| 581 |
+
|
| 582 |
+
```bibtex
|
| 583 |
+
@article{krishna2017visual,
|
| 584 |
+
title={Visual Genome: Connecting Language and Vision Using Crowdsourced Dense Image Annotations},
|
| 585 |
+
author={Krishna, Ranjay and Zhu, Yuke and Groth, Oliver and Johnson, Justin and
|
| 586 |
+
Hata, Kenji and Kravitz, Joshua and Chen, Stephanie and
|
| 587 |
+
Kalantidis, Yannis and Li, Li-Jia and Shamma, David A. and
|
| 588 |
+
Bernstein, Michael S. and Fei-Fei, Li},
|
| 589 |
+
journal={International Journal of Computer Vision},
|
| 590 |
+
volume={123},
|
| 591 |
+
number={1},
|
| 592 |
+
pages={32--73},
|
| 593 |
+
year={2017}
|
| 594 |
+
}
|
| 595 |
+
```
|
| 596 |
+
|
| 597 |
+
标准 VG150 场景图划分也常用于 Neural Motifs:
|
| 598 |
+
|
| 599 |
+
```bibtex
|
| 600 |
+
@inproceedings{zellers2018neural,
|
| 601 |
+
title={Neural Motifs: Scene Graph Parsing with Global Context},
|
| 602 |
+
author={Zellers, Rowan and Yatskar, Mark and Thomson, Sam and Choi, Yejin},
|
| 603 |
+
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
|
| 604 |
+
year={2018}
|
| 605 |
+
}
|
| 606 |
+
```
|