Spaces:
				
			
			
	
			
			
		Running
		
			on 
			
			Zero
	
	
	
			
			
	
	
	
	
		
		
		Running
		
			on 
			
			Zero
	updated readme with versions
Browse files
    	
        README.md
    CHANGED
    
    | @@ -1,70 +1,10 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
             | 
| 3 | 
            -
             | 
| 4 | 
            -
             | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
             | 
| 11 | 
            -
            [](inverseFLAIR.github.io)
         | 
| 12 | 
            -
            [](link)
         | 
| 13 | 
            -
            </div>
         | 
| 14 | 
            -
             | 
| 15 | 
            -
            <p align="center">
         | 
| 16 | 
            -
              <img src="assets/teaser3.svg" alt="teaser" width=98%"/>
         | 
| 17 | 
            -
            </p>
         | 
| 18 | 
            -
            <p align="center">
         | 
| 19 | 
            -
              <emph>FLAIR</emph> is a novel approach for solving inverse imaging problems using flow-based posterior sampling.
         | 
| 20 | 
            -
            </p>
         | 
| 21 | 
            -
             | 
| 22 | 
            -
            ## Installation
         | 
| 23 | 
            -
             | 
| 24 | 
            -
            1.  Clone the repository:
         | 
| 25 | 
            -
                ```bash
         | 
| 26 | 
            -
                git clone <your-repo-url>
         | 
| 27 | 
            -
                cd <your-repo-name>
         | 
| 28 | 
            -
                ```
         | 
| 29 | 
            -
             | 
| 30 | 
            -
            2.  Create a virtual environment (recommended):
         | 
| 31 | 
            -
                ```bash
         | 
| 32 | 
            -
                python3 -m venv venv
         | 
| 33 | 
            -
                source venv/bin/activate  
         | 
| 34 | 
            -
                ```
         | 
| 35 | 
            -
             | 
| 36 | 
            -
            3.  Install the required dependencies from `requirements.txt`:
         | 
| 37 | 
            -
                ```bash
         | 
| 38 | 
            -
                pip install -r requirements.txt
         | 
| 39 | 
            -
                pip install .
         | 
| 40 | 
            -
                ```
         | 
| 41 | 
            -
             | 
| 42 | 
            -
            ## Running Inference
         | 
| 43 | 
            -
             | 
| 44 | 
            -
            To run inference, you can use one of the Python script run_image_inv.py with the according config file.
         | 
| 45 | 
            -
            An example from the FFQH dataset
         | 
| 46 | 
            -
            ```bash
         | 
| 47 | 
            -
            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"
         | 
| 48 | 
            -
            ```
         | 
| 49 | 
            -
            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.
         | 
| 50 | 
            -
             | 
| 51 | 
            -
            ```bash
         | 
| 52 | 
            -
            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.npy
         | 
| 53 | 
            -
            ```
         | 
| 54 | 
            -
             | 
| 55 | 
            -
            ```bash
         | 
| 56 | 
            -
            python 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"
         | 
| 57 | 
            -
            ```
         | 
| 58 | 
            -
             | 
| 59 | 
            -
            ## Citation
         | 
| 60 | 
            -
             | 
| 61 | 
            -
            If you find this work useful in your research, please cite our paper:
         | 
| 62 | 
            -
             | 
| 63 | 
            -
            ```bibtex
         | 
| 64 | 
            -
            @article{er2025solving,
         | 
| 65 | 
            -
              title={Solving Inverse Problems with FLAIR},
         | 
| 66 | 
            -
              author={Erbach, Julius and Narnhofer, Dominik and Dombos, Andreas and Lenssen, Jan Eric and Schiele, Bernt and Schindler, Konrad},
         | 
| 67 | 
            -
              journal={arXiv},
         | 
| 68 | 
            -
              year={2025}
         | 
| 69 | 
            -
            }
         | 
| 70 | 
            -
            ```
         | 
|  | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            title: Solving Inverse Problems with FLAIR
         | 
| 3 | 
            +
            emoji: 🎨
         | 
| 4 | 
            +
            colorFrom: blue
         | 
| 5 | 
            +
            colorTo: red
         | 
| 6 | 
            +
            sdk: gradio
         | 
| 7 | 
            +
            sdk_version: 5.32.1
         | 
| 8 | 
            +
            app_file: app.py
         | 
| 9 | 
            +
            pinned: false
         | 
| 10 | 
            +
            ---
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
