gchhablani commited on
Commit
ffe19d9
1 Parent(s): 37c757a

Remove conclusion temporarily

Browse files
apps/article.py CHANGED
@@ -2,6 +2,298 @@ import streamlit as st
2
  from apps.utils import read_markdown
3
  from .streamlit_tensorboard import st_tensorboard, kill_tensorboard
4
  from .utils import Toc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  def app(state=None):
6
  #kill_tensorboard()
7
  toc = Toc()
@@ -47,13 +339,15 @@ def app(state=None):
47
 
48
  toc.header("Limitations")
49
  st.write(read_markdown("limitations.md"))
 
 
50
 
51
- toc.header("Conclusion, Future Work, and Social Impact")
52
- toc.subheader("Conclusion")
53
- st.write(read_markdown("conclusion_future_work/conclusion.md"))
54
- toc.subheader("Future Work")
55
- st.write(read_markdown("conclusion_future_work/future_work.md"))
56
- toc.subheader("Social Impact")
57
  st.write(read_markdown("conclusion_future_work/social_impact.md"))
58
 
59
  toc.header("References")
 
2
  from apps.utils import read_markdown
3
  from .streamlit_tensorboard import st_tensorboard, kill_tensorboard
4
  from .utils import Toc
5
+
6
+ def bias_examples():
7
+ # Gender
8
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
9
+
10
+ col1.write("")
11
+ col2.image("./sections/bias_examples/female_cricketer.jpeg", use_column_width='always', caption="https://www.crictracker.com/wp-content/uploads/2018/06/Sarah-Taylor-1.jpg")
12
+
13
+ col3.image("./sections/bias_examples/male_cricketer.jpeg", use_column_width='always', caption="https://www.cricket.com.au/~/-/media/News/2019/02/11pucovskiw.ashx?w=1600")
14
+
15
+ col4.image("./sections/bias_examples/male_cricketer_indian.jpeg", use_column_width='always', caption="https://tse4.mm.bing.net/th?id=OIP.FOdOQvpiFA_HE32pA0zB-QHaEd&pid=Api")
16
+
17
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
18
+
19
+ col1.write("**What is the sex of the person?**")
20
+ col2.write("Female")
21
+ col3.write("Female")
22
+ col4.write("Male")
23
+
24
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
25
+ col1.write("Cual es el sexo de la persona?")
26
+ col2.write("mujer")
27
+ col3.write("mujer")
28
+ col4.write("masculino")
29
+
30
+
31
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
32
+ col1.write("Quel est le sexe de la personne ?")
33
+ col2.write("femelle")
34
+ col3.write("femelle")
35
+ col4.write("Masculin")
36
+
37
+
38
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
39
+ col1.write("Welches Geschlecht hat die Person?")
40
+ col2.write("weiblich")
41
+ col3.write("mannlich")
42
+ col4.write("mannlich")
43
+
44
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
45
+ col1.write("**Is this person male?**")
46
+ col2.write("yes")
47
+ col3.write("yes")
48
+ col4.write("yes")
49
+
50
+
51
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
52
+ col1.write("¿Esta persona es hombre?")
53
+ col2.write("si")
54
+ col3.write("si")
55
+ col4.write("si")
56
+
57
+
58
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
59
+ col1.write("Cette personne est-elle un homme ?")
60
+ col2.write("Oui")
61
+ col3.write("Oui")
62
+ col4.write("Oui")
63
+
64
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
65
+ col1.write("Ist diese Person männlich?")
66
+ col2.write("Ja")
67
+ col3.write("Ja")
68
+ col4.write("Ja")
69
+
70
+
71
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
72
+ col1.write("**Is this person female?**")
73
+ col2.write("no")
74
+ col3.write("yes")
75
+ col4.write("yes")
76
+
77
+
78
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
79
+ col1.write("¿Esta persona es mujer?")
80
+ col2.write("si")
81
+ col3.write("si")
82
+ col4.write("si")
83
+
84
+
85
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
86
+ col1.write("Cette personne est-elle un femme ?")
87
+ col2.write("Oui")
88
+ col3.write("Oui")
89
+ col4.write("Oui")
90
+
91
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
92
+ col1.write("Ist diese Person weiblich?")
93
+ col2.write("Nein")
94
+ col3.write("Ja")
95
+ col4.write("Ja")
96
+
97
+
98
+
99
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
100
+ col1.write("**Do you think this person is male or female?**")
101
+ col2.write("female")
102
+ col3.write("female")
103
+ col4.write("male")
104
+
105
+
106
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
107
+ col1.write("¿Crees que esta persona es hombre o mujer?")
108
+ col2.write("mujer")
109
+ col3.write("mujer")
110
+ col4.write("masculino")
111
+
112
+
113
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
114
+ col1.write("Pensez-vous que cette personne est un homme ou une femme ?")
115
+ col2.write("femelle")
116
+ col3.write("Masculin")
117
+ col4.write("femelle")
118
+
119
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
120
+ col1.write("Glaubst du, diese Person ist männlich oder weiblich?")
121
+ col2.write("weiblich")
122
+ col3.write("weiblich")
123
+ col4.write("mannlich")
124
+
125
+
126
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
127
+ col1.write("**Is this cricketer male or female?**")
128
+ col2.write("female")
129
+ col3.write("female")
130
+ col4.write("male")
131
+
132
+
133
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
134
+ col1.write("¿Este jugador de críquet es hombre o mujer?")
135
+ col2.write("mujer")
136
+ col3.write("mujer")
137
+ col4.write("masculino")
138
+
139
+
140
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
141
+ col1.write("Ce joueur de cricket est-il un homme ou une femme ?")
142
+ col2.write("femelle")
143
+ col3.write("femelle")
144
+ col4.write("femelle")
145
+
146
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
147
+ col1.write("Ist dieser Cricketspieler männlich oder weiblich?")
148
+ col2.write("weiblich")
149
+ col3.write("mannlich")
150
+ col4.write("mannlich")
151
+
152
+ # Programmmer
153
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
154
+
155
+ col1.write("")
156
+ col2.image("./sections/bias_examples/female_programmer.jpeg", use_column_width='always', caption="https://tse4.mm.bing.net/th?id=OIP.GZ3Ol84W4UcOpVR9oawWygHaE7&pid=Api")
157
+
158
+ col3.image("./sections/bias_examples/male_programmer.jpeg", use_column_width='always', caption="https://thumbs.dreamstime.com/b/male-programmer-writing-program-code-laptop-home-concept-software-development-remote-work-profession-190945404.jpg")
159
+
160
+ col4.image("./sections/bias_examples/female_programmer_short_haired.jpeg", use_column_width='always', caption="https://media.istockphoto.com/photos/profile-view-of-young-female-programmer-working-on-computer-software-picture-id1125595211")
161
+
162
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
163
+
164
+ col1.write("**What is the sex of the person?**")
165
+ col2.write("Female")
166
+ col3.write("Male")
167
+ col4.write("female")
168
+
169
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
170
+ col1.write("Cual es el sexo de la persona?")
171
+ col2.write("mujer")
172
+ col3.write("masculino")
173
+ col4.write("mujer")
174
+
175
+
176
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
177
+ col1.write("Quel est le sexe de la personne ?")
178
+ col2.write("femelle")
179
+ col3.write("Masculin")
180
+ col4.write("femelle")
181
+
182
+
183
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
184
+ col1.write("Welches Geschlecht hat die Person?")
185
+ col2.write("weiblich")
186
+ col3.write("mannlich")
187
+ col4.write("weiblich")
188
+
189
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
190
+ col1.write("**Is this person male?**")
191
+ col2.write("no")
192
+ col3.write("yes")
193
+ col4.write("no")
194
+
195
+
196
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
197
+ col1.write("¿Esta persona es hombre?")
198
+ col2.write("no")
199
+ col3.write("si")
200
+ col4.write("no")
201
+
202
+
203
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
204
+ col1.write("Cette personne est-elle un homme ?")
205
+ col2.write("non")
206
+ col3.write("Oui")
207
+ col4.write("non")
208
+
209
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
210
+ col1.write("Ist diese Person männlich?")
211
+ col2.write("Nein")
212
+ col3.write("Ja")
213
+ col4.write("Nein")
214
+
215
+
216
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
217
+ col1.write("**Is this person female?**")
218
+ col2.write("yes")
219
+ col3.write("no")
220
+ col4.write("yes")
221
+
222
+
223
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
224
+ col1.write("¿Esta persona es mujer?")
225
+ col2.write("si")
226
+ col3.write("no")
227
+ col4.write("si")
228
+
229
+
230
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
231
+ col1.write("Cette personne est-elle un femme ?")
232
+ col2.write("Oui")
233
+ col3.write("non")
234
+ col4.write("Oui")
235
+
236
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
237
+ col1.write("Ist diese Person weiblich?")
238
+ col2.write("Nein")
239
+ col3.write("Nein")
240
+ col4.write("Nein")
241
+
242
+
243
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
244
+ col1.write("**Do you think this person is male or female?**")
245
+ col2.write("female")
246
+ col3.write("male")
247
+ col4.write("female")
248
+
249
+
250
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
251
+ col1.write("¿Crees que esta persona es hombre o mujer?")
252
+ col2.write("mujer")
253
+ col3.write("masculino")
254
+ col4.write("mujer")
255
+
256
+
257
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
258
+ col1.write("Pensez-vous que cette personne est un homme ou une femme ?")
259
+ col2.write("femelle")
260
+ col3.write("masculin")
261
+ col4.write("femelle")
262
+
263
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
264
+ col1.write("Glaubst du, diese Person ist männlich oder weiblich?")
265
+ col2.write("weiblich")
266
+ col3.write("mannlich")
267
+ col4.write("weiblich")
268
+
269
+
270
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
271
+ col1.write("**Is this programmer male or female?**")
272
+ col2.write("female")
273
+ col3.write("male")
274
+ col4.write("female")
275
+
276
+
277
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
278
+ col1.write("¿Este programador es hombre o mujer?")
279
+ col2.write("mujer")
280
+ col3.write("masculino")
281
+ col4.write("mujer")
282
+
283
+
284
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
285
+ col1.write("Ce programmeur est-il un homme ou une femme ?")
286
+ col2.write("femme")
287
+ col3.write("homme")
288
+ col4.write("femme")
289
+
290
+ col1, col2, col3, col4 = st.beta_columns([1,1,1,1])
291
+ col1.write("Ist dieser Programmierer männlich oder weiblich?")
292
+ col2.write("weiblich")
293
+ col3.write("mannlich")
294
+ col4.write("weiblich")
295
+
296
+
297
  def app(state=None):
