Deva8 commited on
Commit
46123eb
·
verified ·
1 Parent(s): fda2f27

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +96 -62
README.md CHANGED
@@ -1,39 +1,19 @@
1
-
2
  ---
3
  license: mit
4
  task_categories:
5
- - visual-question-answering
6
  tags:
7
- - generative-vqa
8
- - multimodal
9
- - vqa-v2
10
  pretty_name: Generative-VQA-V2 (Curated)
11
  size_categories:
12
- - 100K<n<1M
13
- configs:
14
- - config_name: default
15
- data_files:
16
- - split: train
17
- path:
18
- - "main_metadata.csv"
19
- - "gen_vqa_v2-images.zip"
20
- dataset_info:
21
- features:
22
- - name: image_id
23
- dtype: int64
24
- - name: question_id
25
- dtype: int64
26
- - name: question
27
- dtype: string
28
- - name: answer
29
- dtype: string
30
- - name: file_name
31
- dtype: image
32
  ---
33
 
34
  # Generative-VQA-V2-Curated
35
 
36
- A curated, balanced, and cleaned version of the VQA v2 dataset specifically optimized for **Generative Visual Question Answering**.
37
 
38
  This dataset transforms the standard VQA task into a generative challenge by removing "yes/no" shortcuts and balancing answer distributions to prevent model over-fitting on dominant classes.
39
 
@@ -41,75 +21,129 @@ This dataset transforms the standard VQA task into a generative challenge by rem
41
 
42
  The primary goal of this curated set is to provide a "clean" signal for training multimodal models by:
43
 
44
- 1. **Eliminating Binary Biases:** Removed all "yes/no" and "unknown" style answers.
45
- 2. **Balancing Classes:** Capped samples at **600 per answer** to ensure the model learns a diverse vocabulary.
46
- 3. **Filtering Ambiguity:** Removed generic questions (e.g., "What is this?") to focus on specific visual grounding.
47
 
48
  ## Dataset Statistics
49
 
50
- * **Total QA Pairs:** 135,268
51
- * **Unique Answer Classes:** 1,251
52
- * **Source Images:** COCO Train 2014
53
- * **Minimum Frequency per Answer:** 20
54
- * **Maximum Samples per Answer:** 600
55
 
56
  ## Curation Logic
57
 
58
  The dataset was generated using the following filtering pipeline:
59
 
60
- * **Consensus-Based:** Only the majority-vote answer from the 10 human annotators is used.
61
- * **Exclusion List:** * Boolean: `yes`, `no`
62
- * Uncertainty: `unknown`, `none`, `n/a`, `cant tell`, `not sure`
63
-
 
 
64
 
65
- * **Ambiguity Filter:** Removed questions containing "what is in the image", "what is this", "what is that", or "what do you see".
66
- * **Conciseness:** Answers are restricted to **5 words** and **30 characters** or fewer.
67
 
68
- ## Structure
69
-
70
- ```text
71
  .
72
- ├── images/ # Curated COCO images (JPG)
73
- ├── qa_pairs.json # Full metadata (JSON)
74
- ── metadata.csv # Metadata (CSV) for easy loading
 
 
 
75
  └── README.md
76
-
77
  ```
78
 
79
- ### Metadata Fields
 
 
 
 
 
 
80
 
81
- * `image_id`: Original COCO Image ID.
82
- * `question_id`: Original VQA v2 Question ID.
83
- * `question`: The natural language question.
84
- * `answer`: The curated ground-truth answer.
85
- * `image_path`: Path relative to the dataset root.
86
 
87
- ## Usage
88
 
89
- ### Loading with Hugging Face `datasets`
90
 
91
  ```python
92
  from datasets import load_dataset
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
- dataset = load_dataset("Deva8/Generative-VQA-V2-Curated")
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  ```
97
 
98
- ### Quick Look (Pandas)
99
 
100
  ```python
101
  import pandas as pd
102
- df = pd.read_csv("metadata.csv")
103
- print(df['answer'].value_counts().head(10)) # Check balancing
104
 
 
 
105
  ```
106
 
 
 
 
 
107
  ## License & Attribution
108
 
109
- This dataset is a derivative work of the **VQA v2 Dataset** and the **COCO Dataset**.
110
 
