Spaces:
Runtime error
Runtime error
change threshold for is_gray.
Browse files
facelib/utils/face_restoration_helper.py
CHANGED
@@ -127,7 +127,7 @@ class FaceRestoreHelper(object):
|
|
127 |
img = img[:, :, 0:3]
|
128 |
|
129 |
self.input_img = img
|
130 |
-
self.is_gray = is_gray(img, threshold=
|
131 |
if self.is_gray:
|
132 |
print('Grayscale input: True')
|
133 |
|
|
|
127 |
img = img[:, :, 0:3]
|
128 |
|
129 |
self.input_img = img
|
130 |
+
self.is_gray = is_gray(img, threshold=10)
|
131 |
if self.is_gray:
|
132 |
print('Grayscale input: True')
|
133 |
|
inference_codeformer.py
CHANGED
@@ -174,7 +174,7 @@ if __name__ == '__main__':
|
|
174 |
if args.has_aligned:
|
175 |
# the input faces are already cropped and aligned
|
176 |
img = cv2.resize(img, (512, 512), interpolation=cv2.INTER_LINEAR)
|
177 |
-
face_helper.is_gray = is_gray(img, threshold=
|
178 |
if face_helper.is_gray:
|
179 |
print('Grayscale input: True')
|
180 |
face_helper.cropped_faces = [img]
|
|
|
174 |
if args.has_aligned:
|
175 |
# the input faces are already cropped and aligned
|
176 |
img = cv2.resize(img, (512, 512), interpolation=cv2.INTER_LINEAR)
|
177 |
+
face_helper.is_gray = is_gray(img, threshold=10)
|
178 |
if face_helper.is_gray:
|
179 |
print('Grayscale input: True')
|
180 |
face_helper.cropped_faces = [img]
|