Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from PIL import Image
|
|
| 4 |
import torch
|
| 5 |
|
| 6 |
os.system(
|
| 7 |
-
'wget https://github.com/
|
| 8 |
|
| 9 |
|
| 10 |
def inference(img):
|
|
@@ -17,7 +17,7 @@ def inference(img):
|
|
| 17 |
img = img.resize((basewidth, hsize), Image.BILINEAR)
|
| 18 |
img.save("test/1.png", "PNG")
|
| 19 |
os.system(
|
| 20 |
-
'python main_test_CMFNet.py --input_dir test --weights experiments/pretrained_models/
|
| 21 |
return 'results/1.png'
|
| 22 |
|
| 23 |
|
|
@@ -29,11 +29,10 @@ examples = [['Haze.png']]
|
|
| 29 |
gr.Interface(
|
| 30 |
inference,
|
| 31 |
[gr.inputs.Image(type="pil", label="Input")],
|
| 32 |
-
gr.outputs.Image(type="
|
| 33 |
title=title,
|
| 34 |
description=description,
|
| 35 |
article=article,
|
| 36 |
allow_flagging=False,
|
| 37 |
-
allow_screenshot=False,
|
| 38 |
examples=examples
|
| 39 |
).launch(debug=True)
|
|
|
|
| 4 |
import torch
|
| 5 |
|
| 6 |
os.system(
|
| 7 |
+
'wget https://github.com/FanChiMao/CMFNet/releases/download/v0.0/dehaze_I_OHaze_CMFNet.pth -P experiments/pretrained_models')
|
| 8 |
|
| 9 |
|
| 10 |
def inference(img):
|
|
|
|
| 17 |
img = img.resize((basewidth, hsize), Image.BILINEAR)
|
| 18 |
img.save("test/1.png", "PNG")
|
| 19 |
os.system(
|
| 20 |
+
'python main_test_CMFNet.py --input_dir test --weights experiments/pretrained_models/dehaze_I_OHaze_CMFNet.pth')
|
| 21 |
return 'results/1.png'
|
| 22 |
|
| 23 |
|
|
|
|
| 29 |
gr.Interface(
|
| 30 |
inference,
|
| 31 |
[gr.inputs.Image(type="pil", label="Input")],
|
| 32 |
+
gr.outputs.Image(type="filepath", label="Output"),
|
| 33 |
title=title,
|
| 34 |
description=description,
|
| 35 |
article=article,
|
| 36 |
allow_flagging=False,
|
|
|
|
| 37 |
examples=examples
|
| 38 |
).launch(debug=True)
|