ISubGVQA.datasets.scene_graph
Classes
A class to handle GQA Scene Graphs for Visual Question Answering (VQA). |
Module Contents
- class ISubGVQA.datasets.scene_graph.GQASceneGraphs
A class to handle GQA Scene Graphs for Visual Question Answering (VQA). Attributes: ———– tokenizer : spacy.tokenizer
Tokenizer for processing text data.
- vocab_sgtorchtext.vocab.Vocab
Vocabulary for scene graph encoding.
- vectorstorch.Tensor
Pre-trained GloVe vectors for the vocabulary.
- scene_graphs_traindict
Scene graphs for the training set.
- scene_graphs_validdict
Scene graphs for the validation set.
- scene_graphs_testdevdict
Scene graphs for the test development set.
- scene_graphsdict
Combined scene graphs from training, validation, and test development sets.
- rel_mappingdict
Mapping for relationships.
- obj_mappingdict
Mapping for objects.
- attr_mappingdict
Mapping for attributes.
Methods:
- __init__():
Initializes the GQASceneGraphs object, builds the vocabulary, and loads scene graphs.
- query_and_translate(queryID: str):
Queries and translates a scene graph based on the given query ID.
- build_scene_graph_encoding_vocab():
Builds the vocabulary for scene graph encoding using pre-defined text lists and GloVe vectors.
- convert_one_gqa_scene_graph(sg_this: dict):
Converts a single GQA scene graph into a PyTorch Geometric data format.
- tokenizer
- scene_graphs_train
- scene_graphs_valid
- scene_graphs_testdev
- scene_graphs
- rel_mapping
- obj_mapping
- attr_mapping
- query_and_translate(queryID: str)
- build_scene_graph_encoding_vocab()
- convert_one_gqa_scene_graph(sg_this)