Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,9 +47,14 @@ def proc_pil_img(input_image):
|
|
| 47 |
output_image = PIL.Image.fromarray(output_image)
|
| 48 |
return output_image
|
| 49 |
|
| 50 |
-
def process(im):
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
res = proc_pil_img(im)
|
|
|
|
| 53 |
return res
|
| 54 |
|
| 55 |
gr.Interface(
|
|
@@ -59,7 +64,9 @@ gr.Interface(
|
|
| 59 |
title="Arcane Style Transfer",
|
| 60 |
description="Gradio demo for Arcane Style Transfer",
|
| 61 |
article = "<p style='text-align: center'><a href='https://github.com/jjeamin/anime_style_transfer_pytorch' target='_blank'>Github Repo by jjeamin</a></p> <center><img src='https://visitor-badge.glitch.me/badge?page_id=jjeamin_arcane_st' alt='visitor badge'></center></p>",
|
| 62 |
-
examples=[['billie.png'], ['gongyoo.jpeg'], ['IU.png'], ['elon.png']],
|
|
|
|
|
|
|
| 63 |
enable_queue=True,
|
| 64 |
allow_flagging=False,
|
| 65 |
allow_screenshot=False
|
|
|
|
| 47 |
output_image = PIL.Image.fromarray(output_image)
|
| 48 |
return output_image
|
| 49 |
|
| 50 |
+
def process(im, is_align):
|
| 51 |
+
if is_align == 'True':
|
| 52 |
+
im = align_face(im, output_size=image_size, transform_size=transform_size)
|
| 53 |
+
else:
|
| 54 |
+
pass
|
| 55 |
+
|
| 56 |
res = proc_pil_img(im)
|
| 57 |
+
|
| 58 |
return res
|
| 59 |
|
| 60 |
gr.Interface(
|
|
|
|
| 64 |
title="Arcane Style Transfer",
|
| 65 |
description="Gradio demo for Arcane Style Transfer",
|
| 66 |
article = "<p style='text-align: center'><a href='https://github.com/jjeamin/anime_style_transfer_pytorch' target='_blank'>Github Repo by jjeamin</a></p> <center><img src='https://visitor-badge.glitch.me/badge?page_id=jjeamin_arcane_st' alt='visitor badge'></center></p>",
|
| 67 |
+
examples=[['billie.png', 'True'], ['gongyoo.jpeg', 'True'], ['IU.png', 'True'], ['elon.png', 'True']],
|
| 68 |
+
gr.Interface(inference, [gr.inputs.Image(type="pil"),
|
| 69 |
+
gr.inputs.Radio(['True','False'], type="value", default='True', label='face align')],
|
| 70 |
enable_queue=True,
|
| 71 |
allow_flagging=False,
|
| 72 |
allow_screenshot=False
|