Spaces:
Running
on
T4
Running
on
T4
Ahsen Khaliq
commited on
Commit
•
96df419
1
Parent(s):
60bb1e3
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ face2paint = torch.hub.load(
|
|
17 |
size=512, device="cuda",side_by_side=False
|
18 |
)
|
19 |
|
20 |
-
def inference(img,
|
21 |
if option == 'webcam':
|
22 |
if ver == 'version 2 (🔺 robustness,🔻 stylization)':
|
23 |
out = face2paint(model2, imgweb)
|
@@ -38,5 +38,5 @@ article = "<p style='text-align: center'><a href='https://github.com/bryandlee/a
|
|
38 |
|
39 |
examples=[['groot.jpeg','version 2 (🔺 robustness,🔻 stylization)'],['bill.png','version 1 (🔺 stylization, 🔻 robustness)'],['tony.png','version 1 (🔺 stylization, 🔻 robustness)'],['elon.png','version 2 (🔺 robustness,🔻 stylization)'],['IU.png','version 1 (🔺 stylization, 🔻 robustness)'],['billie.png','version 2 (🔺 robustness,🔻 stylization)'],['will.png','version 2 (🔺 robustness,🔻 stylization)'],['beyonce.jpeg','version 1 (🔺 stylization, 🔻 robustness)'],['gongyoo.jpeg','version 1 (🔺 stylization, 🔻 robustness)']]
|
40 |
|
41 |
-
gr.Interface(inference, [gr.inputs.Image(type="pil",label='Input Image'),gr.inputs.Radio(['version 1 (🔺 stylization, 🔻 robustness)','version 2 (🔺 robustness,🔻 stylization)'], type="value", default='version 2 (🔺 robustness,🔻 stylization)', label='version'),gr.inputs.Radio(['webcam','image upload'], type="value", default='webcam', label='Source'),gr.inputs.Image(type="pil",label='Input Webcam',source='webcam')
|
42 |
], gr.outputs.Image(type="pil"),title=title,description=description,article=article,enable_queue=True,examples=examples,allow_flagging=False).launch()
|
|
|
17 |
size=512, device="cuda",side_by_side=False
|
18 |
)
|
19 |
|
20 |
+
def inference(imgweb,img,option,ver):
|
21 |
if option == 'webcam':
|
22 |
if ver == 'version 2 (🔺 robustness,🔻 stylization)':
|
23 |
out = face2paint(model2, imgweb)
|
|
|
38 |
|
39 |
examples=[['groot.jpeg','version 2 (🔺 robustness,🔻 stylization)'],['bill.png','version 1 (🔺 stylization, 🔻 robustness)'],['tony.png','version 1 (🔺 stylization, 🔻 robustness)'],['elon.png','version 2 (🔺 robustness,🔻 stylization)'],['IU.png','version 1 (🔺 stylization, 🔻 robustness)'],['billie.png','version 2 (🔺 robustness,🔻 stylization)'],['will.png','version 2 (🔺 robustness,🔻 stylization)'],['beyonce.jpeg','version 1 (🔺 stylization, 🔻 robustness)'],['gongyoo.jpeg','version 1 (🔺 stylization, 🔻 robustness)']]
|
40 |
|
41 |
+
gr.Interface(inference, [gr.inputs.Image(type="pil",label='Input Image',optional=True),gr.inputs.Radio(['version 1 (🔺 stylization, 🔻 robustness)','version 2 (🔺 robustness,🔻 stylization)'], type="value", default='version 2 (🔺 robustness,🔻 stylization)', label='version'),gr.inputs.Radio(['webcam','image upload'], type="value", default='webcam', label='Source'),gr.inputs.Image(type="pil",label='Input Webcam',source='webcam',optional=True)
|
42 |
], gr.outputs.Image(type="pil"),title=title,description=description,article=article,enable_queue=True,examples=examples,allow_flagging=False).launch()
|