Spaces:
Running
on
T4
Running
on
T4
Update requirements.txt
#1
by
ysharma
HF staff
- opened
- app.py +3 -4
- requirements.txt +1 -1
app.py
CHANGED
@@ -7,7 +7,7 @@ import torch
|
|
7 |
import numpy as np
|
8 |
import yaml
|
9 |
from huggingface_hub import hf_hub_download
|
10 |
-
|
11 |
|
12 |
## local code
|
13 |
from models import instructir
|
@@ -80,8 +80,7 @@ def process_img (image, prompt):
|
|
80 |
restored_img = np.clip(restored_img, 0. , 1.)
|
81 |
|
82 |
restored_img = (restored_img * 255.0).round().astype(np.uint8) # float32 to uint8
|
83 |
-
return Image.fromarray(restored_img) #
|
84 |
-
|
85 |
|
86 |
|
87 |
title = "InstructIR โ๏ธ๐ผ๏ธ ๐ค"
|
@@ -139,7 +138,7 @@ demo = gr.Interface(
|
|
139 |
gr.Image(type="pil", label="Input"),
|
140 |
gr.Text(label="Prompt")
|
141 |
],
|
142 |
-
outputs=
|
143 |
title=title,
|
144 |
description=description,
|
145 |
article=article,
|
|
|
7 |
import numpy as np
|
8 |
import yaml
|
9 |
from huggingface_hub import hf_hub_download
|
10 |
+
from gradio_imageslider import ImageSlider
|
11 |
|
12 |
## local code
|
13 |
from models import instructir
|
|
|
80 |
restored_img = np.clip(restored_img, 0. , 1.)
|
81 |
|
82 |
restored_img = (restored_img * 255.0).round().astype(np.uint8) # float32 to uint8
|
83 |
+
return (image, Image.fromarray(restored_img)) #Image.fromarray(restored_img)
|
|
|
84 |
|
85 |
|
86 |
title = "InstructIR โ๏ธ๐ผ๏ธ ๐ค"
|
|
|
138 |
gr.Image(type="pil", label="Input"),
|
139 |
gr.Text(label="Prompt")
|
140 |
],
|
141 |
+
outputs=ImageSlider(label="Restorated Image", type="pil"),
|
142 |
title=title,
|
143 |
description=description,
|
144 |
article=article,
|
requirements.txt
CHANGED
@@ -5,4 +5,4 @@ PyYAML
|
|
5 |
Pillow>=6.2.2
|
6 |
sentence-transformers==2.3.0
|
7 |
gradio==4.16.0
|
8 |
-
|
|
|
5 |
Pillow>=6.2.2
|
6 |
sentence-transformers==2.3.0
|
7 |
gradio==4.16.0
|
8 |
+
gradio_imageslider
|