File size: 1,216 Bytes
642d805
7f43945
642d805
7f43945
 
 
642d805
7f43945
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import gradio as gr
from inference import infer

def greet(image, prompt):
    restore_img = infer(img=image, text_prompt=prompt)
    return restore_img


title = "🖼️ ICDR 🖼️"
description = ''' ## ICDR: Image Restoration Framework for Composite Degradation following Human Instructions
Our Github : https://github.com/

Siwon Kim, Donghyeon Yoon

Ajou Univ
'''


article = "<p style='text-align: center'><a href='https://github.com/' target='_blank'>ICDR</a></p>"

#### Image,Prompts examples
examples = [['input/00010.png', "I love this photo, could you remove the haze and more brighter?"],
            ['input/00058.png', "I have to post an emotional shot on Instagram, but it was shot too foggy and too dark. Change it like a sunny day and brighten it up!"]]

css = """
    .image-frame img, .image-container img {
        width: auto;
        height: auto;
        max-width: none;
    }
"""


demo = gr.Interface(
    fn=greet, 
    inputs=[gr.Image(type="pil", label="Input"),
            gr.Text(label="Prompt") ],
    outputs=[gr.Image(type="pil", label="Ouput")],
    title=title,
    description=description,
    article=article,
    examples=examples,
    css=css,
    )
demo.launch(share=True)