Update app.py
Browse files
app.py
CHANGED
|
@@ -8,10 +8,10 @@ from gfpgan.utils import GFPGANer
|
|
| 8 |
from realesrgan.utils import RealESRGANer
|
| 9 |
|
| 10 |
os.system("pip freeze")
|
| 11 |
-
os.system("wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P .
|
| 12 |
-
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P .
|
| 13 |
-
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P .
|
| 14 |
-
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P .
|
| 15 |
|
| 16 |
torch.hub.download_url_to_file(
|
| 17 |
'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',
|
|
@@ -60,7 +60,7 @@ def inference(img, version, scale):
|
|
| 60 |
elif version == 'v1.3':
|
| 61 |
face_enhancer = face_enhancer_v3
|
| 62 |
else:
|
| 63 |
-
face_enhancer =
|
| 64 |
try:
|
| 65 |
_, _, output = face_enhancer.enhance(img, has_aligned=False, only_center_face=False, paste_back=True)
|
| 66 |
except RuntimeError as error:
|
|
|
|
| 8 |
from realesrgan.utils import RealESRGANer
|
| 9 |
|
| 10 |
os.system("pip freeze")
|
| 11 |
+
os.system("wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P .")
|
| 12 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P .")
|
| 13 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P .")
|
| 14 |
+
os.system("wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P .")
|
| 15 |
|
| 16 |
torch.hub.download_url_to_file(
|
| 17 |
'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',
|
|
|
|
| 60 |
elif version == 'v1.3':
|
| 61 |
face_enhancer = face_enhancer_v3
|
| 62 |
else:
|
| 63 |
+
face_enhancer = face_enhancer_v4
|
| 64 |
try:
|
| 65 |
_, _, output = face_enhancer.enhance(img, has_aligned=False, only_center_face=False, paste_back=True)
|
| 66 |
except RuntimeError as error:
|