This repo provides the code for the paper "Gender Artifacts in Visual Datasets."
@article{meister2022artifacts,
author = {Nicole Meister and Dora Zhao and Angelina Wang and Vikram V. Ramaswamy and Ruth Fong and Olga Russakovsky},
title = {Gender Artifacts in Visual Datasetsi},
journal = {CoRR},
volume = {abs/2206.09191},
year={2022}
}
conda create -n genderartifacts python=3.9
conda activate genderartifacts
conda install --file requirements.txt
Download the annotations from the following sources and place them in data/{dataset_name}
.
wget http://images.cocodataset.org/annotations/annotations_trainval2014.zip
Follow the instructions from the OpenImage website (copied below):
- Download the downloader (open and press Ctrl + S), or directly run:
wget https://raw.githubusercontent.com/openimages/dataset/master/downloader.py
- Run the following script, where $IMAGE_LIST_FILE is one of the files with image key lists above:
python downloader.py $IMAGE_LIST_FILE --download_folder=$DOWNLOAD_FOLDER --num_processes=5
TBD
The files are located in src/person_scene
. To generate the image manipulations in the paper, use the following scripts:
(* denotes available only for COCO)
Name | Script |
---|---|
Full NoBg | python image_manipulations.py --type full |
MaskSegm* | python image_manipulations.py --type segm --background |
MaskRect | python image_manipulations.py --type rect --background |
MaskSegm NoBg* | python image_manipulations.py --type segm |
MaskRect NoBg | python image_manipulations.py --type rect |
Note: make sure to specify the arguments --dataset $DATA --filepath $PATH --annotations $ANN --split $SPLIT as well.
To train and evaluate the gender cue model, run the following scripts
Train: bash train.sh $TRAIN_LABEL_PATH $VAL_LABEL_PATH
Evaluate: bash eval.sh $MODEL_PATH $TEST_LABEL_PATH