111
- * **Images:** [COCO Consortium (CC BY 4.0)](https://www.google.com/search?q=https://cocodataset.org/%23termsofuse)
112
- * **Annotations:** [VQA v2 (CC BY 4.0)](https://visualqa.org/download.html)
113
 
114
  ## Citation
115
 
 
 
1
  ---
2
  license: mit
3
  task_categories:
4
+ - visual-question-answering
5
  tags:
6
+ - generative-vqa
7
+ - multimodal
8
+ - vqa-v2
9
  pretty_name: Generative-VQA-V2 (Curated)
10
  size_categories:
11
+ - 100K<n<1M
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
14
  # Generative-VQA-V2-Curated
15
 
16
+ A curated, balanced, and cleaned version of the VQA v2 dataset specifically optimized for Generative Visual Question Answering.
17
 
18
  This dataset transforms the standard VQA task into a generative challenge by removing "yes/no" shortcuts and balancing answer distributions to prevent model over-fitting on dominant classes.
19
 
 
21
 
22
  The primary goal of this curated set is to provide a "clean" signal for training multimodal models by:
23
 
24
+ - **Eliminating Binary Biases**: Removed all "yes/no" and "unknown" style answers.
25
+ - **Balancing Classes**: Capped samples at 600 per answer to ensure the model learns a diverse vocabulary.
26
+ - **Filtering Ambiguity**: Removed generic questions (e.g., "What is this?") to focus on specific visual grounding.
27
 
28
  ## Dataset Statistics
29
 
30
+ - **Total QA Pairs**: 135,268
31
+ - **Unique Answer Classes**: 1,251
32
+ - **Source Images**: COCO Train 2014
33
+ - **Minimum Frequency per Answer**: 20
34
+ - **Maximum Samples per Answer**: 600
35
 
36
  ## Curation Logic
37
 
38
  The dataset was generated using the following filtering pipeline:
39
 
40
+ 1. **Consensus-Based**: Only the majority-vote answer from the 10 human annotators is used.
41
+ 2. **Exclusion List**:
42
+ - Boolean: yes, no
43
+ - Uncertainty: unknown, none, n/a, cant tell, not sure
44
+ 3. **Ambiguity Filter**: Removed questions containing "what is in the image", "what is this", "what is that", or "what do you see".
45
+ 4. **Conciseness**: Answers are restricted to 5 words and 30 characters or fewer.
46
 
47
+ ## Repository Structure
 
48
 
49
+ ```
 
 
50
  .
51
+ ├── main_metadata.csv # Metadata (CSV) for loading
52
+ ├── gen_vqa_v2-images.zip # ZIP containing images and additional files
53
+ │ └── gen_vqa_v22/
54
+ │ ├── images/ # 135k+ COCO images (JPG)
55
+ │ ├── metadata.csv # Original metadata (not used by dataset loader)
56
+ │ └── qa_pairs.json # Full QA pairs with all annotations
57
  └── README.md
 
58
  ```
59
 
60
+ ## Metadata Fields
61
+
62
+ - `image_id`: Original COCO Image ID.
63
+ - `question_id`: Original VQA v2 Question ID.
64
+ - `question`: The natural language question.
65
+ - `answer`: The curated ground-truth answer.
66
+ - `file_name`: Path to image relative to extracted zip root.
67
 
68
+ ## Usage
 
 
 
 
69
 
70
+ ### Method 1: Load with Manual Extraction (Recommended for Dataset Viewer)
71
 
72
+ Since the dataset uses a zip file for images, you'll need to manually extract it first:
73
 
74
  ```python
75
  from datasets import load_dataset
76
+ from huggingface_hub import hf_hub_download
77
+ import zipfile
78
+ import os
79
+
80
+ # Download the zip file
81
+ zip_path = hf_hub_download(
82
+ repo_id="Deva8/Generative-VQA-V2-Curated",
83
+ filename="gen_vqa_v2-images.zip",
84
+ repo_type="dataset"
85
+ )
86
+
87
+ # Extract it
88
+ extract_dir = "./gen_vqa_data"
89
+ with zipfile.ZipFile(zip_path, 'r') as zip_ref:
90
+ zip_ref.extractall(extract_dir)
91
+
92
+ # Now load the dataset
93
+ dataset = load_dataset(
94
+ "Deva8/Generative-VQA-V2-Curated",
95
+ data_files="main_metadata.csv"
96
+ )
97
+
98
+ # The dataset loader will now be able to find the images
99
+ for item in dataset['train']:
100
+ print(f"Q: {item['question']}")
101
+ print(f"A: {item['answer']}")
102
+ # Note: You'll need to manually load images using the file_name path
103
+ ```
104
 
105
+ ### Method 2: Direct CSV Loading
106
 
107
+ ```python
108
+ import pandas as pd
109
+ from PIL import Image
110
+ import os
111
+
112
+ # Load metadata
113
+ df = pd.read_csv("hf://datasets/Deva8/Generative-VQA-V2-Curated/main_metadata.csv")
114
+
115
+ # After extracting gen_vqa_v2-images.zip to a local directory
116
+ base_path = "./gen_vqa_data"
117
+
118
+ # Load an example
119
+ row = df.iloc[0]
120
+ img_path = os.path.join(base_path, row['file_name'])
121
+ img = Image.open(img_path)
122
+
123
+ print(f"Question: {row['question']}")
124
+ print(f"Answer: {row['answer']}")
125
+ img.show()
126
  ```
127
 
128
+ ### Check Answer Distribution
129
 
130
  ```python
131
  import pandas as pd
 
 
132
 
133
+ df = pd.read_csv("hf://datasets/Deva8/Generative-VQA-V2-Curated/main_metadata.csv")
134
+ print(df['answer'].value_counts().head(10)) # Top 10 most common answers
135
  ```
136
 
137
+ ## Known Limitations
138
+
139
+ **Dataset Viewer**: The HuggingFace dataset viewer may not work automatically because images are stored in a separate zip file. Users should manually extract the zip and load images programmatically as shown above.
140
+
141
  ## License & Attribution
142
 
143
+ This dataset is a derivative work of the VQA v2 Dataset and the COCO Dataset.
144
 
145
+ - **Images**: COCO Consortium (CC BY 4.0)
146
+ - **Annotations**: VQA v2 (CC BY 4.0)
147
 
148
  ## Citation
149