Ahsen Khaliq commited on
Commit
5e8cde2
1 Parent(s): 099b4a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -10,6 +10,10 @@ import psutil
10
  torch.hub.download_url_to_file('https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/Abraham_Lincoln_O-77_matte_collodion_print.jpg/1024px-Abraham_Lincoln_O-77_matte_collodion_print.jpg', 'lincoln.jpg')
11
  torch.hub.download_url_to_file('https://upload.wikimedia.org/wikipedia/commons/5/50/Albert_Einstein_%28Nobel%29.png', 'einstein.png')
12
 
 
 
 
 
13
 
14
  def run_cmd(command):
15
  try:
@@ -18,11 +22,7 @@ def run_cmd(command):
18
  except KeyboardInterrupt:
19
  print("Process interrupted")
20
  sys.exit(1)
21
- run_cmd("wget https://github.com/TencentARC/GFPGAN/releases/download/v0.2.0/GFPGANCleanv1-NoCE-C2.pth -P .")
22
- run_cmd("pip install basicsr")
23
- run_cmd("pip install facexlib")
24
- run_cmd("pip freeze")
25
- #run_cmd("python setup.py develop")
26
  def inference(img):
27
  _id = randint(1, 10000)
28
  INPUT_DIR = "/tmp/input_image" + str(_id) + "/"
 
10
  torch.hub.download_url_to_file('https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/Abraham_Lincoln_O-77_matte_collodion_print.jpg/1024px-Abraham_Lincoln_O-77_matte_collodion_print.jpg', 'lincoln.jpg')
11
  torch.hub.download_url_to_file('https://upload.wikimedia.org/wikipedia/commons/5/50/Albert_Einstein_%28Nobel%29.png', 'einstein.png')
12
 
13
+ os.system("pip install gfpgan")
14
+ os.system("pip freeze")
15
+ os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v0.2.0/GFPGANCleanv1-NoCE-C2.pth -P .")
16
+
17
 
18
  def run_cmd(command):
19
  try:
 
22
  except KeyboardInterrupt:
23
  print("Process interrupted")
24
  sys.exit(1)
25
+
 
 
 
 
26
  def inference(img):
27
  _id = randint(1, 10000)
28
  INPUT_DIR = "/tmp/input_image" + str(_id) + "/"