Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,6 +83,11 @@ def process_img (image, prompt):
|
|
| 83 |
restored_img = (restored_img * 255.0).round().astype(np.uint8) # float32 to uint8
|
| 84 |
return Image.fromarray(restored_img) #(image, Image.fromarray(restored_img))
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
|
| 88 |
title = "InstructIR ✏️🖼️ 🤗"
|
|
@@ -149,10 +154,10 @@ css = """
|
|
| 149 |
demo = gr.Interface(
|
| 150 |
fn=process_img,
|
| 151 |
inputs=[
|
| 152 |
-
|
| 153 |
-
|
| 154 |
],
|
| 155 |
-
outputs=[gr.Image(type="pil", label="
|
| 156 |
title=title,
|
| 157 |
description=description,
|
| 158 |
article=article,
|
|
|
|
| 83 |
restored_img = (restored_img * 255.0).round().astype(np.uint8) # float32 to uint8
|
| 84 |
return Image.fromarray(restored_img) #(image, Image.fromarray(restored_img))
|
| 85 |
|
| 86 |
+
output_image = Image.fromarray(restored_img)
|
| 87 |
+
output_image.format = "PNG"
|
| 88 |
+
|
| 89 |
+
return output_image
|
| 90 |
+
|
| 91 |
|
| 92 |
|
| 93 |
title = "InstructIR ✏️🖼️ 🤗"
|
|
|
|
| 154 |
demo = gr.Interface(
|
| 155 |
fn=process_img,
|
| 156 |
inputs=[
|
| 157 |
+
gr.Image(type="pil", label="Input", value="images/a4960.jpg"),
|
| 158 |
+
gr.Text(label="Prompt", value="my colors are too off, make it pop so I can use it in instagram")
|
| 159 |
],
|
| 160 |
+
outputs=[gr.Image(type="pil", image_mode="RGB", format="png", label="Output")],
|
| 161 |
title=title,
|
| 162 |
description=description,
|
| 163 |
article=article,
|