File size: 1,388 Bytes
7d71d16
 
 
 
 
 
 
 
 
 
 
670b17b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d0a9518
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
title: PinPoint
emoji: 😻
colorFrom: gray
colorTo: pink
sdk: static
pinned: false
license: mit
short_description: code for the submission 1386
---

# Pinpoint Counterfactuals: localized gender counterfactual generation (NeurIPS 2025 Datasets and Benchmarks track. Submission 1386)

## Getting started

To generate PinPoint Counterfactuals, take the following steps.

### Download the data

First, download the <a href="https://ai.meta.com/datasets/facet-downloads/">FACET</a> and <a href="https://ai.google.com/research/ConceptualCaptions/download">CC3M</a> dataset. Unpack them in the directory of your choice.

### Generating PP masks

Use the `Color-Invariant-Skin-Segmentation` module to generate masks, following the methodology outlined in the main submission manuscript.

### In-paint the images

Use the `BrushNet` module to in-paint the images from FACET and/or CC3M (see the respective scripts in `BrushNet/examples/brushnet/inapaint_*.py`.


## Zero-shot classification

Use the `zero_shot_classification.py` script to test the occupation classification accuracy of different CLIP models (for different in-painting setups, i.e. PP, PP*, WB, etc.). To run it, first install PyTorch and the following dependencies:
`pip install open_clip`
`pip install git+https://github.com/openai/CLIP.git`
`pip install tqdm`
`pip install numpy`
`pip install pandas`
`pip install pillow`