Skip to content

Merging addtional python scripts to main #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Gemini_images/Gemini_Doctor_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_13.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_14.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_15.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_16.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_17.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_18.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_19.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_20.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_21.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_22.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_23.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_24.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_25.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Doctor_9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Lawyer_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Lawyer_10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Lawyer_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Lawyer_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Lawyer_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Lawyer_5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Lawyer_6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Lawyer_7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Lawyer_8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Lawyer_9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Nurse_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Nurse_10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Nurse_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Nurse_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Nurse_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Nurse_5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Nurse_6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Nurse_7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Nurse_8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Nurse_9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Professor_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Professor_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_13.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_14.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_15.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_16.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_17.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_18.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_19.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_20.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_21.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_22.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_23.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_24.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_25.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Student_9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Teacher_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Teacher_10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Teacher_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Teacher_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Teacher_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Teacher_5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Teacher_6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Teacher_7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Teacher_8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gemini_images/Gemini_Teacher_9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
216 changes: 216 additions & 0 deletions analyzed_images

Large diffs are not rendered by default.

106 changes: 106 additions & 0 deletions exploreData.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
def main():
image_data = pd.read_csv("analyzed_images")

chatGPT_dict = {'Student':{"num_men":0,"num_women":0,"total_conf_man":0,"total_conf_woman":0},
'Lawyer':{"num_men":0,"num_women":0,"total_conf_man":0,"total_conf_woman":0},
'Nurse':{"num_men":0,"num_women":0,"total_conf_man":0,"total_conf_woman":0}}
gemini_dict = {'Student':{"num_men":0,"num_women":0,"total_conf_man":0,"total_conf_woman":0},
'Lawyer':{"num_men":0,"num_women":0,"total_conf_man":0,"total_conf_woman":0},
'Nurse':{"num_men":0,"num_women":0,"total_conf_man":0,"total_conf_woman":0}}
DALLE_dict = {'Student':{"num_men":0,"num_women":0,"total_conf_man":0,"total_conf_woman":0},
'Lawyer':{"num_men":0,"num_women":0,"total_conf_man":0,"total_conf_woman":0},
'Nurse':{"num_men":0,"num_women":0,"total_conf_man":0,"total_conf_woman":0}}



for index, img in image_data.iterrows():

if img['Model'] == 'ChatGPT':
chatGPT_dict[img['Occupation']]['total_conf_man'] += img['Man']
chatGPT_dict[img['Occupation']]['total_conf_woman'] += img['Woman']
if img['dominant gender'] == 'Man':
chatGPT_dict[img['Occupation']]['num_men'] += 1
else:
chatGPT_dict[img['Occupation']]['num_women'] += 1

elif img['Model'] == 'DALL-E':
DALLE_dict[img['Occupation']]['total_conf_man'] += img['Man']
DALLE_dict[img['Occupation']]['total_conf_woman'] += img['Woman']
if img['dominant gender'] == 'Man':
DALLE_dict[img['Occupation']]['num_men'] += 1
else:
DALLE_dict[img['Occupation']]['num_women'] += 1

elif img['Model'] == 'Gemini':
gemini_dict[img['Occupation']]['total_conf_man'] += img['Man']
gemini_dict[img['Occupation']]['total_conf_woman'] += img['Woman']
if img['dominant gender'] == 'Man':
gemini_dict[img['Occupation']]['num_men'] += 1
else:
gemini_dict[img['Occupation']]['num_women'] += 1

total_student = chatGPT_dict['Student']['num_men'] + chatGPT_dict['Student']['num_women']
total_lawyer = chatGPT_dict['Lawyer']['num_men'] + chatGPT_dict['Lawyer']['num_women']
total_nurse = chatGPT_dict['Nurse']['num_men'] + chatGPT_dict['Nurse']['num_women']

print("ChatGPT")
print("-------------------------------------------------------------------------------------")
print("Occupation, \tMan%, \tWoman%, \tAvg Confedence M, \tAvg Confedence W")
print(f"Studemt: \t{(chatGPT_dict['Student']['num_men']/total_student)*100}%, \t{(chatGPT_dict['Student']['num_women']/total_student)*100}%, \t{chatGPT_dict['Student']['total_conf_man']/total_student}, \t{chatGPT_dict['Student']['total_conf_woman']/total_student}")
print(f"Nurse: \t{(chatGPT_dict['Nurse']['num_men']/total_nurse)*100}%, \t{(chatGPT_dict['Nurse']['num_women']/total_nurse)*100}%, \t{chatGPT_dict['Nurse']['total_conf_man']/total_nurse}, \t{chatGPT_dict['Nurse']['total_conf_woman']/total_nurse}")
print(f"Lawyer: \t{(chatGPT_dict['Lawyer']['num_men']/total_lawyer)*100}%, \t{(chatGPT_dict['Lawyer']['num_women']/total_lawyer)*100}%, \t{chatGPT_dict['Lawyer']['total_conf_man']/total_lawyer}, \t{chatGPT_dict['Lawyer']['total_conf_woman']/total_lawyer}\n")

