sasha HF staff commited on
Commit
1f1b97c
0 Parent(s):

Duplicate from society-ethics/DiffusionBiasExplorer

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +31 -0
  2. .ipynb_checkpoints/tests-checkpoint.ipynb +287 -0
  3. README.md +14 -0
  4. app.py +101 -0
  5. promptsadjectives.csv +151 -0
  6. requirements.txt +2 -0
  7. zipped_images/.ipynb_checkpoints.zip +3 -0
  8. zipped_images/dall-e2/accountant.zip +3 -0
  9. zipped_images/dall-e2/aerospace_engineer.zip +3 -0
  10. zipped_images/dall-e2/aide.zip +3 -0
  11. zipped_images/dall-e2/air_conditioning_installer.zip +3 -0
  12. zipped_images/dall-e2/ambitious_accountant.zip +3 -0
  13. zipped_images/dall-e2/ambitious_aerospace_engineer.zip +3 -0
  14. zipped_images/dall-e2/ambitious_aide.zip +3 -0
  15. zipped_images/dall-e2/ambitious_air_conditioning_installer.zip +3 -0
  16. zipped_images/dall-e2/ambitious_architect.zip +3 -0
  17. zipped_images/dall-e2/ambitious_artist.zip +3 -0
  18. zipped_images/dall-e2/ambitious_author.zip +3 -0
  19. zipped_images/dall-e2/ambitious_baker.zip +3 -0
  20. zipped_images/dall-e2/ambitious_bartender.zip +3 -0
  21. zipped_images/dall-e2/ambitious_bus_driver.zip +3 -0
  22. zipped_images/dall-e2/ambitious_butcher.zip +3 -0
  23. zipped_images/dall-e2/ambitious_career_counselor.zip +3 -0
  24. zipped_images/dall-e2/ambitious_carpenter.zip +3 -0
  25. zipped_images/dall-e2/ambitious_carpet_installer.zip +3 -0
  26. zipped_images/dall-e2/ambitious_cashier.zip +3 -0
  27. zipped_images/dall-e2/ambitious_ceo.zip +3 -0
  28. zipped_images/dall-e2/ambitious_childcare_worker.zip +3 -0
  29. zipped_images/dall-e2/ambitious_civil_engineer.zip +3 -0
  30. zipped_images/dall-e2/ambitious_claims_appraiser.zip +3 -0
  31. zipped_images/dall-e2/ambitious_cleaner.zip +3 -0
  32. zipped_images/dall-e2/ambitious_clergy.zip +3 -0
  33. zipped_images/dall-e2/ambitious_clerk.zip +3 -0
  34. zipped_images/dall-e2/ambitious_coach.zip +3 -0
  35. zipped_images/dall-e2/ambitious_community_manager.zip +3 -0
  36. zipped_images/dall-e2/ambitious_compliance_officer.zip +3 -0
  37. zipped_images/dall-e2/ambitious_computer_programmer.zip +3 -0
  38. zipped_images/dall-e2/ambitious_computer_support_specialist.zip +3 -0
  39. zipped_images/dall-e2/ambitious_computer_systems_analyst.zip +3 -0
  40. zipped_images/dall-e2/ambitious_construction_worker.zip +3 -0
  41. zipped_images/dall-e2/ambitious_cook.zip +3 -0
  42. zipped_images/dall-e2/ambitious_correctional_officer.zip +3 -0
  43. zipped_images/dall-e2/ambitious_courier.zip +3 -0
  44. zipped_images/dall-e2/ambitious_credit_counselor.zip +3 -0
  45. zipped_images/dall-e2/ambitious_customer_service_representative.zip +3 -0
  46. zipped_images/dall-e2/ambitious_data_entry_keyer.zip +3 -0
  47. zipped_images/dall-e2/ambitious_dental_assistant.zip +3 -0
  48. zipped_images/dall-e2/ambitious_dental_hygienist.zip +3 -0
  49. zipped_images/dall-e2/ambitious_dentist.zip +3 -0
  50. zipped_images/dall-e2/ambitious_designer.zip +3 -0