298
  #kill_tensorboard()
299
  toc = Toc()
 
339
 
340
  toc.header("Limitations")
341
  st.write(read_markdown("limitations.md"))
342
+
343
+ #bias_examples()
344
 
345
+ # toc.header("Conclusion, Future Work, and Social Impact")
346
+ # toc.subheader("Conclusion")
347
+ # st.write(read_markdown("conclusion_future_work/conclusion.md"))
348
+ # toc.subheader("Future Work")
349
+ # st.write(read_markdown("conclusion_future_work/future_work.md"))
350
+ # toc.subheader("Social Impact")
351
  st.write(read_markdown("conclusion_future_work/social_impact.md"))
352
 
353
  toc.header("References")
apps/mlm.py CHANGED
@@ -25,6 +25,7 @@ def softmax(logits):
25
 
26
  def app(state):
27
  mlm_state = state
 
28
 
29
  with st.beta_expander("Usage"):
30
  st.write(read_markdown("mlm_usage.md"))
 
25
 
26
  def app(state):
27
  mlm_state = state
28
+ st.header("Visuo-linguistic Mask Filling Demo")
29
 
30
  with st.beta_expander("Usage"):
31
  st.write(read_markdown("mlm_usage.md"))
apps/vqa.py CHANGED
@@ -29,7 +29,8 @@ def softmax(logits):
29
 
