Demise307 commited on
Commit
e6df900
·
verified ·
1 Parent(s): ca29236

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
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
- gr.Image(type="pil", label="Input", value="images/a4960.jpg"),
153
- gr.Text(label="Prompt", value="my colors are too off, make it pop so I can use it in instagram")
154
  ],
155
- outputs=[gr.Image(type="pil", label="Ouput")],
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,