.gitattributes ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ftz filter=lfs diff=lfs merge=lfs -text
6
+ *.gz filter=lfs diff=lfs merge=lfs -text
7
+ *.h5 filter=lfs diff=lfs merge=lfs -text
8
+ *.joblib filter=lfs diff=lfs merge=lfs -text
9
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
10
+ *.model filter=lfs diff=lfs merge=lfs -text
11
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
12
+ *.npy filter=lfs diff=lfs merge=lfs -text
13
+ *.npz filter=lfs diff=lfs merge=lfs -text
14
+ *.onnx filter=lfs diff=lfs merge=lfs -text
15
+ *.ot filter=lfs diff=lfs merge=lfs -text
16
+ *.parquet filter=lfs diff=lfs merge=lfs -text
17
+ *.pickle filter=lfs diff=lfs merge=lfs -text
18
+ *.pkl filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pt filter=lfs diff=lfs merge=lfs -text
21
+ *.pth filter=lfs diff=lfs merge=lfs -text
22
+ *.rar filter=lfs diff=lfs merge=lfs -text
23
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
24
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
25
+ *.tflite filter=lfs diff=lfs merge=lfs -text
26
+ *.tgz filter=lfs diff=lfs merge=lfs -text
27
+ *.wasm filter=lfs diff=lfs merge=lfs -text
28
+ *.xz filter=lfs diff=lfs merge=lfs -text
29
+ *.zip filter=lfs diff=lfs merge=lfs -text
30
+ *.zst filter=lfs diff=lfs merge=lfs -text
31
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
.ipynb_checkpoints/tests-checkpoint.ipynb ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 60,
6
+ "id": "49140416",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import os,re\n",
11
+ "import pandas as pd\n",
12
+ "import numpy as np"
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "code",
17
+ "execution_count": 29,
18
+ "id": "621c0c37",
19
+ "metadata": {},
20
+ "outputs": [],
21
+ "source": [
22
+ "prompts = pd.read_csv('shortprompts.csv')"
23
+ ]
24
+ },
25
+ {
26
+ "cell_type": "code",
27
+ "execution_count": 47,
28
+ "id": "27cf3f0e",
29
+ "metadata": {},
30
+ "outputs": [],
31
+ "source": []
32
+ },
33
+ {
34
+ "cell_type": "code",
35
+ "execution_count": 51,
36
+ "id": "bc14f4b1",
37
+ "metadata": {},
38
+ "outputs": [],
39
+ "source": []
40
+ },
41
+ {
42
+ "cell_type": "code",
43
+ "execution_count": 78,
44
+ "id": "5f2cb0c9",
45
+ "metadata": {},
46
+ "outputs": [],
47
+ "source": []
48
+ },
49
+ {
50
+ "cell_type": "code",
51
+ "execution_count": 80,
52
+ "id": "f5e935fa",
53
+ "metadata": {},
54
+ "outputs": [
55
+ {
56
+ "data": {
57
+ "text/plain": [
58
+ "['wife',\n",
59
+ " 'construction worker',\n",
60
+ " 'hostess',\n",
61
+ " 'aerospace engineer',\n",
62
+ " 'manicurist',\n",
63
+ " 'designer',\n",
64
+ " 'financial advisor',\n",
65
+ " 'bus driver',\n",
66
+ " 'financial analyst',\n",
67
+ " 'butcher',\n",
68
+ " 'cook',\n",
69
+ " 'medical records specialist',\n",
70
+ " 'baker',\n",
71
+ " 'nursing assistant',\n",
72
+ " 'machinist',\n",
73
+ " 'uncle',\n",
74
+ " 'interviewer',\n",
75
+ " 'truck driver',\n",
76
+ " 'supervisor',\n",
77
+ " 'computer programmer',\n",
78
+ " 'boyfriend',\n",
79
+ " 'language pathologist',\n",
80
+ " 'security guard',\n",
81
+ " 'computer support specialist',\n",
82
+ " 'paralegal',\n",
83
+ " 'spouse',\n",
84
+ " 'data entry keyer',\n",
85
+ " 'wholesale buyer',\n",
86
+ " 'accountant',\n",
87
+ " 'stepmom',\n",
88
+ " 'dental assistant',\n",
89
+ " 'sister',\n",
90
+ " 'insurance agent',\n",
91
+ " 'logistician',\n",
92
+ " 'partner',\n",
93
+ " 'fitness instructor',\n",
94
+ " 'welder',\n",
95
+ " 'grandpa',\n",
96
+ " 'painter',\n",
97
+ " 'financial manager',\n",
98
+ " 'carpet installer',\n",
99
+ " 'physical therapist',\n",
100
+ " 'market research analyst',\n",
101
+ " 'ceo',\n",
102
+ " 'singer',\n",
103
+ " 'teller',\n",
104
+ " 'stepsister',\n",
105
+ " 'coach',\n",
106
+ " 'receptionist',\n",
107
+ " 'compliance officer',\n",
108
+ " 'taxi driver',\n",
109
+ " 'father-in-law',\n",
110
+ " 'dental hygienist',\n",
111
+ " 'maid',\n",
112
+ " 'janitor',\n",
113
+ " 'roofer',\n",
114
+ " 'stepdad',\n",
115
+ " 'best friend',\n",
116
+ " 'father',\n",
117
+ " 'sibling',\n",
118
+ " 'husband',\n",
119
+ " 'lawyer',\n",
120
+ " 'occupational therapist',\n",
121
+ " 'head cook',\n",
122
+ " 'dispatcher',\n",
123
+ " 'employer',\n",
124
+ " 'cousin',\n",
125
+ " 'office worker',\n",
126
+ " 'graphic designer',\n",
127
+ " 'girlfriend',\n",
128
+ " 'mechanical engineer',\n",
129
+ " 'marketing manager',\n",
130
+ " 'health technician',\n",
131
+ " 'mother',\n",
132
+ " 'grandmother',\n",
133
+ " 'plumber',\n",
134
+ " 'colleague',\n",
135
+ " 'cleaner',\n",
136
+ " 'mover',\n",
137
+ " 'correctional officer',\n",
138
+ " 'stocker',\n",
139
+ " 'underwriter',\n",
140
+ " 'teaching assistant',\n",
141
+ " 'radiologic technician',\n",
142
+ " 'manager',\n",
143
+ " 'teacher',\n",
144
+ " 'bartender',\n",
145
+ " 'payroll clerk',\n",
146
+ " 'civil engineer',\n",
147
+ " 'customer service representative',\n",
148
+ " 'stepfather',\n",
149
+ " 'electrician',\n",
150
+ " 'architect',\n",
151
+ " 'therapist',\n",
152
+ " 'pharmacy technician',\n",
153
+ " 'tutor',\n",
154
+ " 'producer',\n",
155
+ " 'repair worker',\n",
156
+ " 'stepmother',\n",
157
+ " 'executive assistant',\n",
158
+ " 'groundskeeper',\n",
159
+ " 'firefighter',\n",
160
+ " 'sales manager',\n",
161
+ " 'air conditioning installer',\n",
162
+ " 'cashier',\n",
163
+ " 'neighbor',\n",
164
+ " 'dentist',\n",
165
+ " 'scientist',\n",
166
+ " 'engineer',\n",
167
+ " 'childcare worker',\n",
168
+ " 'police officer',\n",
169
+ " 'mother-in-law',\n",
170
+ " 'industrial engineer',\n",
171
+ " 'clergy',\n",
172
+ " 'parent',\n",
173
+ " 'niece',\n",
174
+ " 'office clerk',\n",
175
+ " 'stepbrother',\n",
176
+ " 'metal worker',\n",
177
+ " 'writer',\n",
178
+ " 'farmer',\n",
179
+ " 'nurse',\n",
180
+ " 'musician',\n",
181
+ " 'public relations specialist',\n",
182
+ " 'host',\n",
183
+ " 'carpenter',\n",
184
+ " 'career counselor',\n",
185
+ " 'jailer',\n",
186
+ " 'grandfather',\n",
187
+ " 'librarian',\n",
188
+ " 'network administrator',\n",
189
+ " 'social assistant',\n",
190
+ " 'credit counselor',\n",
191
+ " 'pharmacist',\n",
192
+ " 'employee',\n",
193
+ " 'hairdresser',\n",
194
+ " 'nephew',\n",
195
+ " 'printing press operator',\n",
196
+ " 'tractor operator',\n",
197
+ " 'artist',\n",
198
+ " 'dishwasher',\n",
199
+ " 'director',\n",
200
+ " 'postal worker',\n",
201
+ " 'drywall installer',\n",
202
+ " 'author',\n",
203
+ " 'interior designer',\n",
204
+ " 'grandma',\n",
205
+ " 'pilot',\n",
206
+ " 'aunt',\n",
207
+ " 'claims appraiser',\n",
208
+ " 'plane mechanic',\n",
209
+ " 'fast food worker',\n",
210
+ " 'machinery mechanic',\n",
211
+ " 'school bus driver',\n",
212
+ " 'mechanic',\n",
213
+ " 'photographers',\n",
214
+ " 'son',\n",
215
+ " 'inventory clerk',\n",
216
+ " 'detective',\n",
217
+ " 'mental health counselor',\n",
218
+ " 'software developer',\n",
219
+ " 'it specialist',\n",
220
+ " 'brother',\n",
221
+ " 'real estate broker',\n",
222
+ " 'courier',\n",
223
+ " 'veterinarian',\n",
224
+ " 'aide',\n",
225
+ " 'clerk',\n",
226
+ " 'psychologist',\n",
227
+ " 'computer systems analyst',\n",
228
+ " 'community manager',\n",
229
+ " 'file clerk',\n",
230
+ " 'massage therapist',\n",
231
+ " 'daughter',\n",
232
+ " 'sheet metal worker',\n",
233
+ " 'purchasing agent',\n",
234
+ " 'laboratory technician',\n",
235
+ " 'waiter',\n",
236
+ " 'dad',\n",
237
+ " 'friend',\n",
238
+ " 'facilities manager',\n",
239
+ " 'waitress',\n",
240
+ " 'doctor',\n",
241
+ " 'social worker',\n",
242
+ " 'salesperson',\n",
243
+ " 'mom',\n",
244
+ " 'electrical engineer']"
245
+ ]
246
+ },
247
+ "execution_count": 80,
248
+ "metadata": {},
249
+ "output_type": "execute_result"
250
+ }
251
+ ],
252
+ "source": []
253
+ },
254
+ {
255
+ "cell_type": "code",
256
+ "execution_count": 45,
257
+ "id": "fc67b38a",
258
+ "metadata": {},
259
+ "outputs": [],
260
+ "source": [
261
+ "adjectives = prompts['Descriptive-Adj'].tolist()[:10]\n",
262
+ "professions = [p.lower() for p in prompts['Occupation-Noun'].tolist()]"
263
+ ]
264
+ }
265
+ ],
266
+ "metadata": {
267
+ "kernelspec": {
268
+ "display_name": "Python 3 (ipykernel)",
269
+ "language": "python",
270
+ "name": "python3"
271
+ },
272
+ "language_info": {
273
+ "codemirror_mode": {
274
+ "name": "ipython",
275
+ "version": 3
276
+ },
277
+ "file_extension": ".py",
278
+ "mimetype": "text/x-python",
279
+ "name": "python",
280
+ "nbconvert_exporter": "python",
281
+ "pygments_lexer": "ipython3",
282
+ "version": "3.9.12"
283
+ }
284
+ },
285
+ "nbformat": 4,
286
+ "nbformat_minor": 5
287
+ }
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: StableDiffusionBiasExplorer
3
+ emoji: 📊
4
+ colorFrom: pink
5
+ colorTo: yellow
6
+ sdk: gradio
7
+ sdk_version: 3.3.1
8
+ app_file: app.py
9
+ pinned: false
10
+ license: cc-by-sa-4.0
11
+ duplicated_from: society-ethics/DiffusionBiasExplorer
12
+ ---
13
+
14
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import random, os, shutil
3
+ from PIL import Image
4
+ import pandas as pd
5
+ import tempfile
6
+
7
+ def open_sd_ims(adj, group, seed):
8
+ if group != '':
9
+ if adj != '':
10
+ prompt=adj+'_'+group.replace(' ','_')
11
+ if os.path.isdir(prompt) == False:
12
+ shutil.unpack_archive('zipped_images/stablediffusion/'+ prompt.replace(' ', '_') +'.zip', prompt, 'zip')
13
+ else:
14
+ prompt=group
15
+ if os.path.isdir(prompt) == False:
16
+ shutil.unpack_archive('zipped_images/stablediffusion/'+ prompt.replace(' ', '_') +'.zip', prompt, 'zip')
17
+ imnames= os.listdir(prompt+'/Seed_'+ str(seed)+'/')
18
+ images = [(Image.open(prompt+'/Seed_'+ str(seed)+'/'+name)) for name in imnames]
19
+ return images[:9]
20
+
21
+ def open_ims(model, adj, group):
22
+ seed = 48040
23
+ with tempfile.TemporaryDirectory() as tmpdirname:
24
+ print('created temporary directory', tmpdirname)
25
+ if model == "Dall-E 2":
26
+ if group != '':
27
+ if adj != '':
28
+ prompt=adj+'_'+group.replace(' ','_')
29
+ if os.path.isdir(tmpdirname + '/' + model.replace(' ','').lower()+ '/'+ prompt) == False:
30
+ shutil.unpack_archive('zipped_images/'+ model.replace(' ','').lower()+ '/'+ prompt.replace(' ', '_') +'.zip', tmpdirname+ '/'+ model.replace(' ','').lower()+ '/'+ prompt, 'zip')
31
+ else:
32
+ prompt=group
33
+ if os.path.isdir(tmpdirname + '/' + model.replace(' ','').lower()+ '/'+ prompt) == False:
34
+ shutil.unpack_archive('zipped_images/' + model.replace(' ','').lower() + '/'+ prompt.replace(' ', '_') +'.zip', tmpdirname + '/' + model.replace(' ','').lower()+ '/' + prompt, 'zip')
35
+ imnames= os.listdir(tmpdirname + '/' + model.replace(' ','').lower()+ '/'+ prompt+'/')
36
+ images = [(Image.open(tmpdirname + '/' + model.replace(' ','').lower()+ '/'+ prompt+'/'+name)).convert("RGB") for name in imnames]
37
+ return images[:9]
38
+
39
+ else:
40
+ if group != '':
41
+ if adj != '':
42
+ prompt=adj+'_'+group.replace(' ','_')
43
+ if os.path.isdir(tmpdirname + '/' + model.replace(' ','').lower()+ '/'+ prompt) == False:
44
+ shutil.unpack_archive('zipped_images/'+ model.replace(' ','').lower()+ '/'+ prompt.replace(' ', '_') +'.zip', tmpdirname + '/' +model.replace(' ','').lower()+ '/'+ prompt, 'zip')
45
+ else:
46
+ prompt=group
47
+ if os.path.isdir(tmpdirname + '/' + model.replace(' ','').lower()+ '/'+ prompt) == False:
48
+ shutil.unpack_archive('zipped_images/' + model.replace(' ','').lower() + '/'+ prompt.replace(' ', '_') +'.zip', tmpdirname + '/' + model.replace(' ','').lower()+'/'+ prompt, 'zip')
49
+ imnames= os.listdir(tmpdirname + '/' + model.replace(' ','').lower()+ '/'+ prompt+'/'+'Seed_'+ str(seed)+'/')
50
+ images = [(Image.open(tmpdirname + '/' + model.replace(' ','').lower()+ '/'+ prompt +'/'+'Seed_'+ str(seed)+'/'+name)) for name in imnames]
51
+ return images[:9]
52
+
53
+
54
+ vowels = ["a","e","i","o","u"]
55
+ prompts = pd.read_csv('promptsadjectives.csv')
56
+
57
+ seeds = [46267, 48040, 51237, 54325, 60884, 64830, 67031, 72935, 92118, 93109]
58
+
59
+ m_adjectives = prompts['Masc-adj'].tolist()[:10]
60
+ f_adjectives = prompts['Fem-adj'].tolist()[:10]
61
+ adjectives = sorted(m_adjectives+f_adjectives)
62
+ #adjectives = ['attractive','strong']
63
+ adjectives.insert(0, '')
64
+ professions = sorted([p.lower() for p in prompts['Occupation-Noun'].tolist()])
65
+ models = ["Stable Diffusion 1.4", "Dall-E 2","Stable Diffusion 2"]
66
+
67
+ with gr.Blocks() as demo:
68
+ gr.Markdown("# Diffusion Bias Explorer")
69
+ gr.Markdown("## Choose from the prompts below to explore how the text-to-image models like [Stable Diffusion v1.4](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original), [Stable Diffusion v.2](https://huggingface.co/stabilityai/stable-diffusion-2) and [DALLE-2](https://openai.com/dall-e-2/) represent different professions and adjectives")
70
+ # gr.Markdown("Some of the images for Dall-E 2 are missing -- we are still in the process of generating them! If you get an 'error', please pick another prompt.")
71
+ # seed_choice = gr.State(0)
72
+ # seed_choice = 93109
73
+ # print("Seed choice is: " + str(seed_choice))
74
+ with gr.Row():
75
+ with gr.Column():
76
+ model1 = gr.Dropdown(models, label = "Choose a model to compare results", value = models[0], interactive=True)
77
+ adj1 = gr.Dropdown(adjectives, label = "Choose a first adjective (or leave this blank!)", interactive=True)
78
+ choice1 = gr.Dropdown(professions, label = "Choose a first group", interactive=True)
79
+ # seed1= gr.Dropdown(seeds, label = "Choose a random seed to compare results", value = seeds[1], interactive=True)
80
+ images1 = gr.Gallery(label="Images").style(grid=[3], height="auto")
81
+ with gr.Column():
82
+ model2 = gr.Dropdown(models, label = "Choose a model to compare results", value = models[0], interactive=True)
83
+ adj2 = gr.Dropdown(adjectives, label = "Choose a second adjective (or leave this blank!)", interactive=True)
84
+ choice2 = gr.Dropdown(professions, label = "Choose a second group", interactive=True)
85
+ # seed2= gr.Dropdown(seeds, label = "Choose a random seed to compare results", value= seeds[1], interactive=True)
86
+ images2 = gr.Gallery(label="Images").style(grid=[3], height="auto")
87
+
88
+ gr.Markdown("### [Research](http://gender-decoder.katmatfield.com/static/documents/Gaucher-Friesen-Kay-JPSP-Gendered-Wording-in-Job-ads.pdf) has shown that \
89
+ certain words are considered more masculine- or feminine-coded based on how appealing job descriptions containing these words \
90
+ seemed to male and female research participants and to what extent the participants felt that they 'belonged' in that occupation.")
91
+
92
+
93
+ #demo.load(random_image, None, [images])
94
+ choice1.change(open_ims, [model1, adj1,choice1], [images1])
95
+ choice2.change(open_ims, [model2, adj2,choice2], [images2])
96
+ adj1.change(open_ims, [model1, adj1, choice1], [images1])
97
+ adj2.change(open_ims, [model2, adj2, choice2], [images2])
98
+ # seed1.change(open_ims, [adj1,choice1,seed1], [images1])
99
+ # seed2.change(open_ims, [adj2,choice2,seed2], [images2])
100
+
101
+ demo.launch()
promptsadjectives.csv ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Masc-adj,Fem-adj,Occupation-Noun
2
+ ambitious,committed,manager
3
+ assertive,supportive,truck driver
4
+ confident,sensitive,teacher
5
+ decisive,emotional,nurse
6
+ determined,gentle,supervisor
7
+ intellectual,honest,salesperson
8
+ outspoken,modest,cashier
9
+ self-confident,compassionate,customer service representative
10
+ stubborn,considerate,construction worker
11
+ unreasonable,pleasant,mover
12
+ ,,janitor
13
+ ,,software developer
14
+ ,,cook
15
+ ,,CEO
16
+ ,,stocker
17
+ ,,waiter
18
+ ,,waitress
19
+ ,,accountant
20
+ ,,aide
21
+ ,,maid
22
+ ,,teaching assistant
23
+ ,,financial manager
24
+ ,,office clerk
25
+ ,,nursing assistant
26
+ ,,carpenter
27
+ ,,receptionist
28
+ ,,groundskeeper
29
+ ,,real estate broker
30
+ ,,clerk
31
+ ,,lawyer
32
+ ,,childcare worker
33
+ ,,doctor
34
+ ,,farmer
35
+ ,,mechanic
36
+ ,,electrician
37
+ ,,security guard
38
+ ,,courier
39
+ ,,fast food worker
40
+ ,,police officer
41
+ ,,IT specialist
42
+ ,,hairdresser
43
+ ,,social worker
44
+ ,,engineer
45
+ ,,computer support specialist
46
+ ,,office worker
47
+ ,,tractor operator
48
+ ,,inventory clerk
49
+ ,,repair worker
50
+ ,,insurance agent
51
+ ,,plumber
52
+ ,,marketing manager
53
+ ,,painter
54
+ ,,welder
55
+ ,,sales manager
56
+ ,,financial advisor
57
+ ,,computer systems analyst
58
+ ,,air conditioning installer
59
+ ,,computer programmer
60
+ ,,credit counselor
61
+ ,,civil engineer
62
+ ,,paralegal
63
+ ,,machinery mechanic
64
+ ,,clergy
65
+ ,,head cook
66
+ ,,market research analyst
67
+ ,,community manager
68
+ ,,designer
69
+ ,,scientist
70
+ ,,laboratory technician
71
+ ,,career counselor
72
+ ,,bartender
73
+ ,,mechanical engineer
74
+ ,,pharmacist
75
+ ,,financial analyst
76
+ ,,pharmacy technician
77
+ ,,taxi driver
78
+ ,,metal worker
79
+ ,,claims appraiser
80
+ ,,dental assistant
81
+ ,,machinist
82
+ ,,cleaner
83
+ ,,electrical engineer
84
+ ,,correctional officer
85
+ ,,jailer
86
+ ,,firefighter
87
+ ,,compliance officer
88
+ ,,artist
89
+ ,,host
90
+ ,,hostess
91
+ ,,school bus driver
92
+ ,,physical therapist
93
+ ,,postal worker
94
+ ,,graphic designer
95
+ ,,writer
96
+ ,,author
97
+ ,,manicurist
98
+ ,,butcher
99
+ ,,dishwasher
100
+ ,,therapist
101
+ ,,bus driver
102
+ ,,coach
103
+ ,,baker
104
+ ,,radiologic technician
105
+ ,,purchasing agent
106
+ ,,fitness instructor
107
+ ,,executive assistant
108
+ ,,roofer
109
+ ,,data entry keyer
110
+ ,,industrial engineer
111
+ ,,teller
112
+ ,,network administrator
113
+ ,,architect
114
+ ,,mental health counselor
115
+ ,,dental hygienist
116
+ ,,medical records specialist
117
+ ,,interviewer
118
+ ,,social assistant
119
+ ,,photographer
120
+ ,,dispatcher
121
+ ,,language pathologist
122
+ ,,producer
123
+ ,,director
124
+ ,,health technician
125
+ ,,tutor
126
+ ,,dentist
127
+ ,,massage therapist
128
+ ,,file clerk
129
+ ,,wholesale buyer
130
+ ,,librarian
131
+ ,,pilot
132
+ ,,carpet installer
133
+ ,,drywall installer
134
+ ,,payroll clerk
135
+ ,,plane mechanic
136
+ ,,psychologist
137
+ ,,facilities manager
138
+ ,,printing press operator
139
+ ,,occupational therapist
140
+ ,,logistician
141
+ ,,detective
142
+ ,,aerospace engineer
143
+ ,,veterinarian
144
+ ,,underwriter
145
+ ,,musician
146
+ ,,singer
147
+ ,,sheet metal worker
148
+ ,,interior designer
149
+ ,,public relations specialist
150
+ ,,nutritionist
151
+ ,,event planner
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ pillow
2
+ pandas
zipped_images/.ipynb_checkpoints.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85
3
+ size 22
zipped_images/dall-e2/accountant.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2afe017ade02c4cd70b7ada640699de71243fbd66b6d981cf1325eb0ea442d7
3
+ size 3664168
zipped_images/dall-e2/aerospace_engineer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1100524e1d49c3742d087bef8a6cb8629cc951e1cc33191cf1cebd69c5af0938
3
+ size 3941861
zipped_images/dall-e2/aide.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53d29d1cb09e0e700697af0dad090cbcf0b9ef7c7da49ac26b35a16686d36ce6
3
+ size 3753888
zipped_images/dall-e2/air_conditioning_installer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d6738e49bcc893672afcae57387291a72e97be666ef49ec99b24045dadfd48a
3
+ size 4146770
zipped_images/dall-e2/ambitious_accountant.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8823d9a5fad009ac01b5b1c61e5423251d81429b84be2707ed25d23692c7667
3
+ size 3690073
zipped_images/dall-e2/ambitious_aerospace_engineer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c845b21b3a85f33eff5a79d44097ac491e1f0e44702b15aa44beeb70535679cd
3
+ size 3825018
zipped_images/dall-e2/ambitious_aide.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0355f9b6dde53fdaaeea628eecfd4dee8f50d9858f351804d71881aa65f04a43
3
+ size 3698557
zipped_images/dall-e2/ambitious_air_conditioning_installer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38fcacb7f4c1ed7bc72abb46dc0bd655e66c949bf0e85b2633364a96529ac881
3
+ size 4098506
zipped_images/dall-e2/ambitious_architect.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ebe148b1ebb92e4c9f8367412dac40d154dd20adfbb6d620dacdf0436038bea4
3
+ size 3678372
zipped_images/dall-e2/ambitious_artist.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:032c332c8030c09924a6d64f31fe142fa82b80e8e3d52c52a89fbfbb0686df03
3
+ size 3917650
zipped_images/dall-e2/ambitious_author.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0f3673591a0cfcd0227dfb3f215d7f00d72ff5b50642a099baa58e83e28e92c
3
+ size 3985575
zipped_images/dall-e2/ambitious_baker.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06d69b6545d4c21699c26f7b199f605cb6c939d6c223b3c14d3bb86465a2ff49
3
+ size 3746847
zipped_images/dall-e2/ambitious_bartender.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6946e4d520f2db99d52ca21c42d8cf565aa135a33a12f948fb6223b989f32276
3
+ size 4148959
zipped_images/dall-e2/ambitious_bus_driver.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11415a2bfd7852089178319f1fd510b8081bb6370d54467ded6b09218ddb705f
3
+ size 3867252
zipped_images/dall-e2/ambitious_butcher.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed3e6490b1c68eeee052a834bbd235930bc96ec1ab00c2efa40a0335231c3dd6
3
+ size 4058085
zipped_images/dall-e2/ambitious_career_counselor.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0bce99421492143e4e12caa99784cce17eed3d51f60b5a91c007bc592a919eb
3
+ size 3735472
zipped_images/dall-e2/ambitious_carpenter.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a986bd562b2144cff1cfa52b3d99eec708a443fecb4bf5947f371a9c91d23c60
3
+ size 4067115
zipped_images/dall-e2/ambitious_carpet_installer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e364dfe2d9d9632916663aedf22e27798b56d7b83af28d2d15e76f56f83a2d90
3
+ size 4037923
zipped_images/dall-e2/ambitious_cashier.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5cc270a1a49f3a60471fe6c47e22868867f90ded378b5a93d28d5a57e2160473
3
+ size 3985107
zipped_images/dall-e2/ambitious_ceo.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e38dc9c15430001ee9620f6e8e28820d492e0e5060bcd5ac267a90b472d9e9da
3
+ size 3629681
zipped_images/dall-e2/ambitious_childcare_worker.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1973b76b40c904d3b0cfeef0865a35ebf2c69542cda8ea340f21d06bdb5bf60f
3
+ size 4114866
zipped_images/dall-e2/ambitious_civil_engineer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5699d100f1f80607dad37f45ed07216001db9e4d23e65f5c524a4fc9b37990bb
3
+ size 3711018
zipped_images/dall-e2/ambitious_claims_appraiser.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7794549460b7f8a8f7bcb16735afc2d24683b3d936a50976727e6a65f97ba5c3
3
+ size 3561397
zipped_images/dall-e2/ambitious_cleaner.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c4dcf25efc6d26972e3d1b5f7a91b9d450315a7c37fd8c975da8771eb20383b
3
+ size 3581085
zipped_images/dall-e2/ambitious_clergy.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31cd5743c10642152aaf6248fba3cbdd71ff65d99762e9ea84b301639227043f
3
+ size 3485145
zipped_images/dall-e2/ambitious_clerk.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6bd1fbebb6c7b079de1ffd1c0cbc4c7881269464955a495ed2169655c1d1d08a
3
+ size 3525916
zipped_images/dall-e2/ambitious_coach.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b268f9808f2b3a178872fc9327fae3898957a15c035152e2d87cad7d864c078
3
+ size 3567990
zipped_images/dall-e2/ambitious_community_manager.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0574dda179164f54313c03160a7fffbf87199da131915489fd03387dbfbc6cac
3
+ size 3792124
zipped_images/dall-e2/ambitious_compliance_officer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52c655d228326ea6572331a31076d6d008ea05131013adb63935d62f687d06bd
3
+ size 3707765
zipped_images/dall-e2/ambitious_computer_programmer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27d83ee43d1f410833fba2f44a010c81a94ce5f660f695c0bb962d8d9c838dc6
3
+ size 3882704
zipped_images/dall-e2/ambitious_computer_support_specialist.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5bbf882f8083339bea15fc4996db0c8d3b33145f5c68d693e8953e8c7e1e001
3
+ size 3719977
zipped_images/dall-e2/ambitious_computer_systems_analyst.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0c99de442cf8312258a5d91d43f6277ddd1fe4428b56a655c4ce59c7939f158
3
+ size 4094595
zipped_images/dall-e2/ambitious_construction_worker.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13b6ee8628dc3a05364e808a5242ac1aa1d3127d5d595e1d208a3cd17a258e7e
3
+ size 3761309
zipped_images/dall-e2/ambitious_cook.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c2d4ad142e06c3b0187ebb6942456e987e8c9b22de566bcffdbab0ffdc62682
3
+ size 3649328
zipped_images/dall-e2/ambitious_correctional_officer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcd3b4ab132d8526d98f4a3e622e2089b1b2dfa4f73c31f96d97813882667a96
3
+ size 3720284
zipped_images/dall-e2/ambitious_courier.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09033691e41eb5e0e316490d0dd4338c016d650265cb65ad4f19e44ef57bdce4
3
+ size 3535762
zipped_images/dall-e2/ambitious_credit_counselor.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87477810b04cb9c07a939e605f456afafb7e51287962bfe898a35b9cd02b94c5
3
+ size 3745272
zipped_images/dall-e2/ambitious_customer_service_representative.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d08fca4ac7463f800b4aa62ce942d3e4a1dfe09729537fe8c42061c870e964f
3
+ size 3695997
zipped_images/dall-e2/ambitious_data_entry_keyer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d4e8843842c0c2ede0cf0330771ba37d0c7f5b1ed100a81a80f7e6eac60e1c3
3
+ size 3756419
zipped_images/dall-e2/ambitious_dental_assistant.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa14df97a501bf21fcb079a323944f977df8e95242baf45671acc8c142825032
3
+ size 3707243
zipped_images/dall-e2/ambitious_dental_hygienist.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2811dbe13cd4d014d23168ad914daba53d61804f87ef7114d279f8fa85a65f5
3
+ size 3677233
zipped_images/dall-e2/ambitious_dentist.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3f861e48e693d62bde7be16ea9a4fb5e9e80b03ec78340463a2f01a5f45b321
3
+ size 3560793
zipped_images/dall-e2/ambitious_designer.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1464ecee4430182a2c217dd2481a9cebd4d31a6b8892325b519c0ed9afa1a24c
3
+ size 3736648