Spaces:
Running
Running
Ahsen Khaliq
commited on
Commit
·
2de33ab
1
Parent(s):
7b35549
Update app.py
Browse files
app.py
CHANGED
@@ -100,24 +100,20 @@ class FaceEnhancement(object):
|
|
100 |
|
101 |
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
|
113 |
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
|
119 |
-
|
120 |
-
|
121 |
def inference(file):
|
122 |
im = cv2.imread(file, cv2.IMREAD_COLOR)
|
123 |
img, orig_faces, enhanced_faces = faceenhancer.process(im)
|
|
|
100 |
|
101 |
|
102 |
|
103 |
+
model = "GPEN-BFR-512"
|
104 |
+
|
105 |
+
key = None
|
106 |
+
size = 512
|
107 |
+
channel_multiplier = 2
|
108 |
+
narrow = 1
|
109 |
+
use_sr = False
|
110 |
+
use_cuda = False
|
111 |
+
sr_model = 'rrdb_realesrnet_psnr'
|
112 |
|
113 |
|
114 |
|
115 |
+
faceenhancer = FaceEnhancement(size=size, model=model, use_sr=use_sr, sr_model=sr_model, channel_multiplier=channel_multiplier, narrow=narrow, key=key, device='cuda' if args.use_cuda else 'cpu')
|
|
|
|
|
116 |
|
|
|
|
|
117 |
def inference(file):
|
118 |
im = cv2.imread(file, cv2.IMREAD_COLOR)
|
119 |
img, orig_faces, enhanced_faces = faceenhancer.process(im)
|