AlexZou commited on
Commit
c598f3e
1 Parent(s): ce6a6d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
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('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 = ""
 
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 = ""