Spaces:
Runtime error
Runtime error
gchhablani
commited on
Commit
·
546443e
1
Parent(s):
a7e5eb4
Add VQA Examples
Browse files- apps/article.py +202 -0
- sections/examples/bathroom.jpeg +0 -0
- sections/examples/bear.jpeg +0 -0
- sections/examples/bench.jpeg +0 -0
- sections/examples/candle_count.jpeg +0 -0
- sections/examples/car_color.jpeg +0 -0
- sections/examples/cat_color.jpeg +0 -0
- sections/examples/clock.jpeg +0 -0
- sections/examples/coat_color.jpeg +0 -0
- sections/examples/commuter_train.jpeg +0 -0
- sections/examples/decorated_building.jpeg +0 -0
- sections/examples/elephants.jpeg +0 -0
- sections/examples/examples.md +0 -0
- sections/examples/giraffe_eyes.jpeg +0 -0
- sections/examples/giraffe_zebra.jpeg +0 -0
- sections/examples/inside_outside.jpeg +0 -0
- sections/examples/is_in_a_restaurant.jpeg +0 -0
- sections/examples/men_body_suits.jpeg +0 -0
- sections/examples/men_happy.jpeg +0 -0
- sections/examples/men_riding_horses.jpeg +0 -0
- sections/examples/people_picture.jpeg +0 -0
- sections/examples/teddy.jpeg +0 -0
- sections/examples/tennis.jpeg +0 -0
- sections/examples/truck_color.jpeg +0 -0
- sections/examples/vase.jpeg +0 -0
- sections/examples/winter.jpeg +0 -0
apps/article.py
CHANGED
@@ -66,4 +66,206 @@ def app(state=None):
|
|
66 |
|
67 |
toc.header("Acknowledgements")
|
68 |
st.write(read_markdown("acknowledgements.md"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
toc.generate()
|
|
|
66 |
|
67 |
toc.header("Acknowledgements")
|
68 |
st.write(read_markdown("acknowledgements.md"))
|
69 |
+
|
70 |
+
toc.header("VQA Examples")
|
71 |
+
toc.subheader("Color Questions")
|
72 |
+
col1, col2, col3 = st.beta_columns([1,1,1])
|
73 |
+
|
74 |
+
col1.image("./sections/examples/men_riding_horses.jpeg", use_column_width="auto", width=300)
|
75 |
+
col1.write("**Custom Question**: What color are the horses?")
|
76 |
+
col1.write("**Predicted Answer**: brown✅")
|
77 |
+
|
78 |
+
col2.image("./sections/examples/cat_color.jpeg", use_column_width="auto", width=300)
|
79 |
+
col2.write("**Custom Question**: What color is the cat?")
|
80 |
+
col2.write("**Predicted Answer**: white✅")
|
81 |
+
|
82 |
+
col3.image("./sections/examples/men_happy.jpeg", use_column_width="auto", width=300)
|
83 |
+
col3.write("**Custom Question**: What color is the man's jacket?")
|
84 |
+
col3.write("**Predicted Answer**: black⚫")
|
85 |
+
|
86 |
+
col1.image("./sections/examples/car_color.jpeg", use_column_width="auto", width=300)
|
87 |
+
col1.write("**Actual Question**: What color is the car?")
|
88 |
+
col1.write("**Predicted Answer**: blue❎")
|
89 |
+
|
90 |
+
col2.image("./sections/examples/coat_color.jpeg", use_column_width="auto", width=300)
|
91 |
+
col2.write("**Actual Question**: What color is this person's coat?")
|
92 |
+
col2.write("**Predicted Answer**: blue✅")
|
93 |
+
|
94 |
+
toc.subheader("Counting Questions")
|
95 |
+
|
96 |
+
col1, col2, col3 = st.beta_columns([1,1, 1])
|
97 |
+
|
98 |
+
col1.image("./sections/examples/giraffe_zebra.jpeg", use_column_width="auto", width=300)
|
99 |
+
col1.write("**Actual Question**: How many zebras are there?")
|
100 |
+
col1.write("**Predicted Answer**: 0❎")
|
101 |
+
|
102 |
+
col2.image("./sections/examples/giraffe_zebra.jpeg", use_column_width="auto", width=300)
|
103 |
+
col2.write("**Custom Question**: How many giraffes are there?")
|
104 |
+
col2.write("**Predicted Answer**: 2❎")
|
105 |
+
|
106 |
+
col3.image("./sections/examples/teddy.jpeg", use_column_width="auto", width=300)
|
107 |
+
col3.write("**Custom Question**: How many teddy bears are present in the image?")
|
108 |
+
col3.write("**Predicted Answer**: 3✅")
|
109 |
+
|
110 |
+
col1.image("./sections/examples/candle_count.jpeg", use_column_width="auto", width=300)
|
111 |
+
col1.write("**Actual Question**: ¿Cuantas velas hay en el cupcake?")
|
112 |
+
col1.write("**English Translation**: How many candles are in the cupcake?")
|
113 |
+
col1.write("**Predicted Answer**: 0❎")
|
114 |
+
|
115 |
+
col1.image("./sections/examples/people_picture.jpeg", use_column_width="auto", width=300)
|
116 |
+
col1.write("**Actual Question**: ¿A cuánta gente le están tomando una foto?")
|
117 |
+
col1.write("**English Translation**: How many people are you taking a picture of?")
|
118 |
+
col1.write("**Predicted Answer**: 10❎")
|
119 |
+
|
120 |
+
toc.subheader("Size/Shape Questions")
|
121 |
+
col1, col2, col3 = st.beta_columns([1,1,1])
|
122 |
+
col1.image("./sections/examples/vase.jpeg", use_column_width="auto", width=300)
|
123 |
+
col1.write("**Actual Question**: What shape is the vase? ")
|
124 |
+
col1.write("**Predicted Answer**: round✅")
|
125 |
+
|
126 |
+
|
127 |
+
toc.subheader("Yes/No Questions")
|
128 |
+
col1, col2, col3 = st.beta_columns([1,1,1])
|
129 |
+
|
130 |
+
col1.image("./sections/examples/teddy.jpeg", use_column_width="auto", width=300)
|
131 |
+
col1.write("**Actual Question**: Sind das drei Teddybären?")
|
132 |
+
col1.write("**English Translation**: Are those teddy bears?")
|
133 |
+
col1.write("**Predicted Answer**: Ja (yes)✅")
|
134 |
+
|
135 |
+
col2.image("./sections/examples/winter.jpeg", use_column_width="auto", width=300)
|
136 |
+
col2.write("**Actual Question**: ¿Se lo tomaron en invierno?")
|
137 |
+
col2.write("**English Translation**: Did they take it in winter?")
|
138 |
+
col2.write("**Predicted Answer**: si (yes)✅")
|
139 |
+
|
140 |
+
col3.image("./sections/examples/clock.jpeg", use_column_width="auto", width=300)
|
141 |
+
col3.write("**Actual Question**: Is the clock ornate? ")
|
142 |
+
col3.write("**Predicted Answer**: yes✅")
|
143 |
+
|
144 |
+
col1.image("./sections/examples/decorated_building.jpeg", use_column_width="auto", width=300)
|
145 |
+
col1.write("**Actual Question**: Ist das Gebäude orniert?")
|
146 |
+
col1.write("**English Translation**: Is the building decorated?")
|
147 |
+
col1.write("**Predicted Answer**: Ja (yes)✅")
|
148 |
+
|
149 |
+
col2.image("./sections/examples/commuter_train.jpeg", use_column_width="auto", width=300)
|
150 |
+
col2.write("**Actual Question**: Ist das ein Pendler-Zug?")
|
151 |
+
col2.write("**English Translation**: Is that a commuter train?")
|
152 |
+
col2.write("**Predicted Answer**: Ja (yes)❎")
|
153 |
+
|
154 |
+
col3.image("./sections/examples/is_in_a_restaurant.jpeg", use_column_width="auto", width=300)
|
155 |
+
col3.write("**Actual Question**: Elle est dans un restaurant?")
|
156 |
+
col3.write("**English Translation**: Is she in a restaurant?")
|
157 |
+
col3.write("**Predicted Answer**: Oui (yes)❎")
|
158 |
+
|
159 |
+
col1.image("./sections/examples/giraffe_eyes.jpeg", use_column_width="auto", width=300)
|
160 |
+
col1.write("**Actual Question**: Est-ce que l'œil de la girafe est fermé?")
|
161 |
+
col1.write("**English Translation**: Are the giraffe's eyes closed?")
|
162 |
+
col1.write("**Predicted Answer**: Oui (yes)❎")
|
163 |
+
|
164 |
+
toc.subheader("Negatives Test")
|
165 |
+
col1, col2, col3 = st.beta_columns([1,1,1])
|
166 |
+
col1.image("./sections/examples/men_happy.jpeg", use_column_width="auto", width=300)
|
167 |
+
|
168 |
+
col2.write("**Actual Question**: Is the man happy?")
|
169 |
+
col2.write("**Predicted Answer**: Yes✅")
|
170 |
+
|
171 |
+
col3.write("**Actual Question**: Is the man not happy?")
|
172 |
+
col3.write("**Predicted Answer**: Yes❎")
|
173 |
+
|
174 |
+
col2.write("**Actual Question**: Is the man sad?")
|
175 |
+
col2.write("**Predicted Answer**: No✅")
|
176 |
+
|
177 |
+
col3.write("**Actual Question**: Is the man not sad?")
|
178 |
+
col3.write("**Predicted Answer**: No❎")
|
179 |
+
|
180 |
+
col2.write("**Actual Question**: Is the man unhappy?")
|
181 |
+
col2.write("**Predicted Answer**: No✅")
|
182 |
+
|
183 |
+
col3.write("**Actual Question**: Is the man not unhappy?")
|
184 |
+
col3.write("**Predicted Answer**: No❎")
|
185 |
+
|
186 |
+
toc.subheader("Multilinguality Test")
|
187 |
+
|
188 |
+
toc.subsubheader("Color Question")
|
189 |
+
col1, col2, col3 = st.beta_columns([1,1,1])
|
190 |
+
col1.image("./sections/examples/truck_color.jpeg", use_column_width="auto", width=300)
|
191 |
+
|
192 |
+
col2.write("**Actual Question**: What color is the building?")
|
193 |
+
col2.write("**Predicted Answer**: red✅")
|
194 |
+
|
195 |
+
col3.write("**Actual Question**: Welche Farbe hat das Gebäude?")
|
196 |
+
col3.write("**English Translation**: What color is the building?")
|
197 |
+
col3.write("**Predicted Answer**: rot (red)✅")
|
198 |
+
|
199 |
+
col2.write("**Actual Question**: ¿De qué color es el edificio?")
|
200 |
+
col2.write("**English Translation**: What color is the building?")
|
201 |
+
col2.write("**Predicted Answer**: rojo (red)✅")
|
202 |
+
|
203 |
+
col3.write("**Actual Question**: De quelle couleur est le bâtiment ?")
|
204 |
+
col3.write("**English Translation**: What color is the building?")
|
205 |
+
col3.write("**Predicted Answer**: rouge (red)✅")
|
206 |
+
|
207 |
+
toc.subsubheader("Counting Question")
|
208 |
+
col1, col2, col3 = st.beta_columns([1,1,1])
|
209 |
+
col1.image("./sections/examples/bear.jpeg", use_column_width="auto", width=300)
|
210 |
+
|
211 |
+
col2.write("**Actual Question**: How many bears do you see?")
|
212 |
+
col2.write("**Predicted Answer**: 1✅")
|
213 |
+
|
214 |
+
col3.write("**Actual Question**: Wie viele Bären siehst du?")
|
215 |
+
col3.write("**English Translation**: How many bears do you see?")
|
216 |
+
col3.write("**Predicted Answer**: 1✅")
|
217 |
+
|
218 |
+
col2.write("**Actual Question**: ¿Cuántos osos ves?")
|
219 |
+
col2.write("**English Translation**: How many bears do you see?")
|
220 |
+
col2.write("**Predicted Answer**: 1✅")
|
221 |
+
|
222 |
+
col3.write("**Actual Question**: Combien d'ours voyez-vous ?")
|
223 |
+
col3.write("**English Translation**: How many bears do you see?")
|
224 |
+
col3.write("**Predicted Answer**: 1✅")
|
225 |
+
|
226 |
+
toc.subsubheader("Misc Question")
|
227 |
+
col1, col2, col3 = st.beta_columns([1,1,1])
|
228 |
+
col1.image("./sections/examples/bench.jpeg", use_column_width="auto", width=300)
|
229 |
+
|
230 |
+
col2.write("**Actual Question**: Where is the bench?")
|
231 |
+
col2.write("**Predicted Answer**: field✅")
|
232 |
+
|
233 |
+
col3.write("**Actual Question**: Où est le banc ?")
|
234 |
+
col3.write("**English Translation**: Where is the bench?")
|
235 |
+
col3.write("**Predicted Answer**: domaine (field)✅")
|
236 |
+
|
237 |
+
col2.write("**Actual Question**: ¿Dónde está el banco?")
|
238 |
+
col2.write("**English Translation**: Where is the bench?")
|
239 |
+
col2.write("**Predicted Answer**: campo (field)✅")
|
240 |
+
|
241 |
+
col3.write("**Actual Question**: Wo ist die Bank?")
|
242 |
+
col3.write("**English Translation**: Where is the bench?")
|
243 |
+
col3.write("**Predicted Answer**: Feld (field)✅")
|
244 |
+
|
245 |
+
|
246 |
+
toc.subheader("Misc Questions")
|
247 |
+
col1, col2, col3 = st.beta_columns([1,1,1])
|
248 |
+
|
249 |
+
col1.image("./sections/examples/tennis.jpeg", use_column_width="auto", width=300)
|
250 |
+
col1.write("**Actual Question**: ¿Qué clase de juego está viendo la multitud?")
|
251 |
+
col1.write("**English Translation**: What kind of game is the crowd watching?")
|
252 |
+
col1.write("**Predicted Answer**: tenis (tennis)✅")
|
253 |
+
|
254 |
+
col2.image("./sections/examples/men_body_suits.jpeg", use_column_width="auto", width=300)
|
255 |
+
col2.write("**Custom Question**: What are the men wearing?")
|
256 |
+
col2.write("**Predicted Answer**: wetsuits✅")
|
257 |
+
|
258 |
+
col3.image("./sections/examples/bathroom.jpeg", use_column_width="auto", width=300)
|
259 |
+
col3.write("**Actual Question**: ¿A qué habitación perteneces?")
|
260 |
+
col3.write("**English Translation**: What room do you belong to?")
|
261 |
+
col3.write("**Predicted Answer**: bano (bathroom)✅")
|
262 |
+
|
263 |
+
col1.image("./sections/examples/men_riding_horses.jpeg", use_column_width="auto", width=300)
|
264 |
+
col1.write("**Custom Question**: What are the men riding?")
|
265 |
+
col1.write("**Predicted Answer**: horses✅")
|
266 |
+
|
267 |
+
col2.image("./sections/examples/inside_outside.jpeg", use_column_width="auto", width=300)
|
268 |
+
col2.write("**Actual Question**: Was this taken inside or outside?")
|
269 |
+
col2.write("**Predicted Answer**: inside✅")
|
270 |
+
|
271 |
toc.generate()
|
sections/examples/bathroom.jpeg
ADDED
sections/examples/bear.jpeg
ADDED
sections/examples/bench.jpeg
ADDED
sections/examples/candle_count.jpeg
ADDED
sections/examples/car_color.jpeg
ADDED
sections/examples/cat_color.jpeg
ADDED
sections/examples/clock.jpeg
ADDED
sections/examples/coat_color.jpeg
ADDED
sections/examples/commuter_train.jpeg
ADDED
sections/examples/decorated_building.jpeg
ADDED
sections/examples/elephants.jpeg
ADDED
sections/examples/examples.md
ADDED
File without changes
|
sections/examples/giraffe_eyes.jpeg
ADDED
sections/examples/giraffe_zebra.jpeg
ADDED
sections/examples/inside_outside.jpeg
ADDED
sections/examples/is_in_a_restaurant.jpeg
ADDED
sections/examples/men_body_suits.jpeg
ADDED
sections/examples/men_happy.jpeg
ADDED
sections/examples/men_riding_horses.jpeg
ADDED
sections/examples/people_picture.jpeg
ADDED
sections/examples/teddy.jpeg
ADDED
sections/examples/tennis.jpeg
ADDED
sections/examples/truck_color.jpeg
ADDED
sections/examples/vase.jpeg
ADDED
sections/examples/winter.jpeg
ADDED