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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
---
dataset_info:
  features:
  - name: id
    dtype: string
  - name: image
    dtype: image
  - name: width
    dtype: int32
  - name: height
    dtype: int32
  - name: boxes
    list:
      list: float32
      length: 4
  - name: labels
    list:
      class_label:
        names:
          '0': __background__
          '1': airplane
          '2': animal
          '3': arm
          '4': bag
          '5': banana
          '6': basket
          '7': beach
          '8': bear
          '9': bed
          '10': bench
          '11': bike
          '12': bird
          '13': board
          '14': boat
          '15': book
          '16': boot
          '17': bottle
          '18': bowl
          '19': box
          '20': boy
          '21': branch
          '22': building
          '23': bus
          '24': cabinet
          '25': cap
          '26': car
          '27': cat
          '28': chair
          '29': child
          '30': clock
          '31': coat
          '32': counter
          '33': cow
          '34': cup
          '35': curtain
          '36': desk
          '37': dog
          '38': door
          '39': drawer
          '40': ear
          '41': elephant
          '42': engine
          '43': eye
          '44': face
          '45': fence
          '46': finger
          '47': flag
          '48': flower
          '49': food
          '50': fork
          '51': fruit
          '52': giraffe
          '53': girl
          '54': glass
          '55': glove
          '56': guy
          '57': hair
          '58': hand
          '59': handle
          '60': hat
          '61': head
          '62': helmet
          '63': hill
          '64': horse
          '65': house
          '66': jacket
          '67': jean
          '68': kid
          '69': kite
          '70': lady
          '71': lamp
          '72': laptop
          '73': leaf
          '74': leg
          '75': letter
          '76': light
          '77': logo
          '78': man
          '79': men
          '80': motorcycle
          '81': mountain
          '82': mouth
          '83': neck
          '84': nose
          '85': number
          '86': orange
          '87': pant
          '88': paper
          '89': paw
          '90': people
          '91': person
          '92': phone
          '93': pillow
          '94': pizza
          '95': plane
          '96': plant
          '97': plate
          '98': player
          '99': pole
          '100': post
          '101': pot
          '102': racket
          '103': railing
          '104': rock
          '105': roof
          '106': room
          '107': screen
          '108': seat
          '109': sheep
          '110': shelf
          '111': shirt
          '112': shoe
          '113': short
          '114': sidewalk
          '115': sign
          '116': sink
          '117': skateboard
          '118': ski
          '119': skier
          '120': sneaker
          '121': snow
          '122': sock
          '123': stand
          '124': street
          '125': surfboard
          '126': table
          '127': tail
          '128': tie
          '129': tile
          '130': tire
          '131': toilet
          '132': towel
          '133': tower
          '134': track
          '135': train
          '136': tree
          '137': truck
          '138': trunk
          '139': umbrella
          '140': vase
          '141': vegetable
          '142': vehicle
          '143': wave
          '144': wheel
          '145': window
          '146': windshield
          '147': wing
          '148': wire
          '149': woman
          '150': zebra
  - name: attributes
    list:
      list:
        class_label:
          names:
            '0': __background__
            '1': white
            '2': black
            '3': blue
            '4': green
            '5': red
            '6': brown
            '7': yellow
            '8': small
            '9': large
            '10': wooden
            '11': silver
            '12': orange
            '13': grey
            '14': tall
            '15': long
            '16': dark
            '17': pink
            '18': standing
            '19': round
            '20': tan
            '21': glass
            '22': here
            '23': wood
            '24': open
            '25': purple
            '26': short
            '27': plastic
            '28': parked
            '29': sitting
            '30': walking
            '31': striped
            '32': brick
            '33': young
            '34': gold
            '35': old
            '36': hanging
            '37': empty
            '38': 'on'
            '39': bright
            '40': concrete
            '41': cloudy
            '42': colorful
            '43': one
            '44': beige
            '45': bare
            '46': wet
            '47': light
            '48': square
            '49': closed
            '50': stone
            '51': shiny
            '52': thin
            '53': dirty
            '54': flying
            '55': smiling
            '56': painted
            '57': thick
            '58': part
            '59': sliced
            '60': playing
            '61': tennis
            '62': calm
            '63': leather
            '64': distant
            '65': rectangular
            '66': looking
            '67': grassy
            '68': dry
            '69': cement
            '70': leafy
            '71': wearing
            '72': tiled
            '73': man's
            '74': baseball
            '75': cooked
            '76': pictured
            '77': curved
            '78': decorative
            '79': dead
            '80': eating
            '81': paper
            '82': paved
            '83': fluffy
            '84': lit
            '85': back
            '86': framed
            '87': plaid
            '88': dirt
            '89': watching
            '90': colored
            '91': stuffed
            '92': clean
            '93': in the picture
            '94': steel
            '95': stacked
            '96': covered
            '97': full
            '98': three
            '99': street
            '100': flat
            '101': baby
            '102': black and white
            '103': beautiful
            '104': ceramic
            '105': present
            '106': grazing
            '107': sandy
            '108': golden
            '109': blurry
            '110': side
            '111': chocolate
            '112': wide
            '113': growing
            '114': chrome
            '115': cut
            '116': bent
            '117': train
            '118': holding
            '119': water
            '120': up
            '121': arched
            '122': metallic
            '123': spotted
            '124': folded
            '125': electrical
            '126': pointy
            '127': running
            '128': leafless
            '129': electric
            '130': in background
            '131': rusty
            '132': furry
            '133': traffic
            '134': ripe
            '135': behind
            '136': laying
            '137': rocky
            '138': tiny
            '139': down
            '140': fresh
            '141': floral
            '142': stainless steel
            '143': high
            '144': surfing
            '145': close
            '146': 'off'
            '147': leaning
            '148': moving
            '149': multicolored
            '150': woman's
            '151': pair
            '152': huge
            '153': some
            '154': background
            '155': chain link
            '156': checkered
            '157': top
            '158': tree
            '159': broken
            '160': maroon
            '161': iron
            '162': worn
            '163': patterned
            '164': ski
            '165': overcast
            '166': waiting
            '167': rubber
            '168': riding
            '169': skinny
            '170': grass
            '171': porcelain
            '172': adult
            '173': wire
            '174': cloudless
            '175': curly
            '176': cardboard
            '177': jumping
            '178': tile
            '179': pointed
            '180': blond
            '181': cream
            '182': four
            '183': male
            '184': smooth
            '185': hazy
            '186': computer
            '187': older
            '188': pine
            '189': raised
            '190': many
            '191': bald
            '192': snow covered
            '193': skateboarding
            '194': narrow
            '195': reflective
            '196': rear
            '197': khaki
            '198': extended
            '199': roman
            '200': american
  - name: relations
    struct:
    - name: subject_index
      list: int64
    - name: object_index
      list: int64
    - name: predicate
      list:
        class_label:
          names:
            '0': __background__
            '1': above
            '2': across
            '3': against
            '4': along
            '5': and
            '6': at
            '7': attached to
            '8': behind
            '9': belonging to
            '10': between
            '11': carrying
            '12': covered in
            '13': covering
            '14': eating
            '15': flying in
            '16': for
            '17': from
            '18': growing on
            '19': hanging from
            '20': has
            '21': holding
            '22': in
            '23': in front of
            '24': laying on
            '25': looking at
            '26': lying on
            '27': made of
            '28': mounted on
            '29': near
            '30': of
            '31': 'on'
            '32': on back of
            '33': over
            '34': painted on
            '35': parked on
            '36': part of
            '37': playing
            '38': riding
            '39': says
            '40': sitting on
            '41': standing on
            '42': to
            '43': under
            '44': using
            '45': walking in
            '46': walking on
            '47': watching
            '48': wearing
            '49': wears
            '50': with
  splits:
  - name: train
    num_bytes: 8372499067
    num_examples: 57723
  - name: validation
    num_bytes: 782338184
    num_examples: 5000
  - name: test
    num_bytes: 3501331914
    num_examples: 26446
  download_size: 12653741212
  dataset_size: 12656169165
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: validation
    path: data/validation-*
  - split: test
    path: data/test-*
