Spaces:
Running
on
Zero
Running
on
Zero
Ahsen Khaliq
commited on
Commit
·
48b9ade
1
Parent(s):
2a66f25
Update app.py
Browse files
app.py
CHANGED
|
@@ -135,13 +135,13 @@ modelv2 = torch.jit.load('./ArcaneGANv0.2.jit').eval().cuda().half()
|
|
| 135 |
|
| 136 |
def process(im, version):
|
| 137 |
if version == 'version 0.4':
|
| 138 |
-
im = scale_by_face_size(im, target_face=300, max_res=1_500_000, max_upscale=
|
| 139 |
res = proc_pil_img(im, modelv4)
|
| 140 |
elif version == 'version 0.3':
|
| 141 |
-
im = scale_by_face_size(im, target_face=300, max_res=1_500_000, max_upscale=
|
| 142 |
res = proc_pil_img(im, modelv3)
|
| 143 |
else:
|
| 144 |
-
im = scale_by_face_size(im, target_face=300, max_res=1_500_000, max_upscale=
|
| 145 |
res = proc_pil_img(im, modelv2)
|
| 146 |
return res
|
| 147 |
|
|
@@ -151,7 +151,7 @@ article = "<div style='text-align: center;'>ArcaneGan by <a href='https://twitte
|
|
| 151 |
|
| 152 |
gr.Interface(
|
| 153 |
process,
|
| 154 |
-
[gr.inputs.Image(type="pil", label="Input"
|
| 155 |
],
|
| 156 |
gr.outputs.Image(type="pil", label="Output"),
|
| 157 |
title=title,
|
|
|
|
| 135 |
|
| 136 |
def process(im, version):
|
| 137 |
if version == 'version 0.4':
|
| 138 |
+
im = scale_by_face_size(im, target_face=300, max_res=1_500_000, max_upscale=1)
|
| 139 |
res = proc_pil_img(im, modelv4)
|
| 140 |
elif version == 'version 0.3':
|
| 141 |
+
im = scale_by_face_size(im, target_face=300, max_res=1_500_000, max_upscale=1)
|
| 142 |
res = proc_pil_img(im, modelv3)
|
| 143 |
else:
|
| 144 |
+
im = scale_by_face_size(im, target_face=300, max_res=1_500_000, max_upscale=1)
|
| 145 |
res = proc_pil_img(im, modelv2)
|
| 146 |
return res
|
| 147 |
|
|
|
|
| 151 |
|
| 152 |
gr.Interface(
|
| 153 |
process,
|
| 154 |
+
[gr.inputs.Image(type="pil", label="Input"),gr.inputs.Radio(choices=['version 0.2','version 0.3','version 0.4'], type="value", default='version 0.4', label='version')
|
| 155 |
],
|
| 156 |
gr.outputs.Image(type="pil", label="Output"),
|
| 157 |
title=title,
|