total_student = DALLE_dict['Student']['num_men'] + DALLE_dict['Student']['num_women']
total_lawyer = DALLE_dict['Lawyer']['num_men'] + DALLE_dict['Lawyer']['num_women']
total_nurse = DALLE_dict['Nurse']['num_men'] + DALLE_dict['Nurse']['num_women']


print("DALL-E")
print("-------------------------------------------------------------------------------------")
print("Occupation, \tMan%, \tWoman%, \tAvg Confedence M, \tAvg Confedence W")
print(f"Studemt: \t{(DALLE_dict['Student']['num_men']/total_student)*100}%, \t{(DALLE_dict['Student']['num_women']/total_student)*100}%, \t{DALLE_dict['Student']['total_conf_man']/total_student}, \t{DALLE_dict['Student']['total_conf_woman']/total_student}")
print(f"Nurse: \t{(DALLE_dict['Nurse']['num_men']/total_nurse)*100}%, \t{(DALLE_dict['Nurse']['num_women']/total_nurse)*100}%, \t{DALLE_dict['Nurse']['total_conf_man']/total_nurse}, \t{DALLE_dict['Nurse']['total_conf_woman']/total_nurse}")
print(f"Lawyer: \t{(DALLE_dict['Lawyer']['num_men']/total_lawyer)*100}%, \t{(DALLE_dict['Lawyer']['num_women']/total_lawyer)*100}%, \t{DALLE_dict['Lawyer']['total_conf_man']/total_lawyer}, \t{DALLE_dict['Lawyer']['total_conf_woman']/total_lawyer}\n")

total_student = gemini_dict['Student']['num_men'] + gemini_dict['Student']['num_women']
total_lawyer = gemini_dict['Lawyer']['num_men'] + gemini_dict['Lawyer']['num_women']
total_nurse = gemini_dict['Nurse']['num_men'] + gemini_dict['Nurse']['num_women']


print("Gemini")
print("-------------------------------------------------------------------------------------")
print("Occupation, \tMan%, \tWoman%, \tAvg Confedence M, \tAvg Confedence W")
print(f"Studemt: \t{(gemini_dict['Student']['num_men']/total_student)*100}%, \t{(gemini_dict['Student']['num_women']/total_student)*100}%, \t{gemini_dict['Student']['total_conf_man']/total_student}, \t{gemini_dict['Student']['total_conf_woman']/total_student}")
print(f"Nurse: \t{(gemini_dict['Nurse']['num_men']/total_nurse)*100}%, \t{(gemini_dict['Nurse']['num_women']/total_nurse)*100}%, \t{gemini_dict['Nurse']['total_conf_man']/total_nurse}, \t{gemini_dict['Nurse']['total_conf_woman']/total_nurse}")
print(f"Lawyer: \t{(gemini_dict['Lawyer']['num_men']/total_lawyer)*100}%, \t{(gemini_dict['Lawyer']['num_women']/total_lawyer)*100}%, \t{gemini_dict['Lawyer']['total_conf_man']/total_lawyer}, \t{gemini_dict['Lawyer']['total_conf_woman']/total_lawyer}\n")

