aetherwu commited on
Commit
1a1683d
1 Parent(s): 3064e13

Fix error: global exception enhance() got an unexpected keyword argument 'weight'

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- _, _, output = face_enhancer.enhance(img, has_aligned=False, only_center_face=False, paste_back=True, weight=weight)
 
 
 
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