Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
•
ff9c835
1
Parent(s):
221345e
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import os
|
2 |
from PIL import Image
|
3 |
import torch
|
4 |
-
|
5 |
import gradio as gr
|
6 |
import torch
|
7 |
torch.backends.cudnn.benchmark = True
|
@@ -16,15 +16,16 @@ from torch.nn import functional as F
|
|
16 |
from tqdm import tqdm
|
17 |
import lpips
|
18 |
from model import *
|
19 |
-
|
20 |
-
os.system("gdown https://drive.google.com/uc?id=1jtCg8HQ6RlTmLdnbT2PfW1FJ2AYkWqsK")
|
21 |
-
os.system("cp e4e_ffhq_encode.pt models/e4e_ffhq_encode.pt")
|
22 |
|
23 |
from e4e_projection import projection as e4e_projection
|
24 |
|
25 |
from copy import deepcopy
|
26 |
import imageio
|
27 |
|
|
|
|
|
|
|
28 |
|
29 |
os.system("wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2")
|
30 |
os.system("bzip2 -dk shape_predictor_68_face_landmarks.dat.bz2")
|
@@ -150,4 +151,4 @@ description = "Gradio Demo for JoJoGAN: One Shot Face Stylization. To use it, si
|
|
150 |
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>"
|
151 |
|
152 |
examples=[['mona.png','Jinx']]
|
153 |
-
gr.Interface(inference, [gr.inputs.Image(type="filepath"),gr.inputs.Dropdown(choices=['JoJo', 'Disney','Jinx','Caitlyn','Yasuho','Arcane Multi','Art','Spider-Verse'], type="value", default='JoJo', label="Model")], gr.outputs.Image(type="file"),title=title,description=description,article=article,allow_flagging=
|
1 |
import os
|
2 |
from PIL import Image
|
3 |
import torch
|
4 |
+
os.system("pip install gradio=2.5.3")
|
5 |
import gradio as gr
|
6 |
import torch
|
7 |
torch.backends.cudnn.benchmark = True
|
16 |
from tqdm import tqdm
|
17 |
import lpips
|
18 |
from model import *
|
19 |
+
|
|
|
|
|
20 |
|
21 |
from e4e_projection import projection as e4e_projection
|
22 |
|
23 |
from copy import deepcopy
|
24 |
import imageio
|
25 |
|
26 |
+
os.makedirs('models', exist_ok=True)
|
27 |
+
os.system("gdown https://drive.google.com/uc?id=1jtCg8HQ6RlTmLdnbT2PfW1FJ2AYkWqsK")
|
28 |
+
os.system("cp e4e_ffhq_encode.pt models/e4e_ffhq_encode.pt")
|
29 |
|
30 |
os.system("wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2")
|
31 |
os.system("bzip2 -dk shape_predictor_68_face_landmarks.dat.bz2")
|
151 |
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>"
|
152 |
|
153 |
examples=[['mona.png','Jinx']]
|
154 |
+
gr.Interface(inference, [gr.inputs.Image(type="filepath"),gr.inputs.Dropdown(choices=['JoJo', 'Disney','Jinx','Caitlyn','Yasuho','Arcane Multi','Art','Spider-Verse'], 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,enable_queue=True).launch()
|