---

# VG150

VG150 是从 [Visual Genome](https://visualgenome.org/) 派生的场景图生成
(Scene Graph Generation, SGG)基准数据集,包含 150 个对象类别、50 个
关系谓词类别和 200 个属性类别。图片直接嵌入 Parquet。

该数据集适用于场景图生成、场景图检测、视觉关系检测和相关多模态研究。

## 数据集规模

| Split | 图片数量 | 用途 |
| --- | ---: | --- |
| `train` | 57,723 | 模型训练 |
| `validation` | 5,000 | 验证与模型选择 |
| `test` | 26,446 | 最终评估 |
| **总计** | **89,169** | 仅包含同时具有对象和关系标注的图片 |

所有 split 均包含完整的对象、属性和关系标注。

## 加载

```python
from datasets import load_dataset

dataset = load_dataset("wliafe/VG150")
print(dataset)

sample = dataset["train"][0]
image = sample["image"]  # PIL.Image.Image
image.show()
```

图片字节已经嵌入 Parquet,因此不需要额外下载或拼接 Visual Genome 图片目录。
`image` 使用 Hugging Face `Image` feature,默认读取时会解码为 Pillow 图像。

如需取得类别名称,可以读取 `ClassLabel` feature:

```python
features = dataset["train"].features

object_names = features["labels"].feature.names
predicate_names = features["relations"]["predicate"].feature.names
attribute_names = features["attributes"].feature.feature.names

sample = dataset["train"][0]
object_labels = [object_names[index] for index in sample["labels"]]
predicate_labels = [
    predicate_names[index]
    for index in sample["relations"]["predicate"]
]
attribute_labels = [
    [attribute_names[index] for index in object_attributes]
    for object_attributes in sample["attributes"]
]
```

## 数据字段

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `id` | `string` | Visual Genome 图片 ID |
| `image` | `Image` | 嵌入 Parquet 并可直接解码的图片 |
| `width` | `int32` | 实际 JPEG 宽度,单位为像素 |
| `height` | `int32` | 实际 JPEG 高度,单位为像素 |
| `boxes` | `List[[float32; 4]]` | 与对象平行的 `[x1, y1, x2, y2]` 边界框 |
| `labels` | `List[ClassLabel]` | 与 `boxes` 平行的对象类别 |
| `attributes` | `List[List[ClassLabel]]` | 每个对象对应的零个或多个属性 |
| `relations.subject_index` | `List[int64]` | 每条关系的主语对象索引 |
| `relations.object_index` | `List[int64]` | 每条关系的宾语对象索引 |
| `relations.predicate` | `List[ClassLabel]` | 每条关系的谓词类别 |

`boxes``labels``attributes` 的外层长度相同。三个关系数组也具有相同
长度;相同位置的主语索引、宾语索引和谓词共同构成一条有向关系:

```python
sample = dataset["train"][0]

for subject, object_, predicate in zip(
    sample["relations"]["subject_index"],
    sample["relations"]["object_index"],
    sample["relations"]["predicate"],
):
    print(
        object_names[sample["labels"][subject]],
        predicate_names[predicate],
        object_names[sample["labels"][object_]],
    )
```

## 类别编号

对象、谓词和属性 taxonomy 均在索引 `0` 保留 `__background__`- 对象前景类别编号为 `1``150`- 谓词前景类别编号为 `1``50`- 属性前景类别编号为 `1``200`。

没有属性的对象对应空列表,而不是包含 `__background__` 的列表。

## 边界框与图片尺寸

`boxes` 使用实际图片像素坐标下的 `[x1, y1, x2, y2]` 格式,坐标位于图片
边界内。`width``height``image` 的实际尺寸一致。关系端点使用当前样本
对象数组中的零基索引。

本仓库提供可直接加载的 Parquet 数据,不包含原始 H5 或 JSON 文件。对象、关系和
属性标注可能继承 Visual Genome 中的类别偏差、长尾分布、歧义和错误。

## 使用限制

- VG150 只保留高频类别,不能代表 Visual Genome 的完整开放词汇分布。
- 关系类别分布高度不均衡,模型结果可能被少数高频谓词主导。
- `boxes` 是对象边界框,不是实例分割轮廓。
- 本仓库不重新授予原始图片版权。使用者应同时遵守 Visual Genome 的使用条款,
  并确认原始图片适用于自己的研究或发布场景。
- 比较论文结果时,应确认对方使用相同的 VG150 taxonomy、过滤规则和 split。

## 引用

使用本数据集时,请引用 Visual Genome:

```bibtex
@article{krishna2017visual,
  title={Visual Genome: Connecting Language and Vision Using Crowdsourced Dense Image Annotations},
  author={Krishna, Ranjay and Zhu, Yuke and Groth, Oliver and Johnson, Justin and
          Hata, Kenji and Kravitz, Joshua and Chen, Stephanie and
          Kalantidis, Yannis and Li, Li-Jia and Shamma, David A. and
          Bernstein, Michael S. and Fei-Fei, Li},
  journal={International Journal of Computer Vision},
  volume={123},
  number={1},
  pages={32--73},
  year={2017}
}
```

标准 VG150 场景图划分也常用于 Neural Motifs:

```bibtex
@inproceedings{zellers2018neural,
  title={Neural Motifs: Scene Graph Parsing with Global Context},
  author={Zellers, Rowan and Yatskar, Mark and Thomson, Sam and Choi, Yejin},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  year={2018}
}
```