Spaces:
Running
Running
Xintao
commited on
Commit
·
3064e13
1
Parent(s):
258bbe3
update
Browse files
app.py
CHANGED
|
@@ -79,7 +79,7 @@ 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)
|
| 83 |
except RuntimeError as error:
|
| 84 |
print('Error', error)
|
| 85 |
|
|
@@ -124,9 +124,9 @@ If you have any question, please email 📧 `[email protected]` or `xintao
|
|
| 124 |
gr.Interface(
|
| 125 |
inference, [
|
| 126 |
gr.inputs.Image(type="filepath", label="Input"),
|
| 127 |
-
gr.inputs.Radio(['v1.2', 'v1.3', 'v1.4', '
|
| 128 |
gr.inputs.Number(label="Rescaling factor", default=2),
|
| 129 |
-
gr.Slider(0, 100, label='
|
| 130 |
], [
|
| 131 |
gr.outputs.Image(type="numpy", label="Output (The whole image)"),
|
| 132 |
gr.outputs.File(label="Download the output image")
|
|
|
|
| 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 |
|
|
|
|
| 124 |
gr.Interface(
|
| 125 |
inference, [
|
| 126 |
gr.inputs.Image(type="filepath", label="Input"),
|
| 127 |
+
gr.inputs.Radio(['v1.2', 'v1.3', 'v1.4', 'RestoreFormer', 'CodeFormer'], type="value", default='v1.4', label='version'),
|
| 128 |
gr.inputs.Number(label="Rescaling factor", default=2),
|
| 129 |
+
gr.Slider(0, 100, label='Weight, only for CodeFormer. 0 for better quality, 100 for better identity', default=50)
|
| 130 |
], [
|
| 131 |
gr.outputs.Image(type="numpy", label="Output (The whole image)"),
|
| 132 |
gr.outputs.File(label="Download the output image")
|