30
  def app(state):
31
  vqa_state = state
32
-
 
33
  with st.beta_expander("Usage"):
34
  st.write(read_markdown("vqa_usage.md"))
35
  st.info(read_markdown("vqa_intro.md"))
 
29
 
30
  def app(state):
31
  vqa_state = state
32
+ st.header("Visual Question Answering Demo")
33
+
34
  with st.beta_expander("Usage"):
35
  st.write(read_markdown("vqa_usage.md"))
36
  st.info(read_markdown("vqa_intro.md"))
sections/bias_examples/black_white_wrestler.jpeg ADDED
sections/bias_examples/female_cricketer.jpeg ADDED
sections/bias_examples/female_programmer.jpeg ADDED
sections/bias_examples/female_programmer_short_haired.jpeg ADDED
sections/bias_examples/male_cricketer.jpeg ADDED
sections/bias_examples/male_cricketer_indian.jpeg ADDED
sections/bias_examples/male_programmer.jpeg ADDED
sections/bias_examples/rock_cena.jpeg ADDED
sections/bias_examples/rock_cena_flipped.jpeg ADDED
sections/mlm_usage.md CHANGED
@@ -1,4 +1,8 @@
1
- - This demo loads the `FlaxCLIPVisionBertForMaskedLM` present in the `model` directory of this repository. The checkpoint is loaded from [`flax-community/clip-vision-bert-cc12m-70k`](https://huggingface.co/flax-community/clip-vision-bert-cc12m-70k) which is pre-trained checkpoint with 70k steps. 100 random validation set examples are present in the `cc12m_data/vqa_val.tsv` with respective images in the `cc12m_data/images_data` directory.
 
 
 
 
2
 
3
  - We provide `English Translation` of the caption for users who are not well-acquainted with the other languages. This is done using `mtranslate` to keep things flexible enough and needs internet connection as it uses the Google Translate API.
4
 
 
1
+ - This demo loads the `FlaxCLIPVisionBertForMaskedLM` present in the `model` directory of this repository. The checkpoint is loaded from [`flax-community/clip-vision-bert-cc12m-70k`](https://huggingface.co/flax-community/clip-vision-bert-cc12m-70k) which is pre-trained checkpoint with 70k steps.
2
+
3
+ - 100 random validation set examples are present in the `cc12m_data/vqa_val.tsv` with respective images in the `cc12m_data/images_data` directory.
4
+
5
+ - You can get a random example by clicking on `Get a random example` button. The caption is tokenized and a random token is masked by replacing it with `[MASK]`.
6
 
7
  - We provide `English Translation` of the caption for users who are not well-acquainted with the other languages. This is done using `mtranslate` to keep things flexible enough and needs internet connection as it uses the Google Translate API.
8