Spaces:
Build error
Build error
solitarycodefinement
commited on
Commit
·
42efc01
1
Parent(s):
73d6960
dark mode
Browse files
app.py
CHANGED
|
@@ -26,16 +26,18 @@ import clip
|
|
| 26 |
model_dir = "models"
|
| 27 |
os.makedirs(model_dir, exist_ok=True)
|
| 28 |
|
| 29 |
-
model_repos = {
|
| 30 |
"e4e": ("akhaliq/JoJoGAN_e4e_ffhq_encode", "e4e_ffhq_encode.pt"),
|
| 31 |
"dlib": ("akhaliq/jojogan_dlib", "shape_predictor_68_face_landmarks.dat"),
|
| 32 |
"sc_fs3": ("rinong/stylegan-nada-models", "fs3.npy"),
|
| 33 |
"base": ("akhaliq/jojogan-stylegan2-ffhq-config-f", "stylegan2-ffhq-config-f.pt"),
|
| 34 |
"sketch": ("rinong/stylegan-nada-models", "sketch.pt"),
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
| 38 |
"claymation": ("mjdolan/stylegan-nada-models", "claymation.pt")
|
|
|
|
| 39 |
}
|
| 40 |
|
| 41 |
interface_gan_map = {"None": None, "Masculine": ("gender", 1.0), "Feminine": ("gender", -1.0),
|
|
@@ -218,14 +220,14 @@ blocks = gr.Blocks(theme="darkdefault")
|
|
| 218 |
with blocks:
|
| 219 |
gr.Markdown("<h1><center>Holiday Filters (StyleGAN-NADA)</center></h1>")
|
| 220 |
gr.Markdown(
|
| 221 |
-
"<
|
| 222 |
)
|
| 223 |
with gr.Row():
|
| 224 |
with gr.Column():
|
| 225 |
input_img = gr.inputs.Image(type="filepath", label="Input image")
|
| 226 |
|
| 227 |
with gr.Column():
|
| 228 |
-
style_choice = gr.inputs.CheckboxGroup(choices=editor.get_style_list(), type="value",
|
| 229 |
label="Styles")
|
| 230 |
alter = gr.Dropdown(
|
| 231 |
choices=["None", "Masculine", "Feminine", "Smiling", "Frowning", "Young", "Old", "Short Hair",
|
|
@@ -238,7 +240,7 @@ with blocks:
|
|
| 238 |
|
| 239 |
img_button.click(fn=editor.edit_image, inputs=[alter, input_img, style_choice], outputs=img_output)
|
| 240 |
|
| 241 |
-
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2108.00946' target='_blank'>StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators</a> | <a href='https://stylegan-nada.github.io/' target='_blank'>Project Page</a> | <a href='https://github.com/rinongal/StyleGAN-nada' target='_blank'>Code</a></p> <center><img src='https://visitor-badge.glitch.me/badge?page_id=
|
| 242 |
gr.Markdown(article)
|
| 243 |
|
| 244 |
blocks.launch(enable_queue=True)
|
|
|
|
| 26 |
model_dir = "models"
|
| 27 |
os.makedirs(model_dir, exist_ok=True)
|
| 28 |
|
| 29 |
+
model_repos = {
|
| 30 |
"e4e": ("akhaliq/JoJoGAN_e4e_ffhq_encode", "e4e_ffhq_encode.pt"),
|
| 31 |
"dlib": ("akhaliq/jojogan_dlib", "shape_predictor_68_face_landmarks.dat"),
|
| 32 |
"sc_fs3": ("rinong/stylegan-nada-models", "fs3.npy"),
|
| 33 |
"base": ("akhaliq/jojogan-stylegan2-ffhq-config-f", "stylegan2-ffhq-config-f.pt"),
|
| 34 |
"sketch": ("rinong/stylegan-nada-models", "sketch.pt"),
|
| 35 |
+
"santa": ("mjdolan/stylegan-nada-models", "santa.pt"),
|
| 36 |
+
"jesus": ("mjdolan/stylegan-nada-models", "jesus.pt"),
|
| 37 |
+
"mariah": ("mjdolan/stylegan-nada-models", "mariah.pt"),
|
| 38 |
+
"heat_miser": ("mjdolan/stylegan-nada-models", "heat.pt"),
|
| 39 |
"claymation": ("mjdolan/stylegan-nada-models", "claymation.pt")
|
| 40 |
+
#grinch krampus all default select
|
| 41 |
}
|
| 42 |
|
| 43 |
interface_gan_map = {"None": None, "Masculine": ("gender", 1.0), "Feminine": ("gender", -1.0),
|
|
|
|
| 220 |
with blocks:
|
| 221 |
gr.Markdown("<h1><center>Holiday Filters (StyleGAN-NADA)</center></h1>")
|
| 222 |
gr.Markdown(
|
| 223 |
+
"<div>Upload an image of your face, pick your desired output styles, pick any modifiers, and apply StyleGAN-based editing.</div>"
|
| 224 |
)
|
| 225 |
with gr.Row():
|
| 226 |
with gr.Column():
|
| 227 |
input_img = gr.inputs.Image(type="filepath", label="Input image")
|
| 228 |
|
| 229 |
with gr.Column():
|
| 230 |
+
style_choice = gr.inputs.CheckboxGroup(choices=editor.get_style_list(), default=editor.get_style_list(), type="value",
|
| 231 |
label="Styles")
|
| 232 |
alter = gr.Dropdown(
|
| 233 |
choices=["None", "Masculine", "Feminine", "Smiling", "Frowning", "Young", "Old", "Short Hair",
|
|
|
|
| 240 |
|
| 241 |
img_button.click(fn=editor.edit_image, inputs=[alter, input_img, style_choice], outputs=img_output)
|
| 242 |
|
| 243 |
+
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2108.00946' target='_blank'>StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators</a> | <a href='https://stylegan-nada.github.io/' target='_blank'>Project Page</a> | <a href='https://github.com/rinongal/StyleGAN-nada' target='_blank'>Code</a></p> <center><img src='https://visitor-badge.glitch.me/badge?page_id=mjdolan.holiday_stylegan_nada' alt='visitor badge'></center>"
|
| 244 |
gr.Markdown(article)
|
| 245 |
|
| 246 |
blocks.launch(enable_queue=True)
|