Spaces:
Runtime error
Runtime error
Update face_restoration_helper.py
Browse files
facelib/utils/face_restoration_helper.py
CHANGED
@@ -208,7 +208,7 @@ class FaceRestoreHelper(object):
|
|
208 |
else:
|
209 |
h, w = self.input_img.shape[0:2]
|
210 |
scale = resize / min(h, w)
|
211 |
-
scale = max(1, scale) # always scale up
|
212 |
h, w = int(h * scale), int(w * scale)
|
213 |
interp = cv2.INTER_AREA if scale < 1 else cv2.INTER_LINEAR
|
214 |
input_img = cv2.resize(self.input_img, (w, h), interpolation=interp)
|
@@ -522,4 +522,4 @@ class FaceRestoreHelper(object):
|
|
522 |
self.cropped_faces = []
|
523 |
self.inverse_affine_matrices = []
|
524 |
self.det_faces = []
|
525 |
-
self.pad_input_imgs = []
|
|
|
208 |
else:
|
209 |
h, w = self.input_img.shape[0:2]
|
210 |
scale = resize / min(h, w)
|
211 |
+
# scale = max(1, scale) # always scale up; comment this out for HD images, e.g., AIGC faces.
|
212 |
h, w = int(h * scale), int(w * scale)
|
213 |
interp = cv2.INTER_AREA if scale < 1 else cv2.INTER_LINEAR
|
214 |
input_img = cv2.resize(self.input_img, (w, h), interpolation=interp)
|
|
|
522 |
self.cropped_faces = []
|
523 |
self.inverse_affine_matrices = []
|
524 |
self.det_faces = []
|
525 |
+
self.pad_input_imgs = []
|