This repository contains supplementary code for the paper Social perception of faces in a vision-language model authored by Carina Hausladen, Manuel Knott, Colin Camerer, and Pietro Perona.
We used Python 3.10 for this project. Please make sure to install the necessary dependencies by running:
pip install -r requirements.txt
data/
: directory where raw data is expecteddatasets/
: dataset implementationsresults/
: contains csv files with precalculated cosine similaritiesanalysis/
: use precalculations fromresults
folder for analysis and plotsplots/
,tables/
: output folder for plots/tablesmisc/
: miscellaneous scripts for secondary analysisattributes_models.py
: contains definitions of textual content models
To precalculate cosine similarities between all pairs of images and texts, run the following script.
Per default, OpenAI's CLIP ViT-B/32 model is used. To use a different model, change the model
variable in the script.
python precalculate_cossims.py
Our precalculate cosine similarities for CLIP ViT-B/32 can be downloaded here.
This folder should be placed in the results
directory.
If you want to reproduce results with the original image datasets, please request them from the original sources.
To reproduce the results from the paper, run the scripts in the analysis
folder.
All scripts require the precalculated cosine similarities from the results
folder.
To resolve file paths, all scripts should be run from the root directory of this repository.
If you find this project useful, please consider citing our preprint:
@article{hausladen2024social,
title={Social perception of faces in a vision-language model},
author={Hausladen, Carina I and Knott, Manuel and Camerer, Colin F and Perona, Pietro},
journal={arXiv preprint arXiv:2408.14435},
year={2024}
}