Spaces:
Running
on
T4
Running
on
T4
mv-lab
commited on
Commit
•
110d9e4
1
Parent(s):
d5b9c19
improve demo
Browse files- app.py +12 -10
- images/GOPR0871_11_00-000075-min.png +0 -0
- images/a4960.jpg +0 -0
- images/a4972.jpg +0 -0
- images/lol_1.png +0 -0
- images/lol_22.png +0 -0
app.py
CHANGED
@@ -103,13 +103,11 @@ Image restoration is a fundamental problem that involves recovering a high-quali
|
|
103 |
</p>
|
104 |
</details>
|
105 |
|
106 |
-
> **Disclaimer:** please remember this is not a product, thus, you will notice some limitations.
|
107 |
-
**
|
108 |
-
|
109 |
-
The model was trained using mostly synthetic data, thus it might not work great on real-world complex images.
|
110 |
-
However, it works surprisingly well on real-world foggy and low-light images.
|
111 |
-
You can also try general image enhancement prompts (e.g., "retouch this image", "enhance the colors") and see how it improves the colors.
|
112 |
|
|
|
113 |
<br>
|
114 |
'''
|
115 |
|
@@ -117,13 +115,17 @@ You can also try general image enhancement prompts (e.g., "retouch this image",
|
|
117 |
article = "<p style='text-align: center'><a href='https://github.com/mv-lab/InstructIR' target='_blank'>High-Quality Image Restoration Following Human Instructions</a></p>"
|
118 |
|
119 |
#### Image,Prompts examples
|
120 |
-
examples = [['images/
|
|
|
121 |
['images/gradio_demo_images/city.jpg', "I took this photo during a foggy day, can you improve it?"],
|
122 |
['images/gradio_demo_images/frog.png', "can you remove the tiny dots in the image? it is very unpleasant"],
|
123 |
["images/lol_748.png", "my image is too dark, I cannot see anything, can you fix it?"],
|
|
|
124 |
["images/gopro.png", "I took this photo while I was running, can you stabilize the image? it is too blurry"],
|
|
|
125 |
["images/a0010.jpg", "please I want this image for my photo album, can you edit it as a photographer"],
|
126 |
-
["images/real_fog.png", "How can I remove the fog and mist from this photo?"]
|
|
|
127 |
|
128 |
css = """
|
129 |
.image-frame img, .image-container img {
|
@@ -136,8 +138,8 @@ css = """
|
|
136 |
demo = gr.Interface(
|
137 |
fn=process_img,
|
138 |
inputs=[
|
139 |
-
gr.Image(type="pil", label="Input"),
|
140 |
-
gr.Text(label="Prompt")
|
141 |
],
|
142 |
outputs=[gr.Image(type="pil", label="Ouput")],
|
143 |
title=title,
|
|
|
103 |
</p>
|
104 |
</details>
|
105 |
|
106 |
+
> **Disclaimer:** please remember this is not a product, thus, you will notice some limitations. Due to the GPU memory limitations, the app might crash if you feed a high-resolution image (2K, 4K). <br>
|
107 |
+
**The model was trained using mostly synthetic data, thus it might not work great on real-world complex images.**
|
108 |
+
You can also try general image enhancement prompts (e.g., "retouch this image", "enhance the colors") and see how it improves the colors. As you can see, the model is quite efficient.
|
|
|
|
|
|
|
109 |
|
110 |
+
**Datasets:** We use these datasets BSD100, BSD68, Urban100, WED, Rain100, Aobe MIT5K, LOL, GoPro, SOTS (haze). This demo expects an image with some degradations (blur, noise, rain, low-light, haze).
|
111 |
<br>
|
112 |
'''
|
113 |
|
|
|
115 |
article = "<p style='text-align: center'><a href='https://github.com/mv-lab/InstructIR' target='_blank'>High-Quality Image Restoration Following Human Instructions</a></p>"
|
116 |
|
117 |
#### Image,Prompts examples
|
118 |
+
examples = [['images/a4960.jpg', "my colors are too off, make it pop so I can use it in instagram"],
|
119 |
+
['images/rain-020.png', "I love this photo, could you remove the raindrops? please keep the content intact"],
|
120 |
['images/gradio_demo_images/city.jpg', "I took this photo during a foggy day, can you improve it?"],
|
121 |
['images/gradio_demo_images/frog.png', "can you remove the tiny dots in the image? it is very unpleasant"],
|
122 |
["images/lol_748.png", "my image is too dark, I cannot see anything, can you fix it?"],
|
123 |
+
["images/lol_22.png", "Increase the brightness of my photo please, I want to see totoro"],
|
124 |
["images/gopro.png", "I took this photo while I was running, can you stabilize the image? it is too blurry"],
|
125 |
+
["images/GOPR0871_11_00-000075-min.png", "Correct the motion blur in this image so it is more clear"],
|
126 |
["images/a0010.jpg", "please I want this image for my photo album, can you edit it as a photographer"],
|
127 |
+
["images/real_fog.png", "How can I remove the fog and mist from this photo?"]
|
128 |
+
]
|
129 |
|
130 |
css = """
|
131 |
.image-frame img, .image-container img {
|
|
|
138 |
demo = gr.Interface(
|
139 |
fn=process_img,
|
140 |
inputs=[
|
141 |
+
gr.Image(type="pil", label="Input", value="images/a4960.jpg"),
|
142 |
+
gr.Text(label="Prompt", value="my colors are too off, make it pop so I can use it in instagram")
|
143 |
],
|
144 |
outputs=[gr.Image(type="pil", label="Ouput")],
|
145 |
title=title,
|
images/GOPR0871_11_00-000075-min.png
ADDED
images/a4960.jpg
ADDED
images/a4972.jpg
ADDED
images/lol_1.png
DELETED
Binary file (346 kB)
|
|
images/lol_22.png
ADDED