Spaces:
Runtime error
Runtime error
Commit
·
2fe33c2
1
Parent(s):
6c1e309
Update app.py
Browse files
app.py
CHANGED
@@ -163,10 +163,10 @@ ckptsketch = torch.load(modelSketch, map_location=lambda storage, loc: storage)
|
|
163 |
generatorsketch.load_state_dict(ckptsketch["g"], strict=False)
|
164 |
|
165 |
|
166 |
-
modelMy = hf_hub_download(repo_id="algomuffin/my_model", filename="my.pt")
|
167 |
|
168 |
-
ckptMy = torch.load(modelMy, map_location=lambda storage, loc: storage)
|
169 |
-
generatorMy.load_state_dict(ckptMy["g"], strict=False)
|
170 |
|
171 |
|
172 |
|
@@ -200,9 +200,6 @@ def inference(img, model):
|
|
200 |
elif model == 'Spider-Verse':
|
201 |
with torch.no_grad():
|
202 |
my_sample = generatorspider(my_w, input_is_latent=True)
|
203 |
-
elif model == 'My-model':
|
204 |
-
with torch.no_grad():
|
205 |
-
my_sample = generatorMy(my_w, input_is_latent=True)
|
206 |
else:
|
207 |
with torch.no_grad():
|
208 |
my_sample = generatorsketch(my_w, input_is_latent=True)
|
@@ -218,4 +215,4 @@ description = "Gradio Demo for JoJoGAN: This is a fork made by algomuffin in ord
|
|
218 |
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>"
|
219 |
|
220 |
examples=[['baby-face.jpg','Jinx']]
|
221 |
-
gr.Interface(inference, [gr.inputs.Image(type="pil"),gr.inputs.Dropdown(choices=['JoJo', 'Disney','Jinx','Caitlyn','Yasuho','Arcane Multi','Art','Spider-Verse','
|
|
|
163 |
generatorsketch.load_state_dict(ckptsketch["g"], strict=False)
|
164 |
|
165 |
|
166 |
+
#modelMy = hf_hub_download(repo_id="algomuffin/my_model", filename="my.pt")
|
167 |
|
168 |
+
#ckptMy = torch.load(modelMy, map_location=lambda storage, loc: storage)
|
169 |
+
#generatorMy.load_state_dict(ckptMy["g"], strict=False)
|
170 |
|
171 |
|
172 |
|
|
|
200 |
elif model == 'Spider-Verse':
|
201 |
with torch.no_grad():
|
202 |
my_sample = generatorspider(my_w, input_is_latent=True)
|
|
|
|
|
|
|
203 |
else:
|
204 |
with torch.no_grad():
|
205 |
my_sample = generatorsketch(my_w, input_is_latent=True)
|
|
|
215 |
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>"
|
216 |
|
217 |
examples=[['baby-face.jpg','Jinx']]
|
218 |
+
gr.Interface(inference, [gr.inputs.Image(type="pil"),gr.inputs.Dropdown(choices=['JoJo', 'Disney','Jinx','Caitlyn','Yasuho','Arcane Multi','Art','Spider-Verse','Sketch'], type="value", default='JoJo', label="Model")], gr.outputs.Image(type="file"),title=title,description=description,article=article,allow_flagging=False,examples=examples,allow_screenshot=False).launch(enable_queue=True, cache_examples=True)
|