The official implementation for the Neurips 2025 paper "Mind-the-Glitch: Visual Correspondence for Detecting Inconsistencies in Subject-Driven Image Generation"
- Model Release - Pre-trained MTG model weights and inference code
- Training Code - Training scripts and configuration files
- Training Dataset - Automated dataset generation pipeline and curated dataset
- Evaluation Benchmark - Benchmark evaluation code and metrics
- Python 3.8+
- CUDA-compatible GPU (recommended)
- Clone the repository with submodules:
git clone --recursive https://github.com/abdo-eldesokey/mind-the-glitch.git
cd mind-the-glitch- Create and activate a conda environment:
conda create -n mtg python=3.11
conda activate mtg- Install PyTorch with CUDA support:
pip install torch==2.5.1 torchvision==0.20.1 --index-url https://download.pytorch.org/whl/cu124- Install remaining dependencies:
pip install -r requirements.txt- Initialize submodules (if not cloned recursively):
git submodule update --init --recursive- Install Grounded-Segment-Anything:
git clone https://github.com/IDEA-Research/Grounded-Segment-Anything.git
cd Grounded-Segment-Anything
pip install --no-build-isolation -e GroundingDINO
cd ..The easiest way to get started with Mind-the-Glitch is through our interactive playground notebook:
jupyter notebook notebooks/playground.ipynbThis notebook demonstrates:
- Loading the pre-trained MTG model
- Running inference on sample images
- Visualizing the disentangled features and visual correspondence.
If you find this work useful for your research, please cite our paper:
@inproceedings{eldesokey2025mindtheglitch,
title={Mind-the-Glitch: Visual Correspondence for Detecting Inconsistencies in Subject-Driven Generation},
author={Eldesokey, Abdelrahman and Cvejic, Aleksandar and Ghanem, Bernard and Wonka, Peter},
booktitle={Advances in Neural Information Processing Systems},
year={2025}
}