Ahsen Khaliq
commited on
Commit
·
9846174
1
Parent(s):
4080091
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
import os
|
|
|
|
|
|
|
2 |
import random
|
3 |
import gradio as gr
|
4 |
from PIL import Image
|
@@ -6,7 +9,6 @@ import torch
|
|
6 |
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')
|
7 |
torch.hub.download_url_to_file('https://upload.wikimedia.org/wikipedia/commons/5/50/Albert_Einstein_%28Nobel%29.png', 'einstein.png')
|
8 |
|
9 |
-
import argparse
|
10 |
import cv2
|
11 |
import glob
|
12 |
import numpy as np
|
@@ -48,9 +50,7 @@ img_list = sorted(glob.glob(os.path.join(args.test_path, '*')))
|
|
48 |
|
49 |
|
50 |
|
51 |
-
|
52 |
-
os.system("pip freeze")
|
53 |
-
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v0.2.0/GFPGANCleanv1-NoCE-C2.pth -P .")
|
54 |
|
55 |
|
56 |
def inference(img):
|
|
|
1 |
import os
|
2 |
+
os.system("pip install gfpgan")
|
3 |
+
os.system("pip freeze")
|
4 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v0.2.0/GFPGANCleanv1-NoCE-C2.pth -P .")
|
5 |
import random
|
6 |
import gradio as gr
|
7 |
from PIL import Image
|
|
|
9 |
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')
|
10 |
torch.hub.download_url_to_file('https://upload.wikimedia.org/wikipedia/commons/5/50/Albert_Einstein_%28Nobel%29.png', 'einstein.png')
|
11 |
|
|
|
12 |
import cv2
|
13 |
import glob
|
14 |
import numpy as np
|
|
|
50 |
|
51 |
|
52 |
|
53 |
+
|
|
|
|
|
54 |
|
55 |
|
56 |
def inference(img):
|