--- 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} } ```