code / README.md
Laura Wagner
to commit or not commit that is the question
5f5806d
# Code for the Paper titled ["Perpetual Misogyny: How Gendered Tropes Shape Text-To-Image AI Personalization"](http://arxiv.org/pdf/2505.04600)
### Repository Structure
```
CIVITAI_VISUALIZATIONS/
β”œβ”€β”€ .virtual_documents/ # Temporary files from Jupyter
β”œβ”€β”€ data/ # Final curated datasets
β”‚ β”œβ”€β”€ subset1/ # Specific data splits or versions
β”‚ β”œβ”€β”€ subset2/
β”‚ └── ...
β”œβ”€β”€ misc/
β”‚ └── credentials/ # API keys and sensitive config (excluded from versioning)
β”œβ”€β”€ plots/ # Output plots and figures used in the paper
β”œβ”€β”€ β”œβ”€β”€ jupyter_notebooks/ # Main analysis notebooks
β”‚ β”œβ”€β”€ 0_Scraping_image_metadata.ipynb # Scrapes CivitAI metadata via API
β”‚ β”œβ”€β”€ Section_1_Figure_1_image_grid.ipynb # Grid of sample images
β”‚ β”œβ”€β”€ Section_3-2-1_Figure_3_histogram.ipynb # Histogram of upload trends
β”‚ β”œβ”€β”€ Section_3-2-1_Figure_4_Mivolo.ipynb # Model activity plot (Mivolo-focused)
β”‚ β”œβ”€β”€ Section_3-3-1_Figure_5_tags.ipynb # Tag frequency and usage visualizations
β”‚ β”œβ”€β”€ Section_3-3-3_download_popular_models.ipynb # Download models for analysis
β”‚ β”œβ”€β”€ Section_3-3-3_Figure_6.ipynb # Promotional tag usage patterns
β”‚ β”œβ”€β”€ Section_3-3-4_Figure_8a.ipynb # Ranking of popular models
β”‚ β”œβ”€β”€ Section_3-3-4_Figure_8b.ipynb # Continuation of model rankings
β”‚ β”œβ”€β”€ Section_3-3-4_Figure_9_Sankey.ipynb # Sankey diagram: user-model contributions
β”‚ β”œβ”€β”€ Section_3-3-4_LLM_annotation.ipynb # Annotations using large language models
β”‚ β”œβ”€β”€ Section_3-4_extract_LoRA_metadata.ipynb # LoRA metadata extraction
β”‚ β”œβ”€β”€ SuppM_Figure_12_Danbooru_Taxonomy.ipynb # Danbooru tag taxonomy: visualization
β”‚ β”œβ”€β”€ SuppM_Figure_13_Danbooru_taxonomy.ipynb # Tag grouping and structure
β”‚ └── SuppM_Figure_13.ipynb # Supplementary figure generation
β”œβ”€β”€ misc/ # Utility scripts and API credentials (excluded)
β”œβ”€β”€ plots/ # Output plots and visualizations
β”œβ”€β”€ public/ # Optional public-facing files
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .gitmodules
β”œβ”€β”€ README.md # This file
└── requirements.txt # Python dependencies
```
# Project Setup
## Requirements
This project requires Python 3.8 or higher. Ensure you have it installed before proceeding.
## Installation
1. **Clone the Repository**
```sh
git clone https://gitlab.uzh.ch/latent-canon/pm-paper.git
cd pm-paper
```
2. **Create a Virtual Environment**
(Recommended to avoid dependency conflicts)
```sh
python -m venv venv
source venv/bin/activate # On macOS/Linux
venv\Scripts\activate # On Windows
```
3. **Install Dependencies**
```sh
pip install -r requirements.txt
```
4. **Jupyter Notebook Setup (Optional)**
If running Jupyter notebooks, ensure the environment is linked:
```sh
python -m ipykernel install --user --name=venv --display-name "Python (venv)"
```
## Notes
- Ensure you have necessary system dependencies installed (e.g., `opencv` may require additional system libraries).
- If you encounter any issues, ensure you're using the correct Python environment (`venv` activated).