Ahsen Khaliq
commited on
Commit
·
44d61ed
1
Parent(s):
96d07a1
Update app.py
Browse files
app.py
CHANGED
@@ -78,8 +78,7 @@ def run_one_image(img, model):
|
|
78 |
plt.subplot(1, 4, 4)
|
79 |
show_image(im_paste[0], "reconstruction + visible")
|
80 |
|
81 |
-
|
82 |
-
#plt.savefig("test.png",bbox_inches='tight')
|
83 |
|
84 |
|
85 |
# download checkpoint if not exist
|
@@ -103,7 +102,8 @@ def inference(img):
|
|
103 |
|
104 |
torch.manual_seed(2)
|
105 |
|
106 |
-
|
|
|
107 |
|
108 |
|
109 |
title = "MAE"
|
@@ -112,4 +112,4 @@ description = "Gradio Demo for MAE. To use it, simply upload your image, or clic
|
|
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="
|
|
|
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
|
|
|
102 |
|
103 |
torch.manual_seed(2)
|
104 |
|
105 |
+
run_one_image(img, model_mae)
|
106 |
+
return "test.png"
|
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="file"),title=title,description=description,article=article,allow_flagging=False,allow_screenshot=False,enable_queue=True).launch()
|