Spaces:
Build error
Build error
Commit
·
2736057
1
Parent(s):
7018e07
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +11,8 @@ import torchvision.transforms as transforms
|
|
| 11 |
from PIL import Image
|
| 12 |
import torch
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
def lab2rgb(L, AB):
|
| 18 |
"""Convert an Lab tensor image to a RGB numpy output
|
|
@@ -150,6 +150,7 @@ def run(image,Restoration_mode, colorizaition_mode):
|
|
| 150 |
|
| 151 |
elif Restoration_mode == "Pix2Pix":
|
| 152 |
result_restoration = inferRestoration(image, Restoration_mode)
|
|
|
|
| 153 |
|
| 154 |
result_colorization = inferColorization(result_restoration,colorizaition_mode)
|
| 155 |
|
|
@@ -159,4 +160,4 @@ examples = [['example/1.jpeg'],['example/2.jpg'],['example/3.jpg'],['example/4.j
|
|
| 159 |
iface = gr.Interface(run,
|
| 160 |
[gr.inputs.Image(),gr.inputs.Radio(["BOPBTL", "Pix2Pix"]),gr.inputs.Radio(["Deoldify", "Pix2Pix Resnet 9block","Pix2Pix Unet 256"])],
|
| 161 |
outputs="image",
|
| 162 |
-
examples=examples).launch(debug=True,share=
|
|
|
|
| 11 |
from PIL import Image
|
| 12 |
import torch
|
| 13 |
|
| 14 |
+
os.system("pip install dlib")
|
| 15 |
+
os.system('bash setup.sh')
|
| 16 |
|
| 17 |
def lab2rgb(L, AB):
|
| 18 |
"""Convert an Lab tensor image to a RGB numpy output
|
|
|
|
| 150 |
|
| 151 |
elif Restoration_mode == "Pix2Pix":
|
| 152 |
result_restoration = inferRestoration(image, Restoration_mode)
|
| 153 |
+
print("Restoration_mode",Restoration_mode)
|
| 154 |
|
| 155 |
result_colorization = inferColorization(result_restoration,colorizaition_mode)
|
| 156 |
|
|
|
|
| 160 |
iface = gr.Interface(run,
|
| 161 |
[gr.inputs.Image(),gr.inputs.Radio(["BOPBTL", "Pix2Pix"]),gr.inputs.Radio(["Deoldify", "Pix2Pix Resnet 9block","Pix2Pix Unet 256"])],
|
| 162 |
outputs="image",
|
| 163 |
+
examples=examples).launch(debug=True,share=False)
|