Ahsen Khaliq commited on
Commit
842f5b3
1 Parent(s): c5a1723

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -20,7 +20,6 @@ def run_cmd(command):
20
  print("Process interrupted")
21
  sys.exit(1)
22
  run_cmd("wget https://github.com/TencentARC/GFPGAN/releases/download/v0.2.0/GFPGANCleanv1-NoCE-C2.pth -P .")
23
-
24
  run_cmd("pip install basicsr")
25
  run_cmd("pip install facexlib")
26
  run_cmd("pip freeze")
@@ -38,7 +37,7 @@ def inference(img):
38
  hsize = int((float(img.size[1])*float(wpercent)))
39
  img = img.resize((basewidth,hsize), Image.ANTIALIAS)
40
  img.save(INPUT_DIR + "1.jpg", "JPEG")
41
- run_cmd("python inference_gfpgan.py --upscale 2 --test_path "+ INPUT_DIR + " --save_root " + OUTPUT_DIR)
42
  return os.path.join(OUTPUT_DIR, "1_00.png")
43
 
44
  title = "Real-ESRGAN"
 
20
  print("Process interrupted")
21
  sys.exit(1)
22
  run_cmd("wget https://github.com/TencentARC/GFPGAN/releases/download/v0.2.0/GFPGANCleanv1-NoCE-C2.pth -P .")
 
23
  run_cmd("pip install basicsr")
24
  run_cmd("pip install facexlib")
25
  run_cmd("pip freeze")
 
37
  hsize = int((float(img.size[1])*float(wpercent)))
38
  img = img.resize((basewidth,hsize), Image.ANTIALIAS)
39
  img.save(INPUT_DIR + "1.jpg", "JPEG")
40
+ run_cmd("python inference_gfpgan.py --upscale 2 --test_path "+ INPUT_DIR + " --save_root " + OUTPUT_DIR + " --paste_back")
41
  return os.path.join(OUTPUT_DIR, "1_00.png")
42
 
43
  title = "Real-ESRGAN"