Add OIV6 dataset description
#1
by wliafe - opened
README.md
CHANGED
|
@@ -682,3 +682,109 @@ dataset_info:
|
|
| 682 |
download_size: 40106623995
|
| 683 |
dataset_size: 40101849835
|
| 684 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 682 |
download_size: 40106623995
|
| 683 |
dataset_size: 40101849835
|
| 684 |
---
|
| 685 |
+
|
| 686 |
+
# Open Images V6 Relationships
|
| 687 |
+
|
| 688 |
+
OIV6 是基于 Open Images V6 的视觉关系检测数据集,包含 133,503 张图片、
|
| 689 |
+
601 个对象前景类别和 30 个关系谓词前景类别。图片字节直接嵌入 Parquet,
|
| 690 |
+
可通过 Hugging Face `Image` feature 解码。
|
| 691 |
+
|
| 692 |
+
## 数据集规模
|
| 693 |
+
|
| 694 |
+
| Split | 图片 | 对象 | 关系 |
|
| 695 |
+
| --- | ---: | ---: | ---: |
|
| 696 |
+
| `train` | 126,368 | 512,259 | 348,560 |
|
| 697 |
+
| `validation` | 1,813 | 6,386 | 4,951 |
|
| 698 |
+
| `test` | 5,322 | 19,284 | 14,403 |
|
| 699 |
+
| **总计** | **133,503** | **537,929** | **367,914** |
|
| 700 |
+
|
| 701 |
+
三个 split 互不重叠。每个样本都包含至少一个对象和一条关系。
|
| 702 |
+
|
| 703 |
+
## 加载
|
| 704 |
+
|
| 705 |
+
```python
|
| 706 |
+
from datasets import load_dataset
|
| 707 |
+
|
| 708 |
+
dataset = load_dataset("wliafe/OIV6")
|
| 709 |
+
sample = dataset["train"][0]
|
| 710 |
+
|
| 711 |
+
image = sample["image"] # PIL.Image.Image
|
| 712 |
+
print(sample["id"], image.size)
|
| 713 |
+
```
|
| 714 |
+
|
| 715 |
+
图片已嵌入 Parquet,不需要额外下载或拼接图片目录。
|
| 716 |
+
|
| 717 |
+
## 数据字段
|
| 718 |
+
|
| 719 |
+
| 字段 | 类型 | 说明 |
|
| 720 |
+
| --- | --- | --- |
|
| 721 |
+
| `id` | `string` | Open Images 图片 ID |
|
| 722 |
+
| `image` | `Image` | 可直接解码的嵌入式 JPEG |
|
| 723 |
+
| `width` | `int32` | JPEG 实际宽度,单位为像素 |
|
| 724 |
+
| `height` | `int32` | JPEG 实际高度,单位为像素 |
|
| 725 |
+
| `boxes` | `List[[float32; 4]]` | 与对象平行的 `[x1, y1, x2, y2]` 边界框 |
|
| 726 |
+
| `labels` | `List[ClassLabel]` | 与 `boxes` 平行的对象类别 |
|
| 727 |
+
| `relations.subject_index` | `List[int64]` | 关系主语在当前对象数组中的索引 |
|
| 728 |
+
| `relations.object_index` | `List[int64]` | 关系宾语在当前对象数组中的索引 |
|
| 729 |
+
| `relations.predicate` | `List[ClassLabel]` | 关系谓词类别 |
|
| 730 |
+
|
| 731 |
+
`boxes` 和 `labels` 长度相同。三个关系数组也具有相同长度;相同位置的主语索引、
|
| 732 |
+
宾语索引和谓词共同表示一条有向关系。
|
| 733 |
+
|
| 734 |
+
## 类别与关系名称
|
| 735 |
+
|
| 736 |
+
对象和谓词 taxonomy 均在索引 `0` 保留 `__background__`:
|
| 737 |
+
|
| 738 |
+
- 对象前景类别编号为 `1`–`601`。
|
| 739 |
+
- 谓词前景类别编号为 `1`–`30`。
|
| 740 |
+
- `subject_index` 和 `object_index` 是当前样本对象数组的零基位置,不是类别 ID。
|
| 741 |
+
|
| 742 |
+
```python
|
| 743 |
+
features = dataset["train"].features
|
| 744 |
+
object_names = features["labels"].feature.names
|
| 745 |
+
predicate_names = features["relations"]["predicate"].feature.names
|
| 746 |
+
|
| 747 |
+
sample = dataset["train"][0]
|
| 748 |
+
for subject, object_, predicate in zip(
|
| 749 |
+
sample["relations"]["subject_index"],
|
| 750 |
+
sample["relations"]["object_index"],
|
| 751 |
+
sample["relations"]["predicate"],
|
| 752 |
+
):
|
| 753 |
+
print(
|
| 754 |
+
object_names[sample["labels"][subject]],
|
| 755 |
+
predicate_names[predicate],
|
| 756 |
+
object_names[sample["labels"][object_]],
|
| 757 |
+
)
|
| 758 |
+
```
|
| 759 |
+
|
| 760 |
+
## 坐标约定
|
| 761 |
+
|
| 762 |
+
`boxes` 使用实际图片像素坐标下的 `[x1, y1, x2, y2]` 格式,坐标位于图片
|
| 763 |
+
边界内。`width` 和 `height` 与解码后 `image` 的尺寸一致。边界框表示对象检测
|
| 764 |
+
区域,不是实例分割轮廓。
|
| 765 |
+
|
| 766 |
+
## 使用限制
|
| 767 |
+
|
| 768 |
+
- 对象和关系类别呈长尾分布,模型结果可能被高频类别主导。
|
| 769 |
+
- 标注可能包含遗漏、歧义或类别噪声。
|
| 770 |
+
- 本仓库不重新授予原始图片版权;使用者应遵守 Open Images 的许可与使用要求。
|
| 771 |
+
- 比较模型结果时,应确认使用相同的 taxonomy、background 编号和 split。
|
| 772 |
+
|
| 773 |
+
## 引用
|
| 774 |
+
|
| 775 |
+
使用本数据集时,请引用 Open Images:
|
| 776 |
+
|
| 777 |
+
```bibtex
|
| 778 |
+
@article{kuznetsova2020open,
|
| 779 |
+
title={The Open Images Dataset V4: Unified Image Classification,
|
| 780 |
+
Object Detection, and Visual Relationship Detection at Scale},
|
| 781 |
+
author={Kuznetsova, Alina and Rom, Hassan and Alldrin, Neil and
|
| 782 |
+
Uijlings, Jasper and Krasin, Ivan and Pont-Tuset, Jordi and
|
| 783 |
+
Kamali, Shahab and Popov, Stefan and Malloci, Matteo and
|
| 784 |
+
Kolesnikov, Alexander and Duerig, Tom and Ferrari, Vittorio},
|
| 785 |
+
journal={International Journal of Computer Vision},
|
| 786 |
+
volume={128},
|
| 787 |
+
pages={1956--1981},
|
| 788 |
+
year={2020}
|
| 789 |
+
}
|
| 790 |
+
```
|