Ahsen Khaliq commited on
Commit
7267a03
1 Parent(s): 1d99fb0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -78,7 +78,8 @@ def run_one_image(img, model):
78
  plt.subplot(1, 4, 4)
79
  show_image(im_paste[0], "reconstruction + visible")
80
 
81
- plt.savefig("test.png",bbox_inches='tight')
 
82
 
83
 
84
  # download checkpoint if not exist
@@ -101,8 +102,8 @@ def inference(img):
101
 
102
 
103
  torch.manual_seed(2)
104
- run_one_image(img, model_mae)
105
- return "test.png"
106
 
107
 
108
  title = "MAE"
@@ -111,4 +112,4 @@ description = "Gradio Demo for MAE. To use it, simply upload your image, or clic
111
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2112.11641' target='_blank'>JoJoGAN: One Shot Face Stylization</a>| <a href='https://github.com/mchong6/JoJoGAN' target='_blank'>Github Repo Pytorch</a></p> <center><img src='https://visitor-badge.glitch.me/badge?page_id=akhaliq_jojogan' alt='visitor badge'></center>"
112
 
113
 
114
- gr.Interface(inference, [gr.inputs.Image(type="pil")], gr.outputs.Image(type="file"),title=title,description=description,article=article,allow_flagging=False,allow_screenshot=False,enable_queue=True).launch()
 
78
  plt.subplot(1, 4, 4)
79
  show_image(im_paste[0], "reconstruction + visible")
80
 
81
+ return plt
82
+ #plt.savefig("test.png",bbox_inches='tight')
83
 
84
 
85
  # download checkpoint if not exist
 
102
 
103
 
104
  torch.manual_seed(2)
105
+
106
+ return run_one_image(img, model_mae)
107
 
108
 
109
  title = "MAE"
 
112
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2112.11641' target='_blank'>JoJoGAN: One Shot Face Stylization</a>| <a href='https://github.com/mchong6/JoJoGAN' target='_blank'>Github Repo Pytorch</a></p> <center><img src='https://visitor-badge.glitch.me/badge?page_id=akhaliq_jojogan' alt='visitor badge'></center>"
113
 
114
 
115
+ gr.Interface(inference, [gr.inputs.Image(type="pil")], gr.outputs.Image(type="plot"),title=title,description=description,article=article,allow_flagging=False,allow_screenshot=False,enable_queue=True).launch()