{"id":28505137,"url":"https://github.com/prs-eth/flair","last_synced_at":"2025-08-08T10:35:58.732Z","repository":{"id":297408871,"uuid":"995957810","full_name":"prs-eth/FLAIR","owner":"prs-eth","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-05T09:30:31.000Z","size":22375,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-05T10:30:30.721Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prs-eth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-04T08:50:07.000Z","updated_at":"2025-06-05T10:08:53.000Z","dependencies_parsed_at":"2025-06-05T10:43:54.504Z","dependency_job_id":null,"html_url":"https://github.com/prs-eth/FLAIR","commit_stats":null,"previous_names":["prs-eth/flair"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FFLAIR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FFLAIR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FFLAIR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FFLAIR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prs-eth","download_url":"https://codeload.github.com/prs-eth/FLAIR/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FFLAIR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258763630,"owners_count":22753753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-08T19:06:42.401Z","updated_at":"2025-08-08T10:35:58.719Z","avatar_url":"https://github.com/prs-eth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# FLAIR: Flow-Based Latent Alignment for Image Restoration\n\n**Julius Erbach\u003csup\u003e1,2\u003c/sup\u003e, Dominik Narnhofer\u003csup\u003e1\u003c/sup\u003e, Andreas Dombos\u003csup\u003e1\u003c/sup\u003e, Jan Eric Lenssen\u003csup\u003e2\u003c/sup\u003e, Bernt Schiele\u003csup\u003e2\u003c/sup\u003e, Konrad Schindler\u003csup\u003e1\u003c/sup\u003e**  \n\u003cbr\u003e\n\u003csup\u003e1\u003c/sup\u003e Photogrammetry and Remote Sensing, ETH Zurich  \n\u003csup\u003e2\u003c/sup\u003e Max Planck Institute for Informatics, Saarbrücken  \n\n[![Paper](https://img.shields.io/badge/arXiv-PDF-b31b1b)](https://arxiv.org/abs/2506.02680)\n[![Page](https://img.shields.io/badge/Project-Page-green)](https://inverseFLAIR.github.io)\n[![Hugging Face Space](https://img.shields.io/badge/🤗%20Hugging%20Face-Space-yellow)](https://huggingface.co/spaces/prs-eth/FLAIR)\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/teaser3.svg\" alt=\"teaser\" width=98%\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cemph\u003eFLAIR\u003c/emph\u003e is a novel approach for solving inverse imaging problems using flow-based posterior sampling.\n\u003c/p\u003e\n\n## Installation\n\n1.  Clone the repository:\n    ```bash\n    git clone git@github.com:prs-eth/FLAIR.git\n    cd FLAIR\n    ```\n\n2.  Create a virtual environment (recommended):\n    ```bash\n    python3 -m venv venv\n    source venv/bin/activate  \n    ```\n\n3.  Install the required dependencies from `requirements.txt`:\n    ```bash\n    pip install -r requirements.txt\n    pip install .\n    ```\n\n## Running Inference\n\nTo run inference, you can use one of the Python script run_image_inv.py with the according config file.\nAn example from the FFQH dataset\n```bash\npython 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\"\n```\nOr 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.\n\n```bash\npython 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.npy\n```\n\n```bash\npython 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\"\n```\n\n## Citation\n\nIf you find this work useful in your research, please cite our paper:\n\n```bibtex\n@article{erbach2025solvinginverseproblemsflair,\n      title={Solving Inverse Problems with FLAIR}, \n      author={Julius Erbach and Dominik Narnhofer and Andreas Dombos and Bernt Schiele and Jan Eric Lenssen and Konrad Schindler},\n      year={2025},\n      eprint={2506.02680},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV},\n      url={https://arxiv.org/abs/2506.02680}, \n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprs-eth%2Fflair","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprs-eth%2Fflair","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprs-eth%2Fflair/lists"}