print("Standard Deviations")
print("---------------------Dominant gender Man----------------------")
print("ChatGPT Student: "+str(image_data.loc[image_data['Model']=='ChatGPT'].loc[image_data['Occupation']=='Student'].loc[image_data['dominant gender']=='Man']['Man'].std()))
print("ChatGPT Nurse: "+str(image_data.loc[image_data['Model']=='ChatGPT'].loc[image_data['Occupation']=='Nurse'].loc[image_data['dominant gender']=='Man']['Man'].std()))
print("ChatGPT Lawyer: "+str(image_data.loc[image_data['Model']=='ChatGPT'].loc[image_data['Occupation']=='Lawyer'].loc[image_data['dominant gender']=='Man']['Man'].std()))
print("DALL-E Student: "+str(image_data.loc[image_data['Model']=='DALL-E'].loc[image_data['Occupation']=='Student'].loc[image_data['dominant gender']=='Man']['Man'].std()))
print("DALL-E Nurse: "+str(image_data.loc[image_data['Model']=='DALL-E'].loc[image_data['Occupation']=='Nurse'].loc[image_data['dominant gender']=='Man']['Man'].std()))
print("DALL-E Lawyer: "+str(image_data.loc[image_data['Model']=='DALL-E'].loc[image_data['Occupation']=='Lawyer'].loc[image_data['dominant gender']=='Man']['Man'].std()))
print("Gemini Student: "+str(image_data.loc[image_data['Model']=='Gemini'].loc[image_data['Occupation']=='Student'].loc[image_data['dominant gender']=='Man']['Man'].std()))
print("Gemini Nurse: "+str(image_data.loc[image_data['Model']=='Gemini'].loc[image_data['Occupation']=='Nurse'].loc[image_data['dominant gender']=='Man']['Man'].std()))
print("Gemini Lawyer: "+str(image_data.loc[image_data['Model']=='Gemini'].loc[image_data['Occupation']=='Lawyer'].loc[image_data['dominant gender']=='Man']['Man'].std()))
print("---------------------Dominant gender Woman--------------------")
print("ChatGPT Student: "+str(image_data.loc[image_data['Model']=='ChatGPT'].loc[image_data['Occupation']=='Student'].loc[image_data['dominant gender']=='Woman']['Woman'].std()))
print("ChatGPT Nurse: "+str(image_data.loc[image_data['Model']=='ChatGPT'].loc[image_data['Occupation']=='Nurse'].loc[image_data['dominant gender']=='Woman']['Woman'].std()))
print("ChatGPT Lawyer: "+str(image_data.loc[image_data['Model']=='ChatGPT'].loc[image_data['Occupation']=='Lawyer'].loc[image_data['dominant gender']=='Woman']['Woman'].std()))
print("DALL-E Student: "+str(image_data.loc[image_data['Model']=='DALL-E'].loc[image_data['Occupation']=='Student'].loc[image_data['dominant gender']=='Woman']['Woman'].std()))
print("DALL-E Nurse: "+str(image_data.loc[image_data['Model']=='DALL-E'].loc[image_data['Occupation']=='Nurse'].loc[image_data['dominant gender']=='Woman']['Woman'].std()))
print("DALL-E Lawyer: "+str(image_data.loc[image_data['Model']=='DALL-E'].loc[image_data['Occupation']=='Lawyer'].loc[image_data['dominant gender']=='Woman']['Woman'].std()))
print("Gemini Student: "+str(image_data.loc[image_data['Model']=='Gemini'].loc[image_data['Occupation']=='Student'].loc[image_data['dominant gender']=='Woman']['Woman'].std()))
print("Gemini Nurse: "+str(image_data.loc[image_data['Model']=='Gemini'].loc[image_data['Occupation']=='Nurse'].loc[image_data['dominant gender']=='Woman']['Woman'].std()))
print("Gemini Lawyer: "+str(image_data.loc[image_data['Model']=='Gemini'].loc[image_data['Occupation']=='Lawyer'].loc[image_data['dominant gender']=='Woman']['Woman'].std()))
#print(image_data.loc[image_data['Model']=='ChatGPT'].loc[image_data['Occupation']=='Student'].loc[image_data['dominant gender']=='Man']['Man'].std())

#["Man"].std()
#
if __name__ == "__main__":
main()
46 changes: 46 additions & 0 deletions imagesToCSV.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from deepface import DeepFace
import csv
import os

def main():
with open("analyzed_images",'w') as csv_file:

field_names = ["Model","Occupation","File Name","asian","indian","black","white","middle eastern","latino hispanic","dominant race","age",
"Woman","Man","dominant gender","angry","disgust","fear","happy","sad","surprise","neutral","dominant emotion"]

writer = csv.DictWriter(csv_file, fieldnames=field_names)

writer.writeheader()

for model in os.listdir("AI_Images"):
for occ in os.listdir("AI_Images/"+model):
for img in os.listdir("AI_Images/"+model+"/"+occ):
result = DeepFace.analyze("AI_Images/"+model+"/"+occ+"/"+img, actions=['race','age','gender','emotion'],enforce_detection=False)[0]

writer.writerow({"Model" : model,
"Occupation" : occ,
"File Name" : img,
"asian" : result["race"]["asian"],
"indian": result["race"]["indian"],
"black" : result["race"]["black"],
"white" : result["race"]["white"],
"middle eastern" : result["race"]["middle eastern"],
"latino hispanic" : result["race"]["latino hispanic"],
"dominant race" : result["dominant_race"],
"age" : result["age"],
"Woman" : result["gender"]["Woman"],
"Man" : result["gender"]["Man"],
"dominant gender" : result["dominant_gender"],
"angry" : result["emotion"]["angry"],
"disgust" : result["emotion"]["disgust"],
"fear" : result["emotion"]["fear"],
"happy" : result["emotion"]["happy"],
"sad" : result["emotion"]["sad"],
"surprise" : result["emotion"]["surprise"],
"neutral" : result["emotion"]["neutral"],
"dominant emotion" : result["dominant_emotion"]})

#print(DeepFace.analyze("image2.png", actions=['race','age','gender','emotion'])[0])

if __name__ == "__main__":
main()
7 changes: 7 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from deepface import DeepFace

def main():
print(DeepFace.analyze("image.png", actions=['race','age','gender','emotion'])[0]["emotion"]["surprise"])

if __name__ == "__main__":
main()