Julius Erbach1,2, Dominik Narnhofer1, Andreas Dombos1, Jan Eric Lenssen2, Bernt Schiele2, Konrad Schindler1
1 Photogrammetry and Remote Sensing, ETH Zurich
2 Max Planck Institute for Informatics, Saarbrücken
FLAIR is a novel approach for solving inverse imaging problems using flow-based posterior sampling.
-
Clone the repository:
git clone [email protected]:prs-eth/FLAIR.git cd FLAIR
-
Create a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate -
Install the required dependencies from
requirements.txt:pip install -r requirements.txt pip install .
To run inference, you can use one of the Python script run_image_inv.py with the according config file. An example from the FFQH dataset
python inference_scripts/run_image_inv.py --config configs/inpainting.yaml --target_file examples/girl.png --result_folder output --prompt="a high quality photo of a face"Or an example from the DIV2K dataset with captions provided by DAPE using the degraded input. The masks can be defined as rectanlge coordinates in the config file or provided as .npy file where true pixels are observed and false are masked out.
python inference_scripts/run_image_inv.py --config configs/inpainting.yaml --target_file examples/sunflowers.png --result_folder output --prompt="a high quality photo of bloom, blue, field, flower, sky, sunflower, sunflower field, yellow" --mask_file DIV2k_mask.npypython inference_scripts/run_image_inv.py --config configs/x12.yaml --target_file examples/sunflowers.png --result_folder output --prompt="a high quality photo of bloom, blue, field, flower, sky, sunflower, sunflower field, yellow"If you find this work useful in your research, please cite our paper:
@article{erbach2025solvinginverseproblemsflair,
title={Solving Inverse Problems with FLAIR},
author={Julius Erbach and Dominik Narnhofer and Andreas Dombos and Bernt Schiele and Jan Eric Lenssen and Konrad Schindler},
year={2025},
eprint={2506.02680},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2506.02680},
}