Spaces:
Running
on
A10G
Running
on
A10G
Fix error: global exception enhance() got an unexpected keyword argument 'weight'
Browse files
app.py
CHANGED
@@ -79,7 +79,10 @@ def inference(img, version, scale, weight):
|
|
79 |
model_path='CodeFormer.pth', upscale=2, arch='CodeFormer', channel_multiplier=2, bg_upsampler=upsampler)
|
80 |
|
81 |
try:
|
82 |
-
|
|
|
|
|
|
|
83 |
except RuntimeError as error:
|
84 |
print('Error', error)
|
85 |
|
|
|
79 |
model_path='CodeFormer.pth', upscale=2, arch='CodeFormer', channel_multiplier=2, bg_upsampler=upsampler)
|
80 |
|
81 |
try:
|
82 |
+
if version == 'RestoreFormer':
|
83 |
+
_, _, output = face_enhancer.enhance(img, has_aligned=False, only_center_face=False, paste_back=True, weight=weight)
|
84 |
+
else:
|
85 |
+
_, _, output = face_enhancer.enhance(img, has_aligned=False, only_center_face=False, paste_back=True)
|
86 |
except RuntimeError as error:
|
87 |
print('Error', error)
|
88 |
|