Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -11,28 +11,28 @@ def inference(image, task):
|
|
11 |
os.system('mkdir tmp')
|
12 |
image.save("tmp/lq_image.png", "PNG")
|
13 |
|
14 |
-
if not os.path.exists('
|
15 |
-
os.system('mkdir
|
16 |
|
17 |
if task == 'Dehazing':
|
18 |
-
os.system("python Dehazing.py --test_path ./tmp/lq_image.png --save_path ./
|
19 |
|
20 |
if task == 'LLIE':
|
21 |
-
os.system("python Lowlight.py --test_path ./tmp/lq_image.png --save_path ./
|
22 |
|
23 |
if task == 'SuperResolutionx2':
|
24 |
-
os.system("python SuperResolution.py --test_path ./tmp/lq_image.png --save_path ./
|
25 |
|
26 |
if task == 'SuperResolutionx3':
|
27 |
-
os.system("python SuperResolution.py --test_path ./tmp/lq_image.png --save_path ./
|
28 |
|
29 |
if task == 'SuperResolutionx4':
|
30 |
-
os.system("python SuperResolution.py --test_path ./tmp/lq_image.png --save_path ./
|
31 |
|
32 |
if task == 'Underwater Enhancement':
|
33 |
-
os.system("python Underwater.py --test_path ./tmp/lq_image.png --save_path ./
|
34 |
|
35 |
-
return '
|
36 |
|
37 |
title = "Image Enhancement and Restoration"
|
38 |
description = ""
|
|
|
11 |
os.system('mkdir tmp')
|
12 |
image.save("tmp/lq_image.png", "PNG")
|
13 |
|
14 |
+
if not os.path.exists('results'):
|
15 |
+
os.system('mkdir results')
|
16 |
|
17 |
if task == 'Dehazing':
|
18 |
+
os.system("python Dehazing.py --test_path ./tmp/lq_image.png --save_path ./results/ --pk_path model_zoo/Haze4k.tjm")
|
19 |
|
20 |
if task == 'LLIE':
|
21 |
+
os.system("python Lowlight.py --test_path ./tmp/lq_image.png --save_path ./results/ --pk_path model_zoo/Low.onnx")
|
22 |
|
23 |
if task == 'SuperResolutionx2':
|
24 |
+
os.system("python SuperResolution.py --test_path ./tmp/lq_image.png --save_path ./results/ --pk_path model_zoo/SRx2.pth --scale 2")
|
25 |
|
26 |
if task == 'SuperResolutionx3':
|
27 |
+
os.system("python SuperResolution.py --test_path ./tmp/lq_image.png --save_path ./results/ --pk_path model_zoo/SRx3.pth --scale 3")
|
28 |
|
29 |
if task == 'SuperResolutionx4':
|
30 |
+
os.system("python SuperResolution.py --test_path ./tmp/lq_image.png --save_path ./results/ --pk_path model_zoo/SRx4.pth --scale 4")
|
31 |
|
32 |
if task == 'Underwater Enhancement':
|
33 |
+
os.system("python Underwater.py --test_path ./tmp/lq_image.png --save_path ./results/ --pk_path model_zoo/underwater.pth")
|
34 |
|
35 |
+
return 'results/lq_image.png'
|
36 |
|
37 |
title = "Image Enhancement and Restoration"
|
38 |
description = ""
|