echolee commited on
Commit
19d1db8
1 Parent(s): dbadf04
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  from PIL import Image
2
  import torch
 
3
  import gradio as gr
4
 
5
  model2 = torch.hub.load(
@@ -28,7 +29,9 @@ description = "Online Demo for AnimeGanv2 Face Portrait v2. To use it, simply up
28
  # article = "<p style='text-align: center'><a href='https://github.com/bryandlee/animegan2-pytorch' target='_blank'>Github Repo Pytorch</a> | <a href='https://github.com/Kazuhito00/AnimeGANv2-ONNX-Sample' target='_blank'>Github Repo ONNX</a></p><p style='text-align: center'>samples from repo: <img src='https://user-images.githubusercontent.com/26464535/129888683-98bb6283-7bb8-4d1a-a04a-e795f5858dcf.gif' alt='animation'/> <img src='https://user-images.githubusercontent.com/26464535/137619176-59620b59-4e20-4d98-9559-a424f86b7f24.jpg' alt='animation'/></p>"
29
  # article = "<p style='text-align: center'>samples: <img src='https://user-images.githubusercontent.com/26464535/129888683-98bb6283-7bb8-4d1a-a04a-e795f5858dcf.gif' alt='animation'/> <img src='https://user-images.githubusercontent.com/26464535/137619176-59620b59-4e20-4d98-9559-a424f86b7f24.jpg' alt='animation'/></p>"
30
  article = "<p style='text-align: center'>❤ from Bruce</p>"
31
- examples = [['https://z3.ax1x.com/2021/11/22/IxVvz4.png', 'version 2 (🔺 robustness,🔻 stylization)'],
 
 
32
  ['IU.png', 'version 1 (🔺 stylization, 🔻 robustness)']]
33
  gr.Interface(inference, [gr.inputs.Image(type="pil"), gr.inputs.Radio(['version 1 (🔺 stylization, 🔻 robustness)', 'version 2 (🔺 robustness,🔻 stylization)'], type="value", default='version 2 (🔺 robustness,🔻 stylization)', label='version')
34
  ], gr.outputs.Image(type="pil"), title=title, description=description, article=article, enable_queue=True, examples=examples, allow_flagging=False).launch()
 
1
  from PIL import Image
2
  import torch
3
+ import requests
4
  import gradio as gr
5
 
6
  model2 = torch.hub.load(
 
29
  # article = "<p style='text-align: center'><a href='https://github.com/bryandlee/animegan2-pytorch' target='_blank'>Github Repo Pytorch</a> | <a href='https://github.com/Kazuhito00/AnimeGANv2-ONNX-Sample' target='_blank'>Github Repo ONNX</a></p><p style='text-align: center'>samples from repo: <img src='https://user-images.githubusercontent.com/26464535/129888683-98bb6283-7bb8-4d1a-a04a-e795f5858dcf.gif' alt='animation'/> <img src='https://user-images.githubusercontent.com/26464535/137619176-59620b59-4e20-4d98-9559-a424f86b7f24.jpg' alt='animation'/></p>"
30
  # article = "<p style='text-align: center'>samples: <img src='https://user-images.githubusercontent.com/26464535/129888683-98bb6283-7bb8-4d1a-a04a-e795f5858dcf.gif' alt='animation'/> <img src='https://user-images.githubusercontent.com/26464535/137619176-59620b59-4e20-4d98-9559-a424f86b7f24.jpg' alt='animation'/></p>"
31
  article = "<p style='text-align: center'>❤ from Bruce</p>"
32
+
33
+ img_musk = Image.open(requests.get("https://z3.ax1x.com/2021/11/22/IxVvz4.png", stream=True).raw).convert("RGB")
34
+ examples = [[img_musk, 'version 2 (🔺 robustness,🔻 stylization)'],
35
  ['IU.png', 'version 1 (🔺 stylization, 🔻 robustness)']]
36
  gr.Interface(inference, [gr.inputs.Image(type="pil"), gr.inputs.Radio(['version 1 (🔺 stylization, 🔻 robustness)', 'version 2 (🔺 robustness,🔻 stylization)'], type="value", default='version 2 (🔺 robustness,🔻 stylization)', label='version')
37
  ], gr.outputs.Image(type="pil"), title=title, description=description, article=article, enable_queue=True, examples=examples, allow_flagging=False).launch()