Upload app.py
Browse files
app.py
CHANGED
@@ -39,9 +39,10 @@ model_repos = {
|
|
39 |
|
40 |
}
|
41 |
|
42 |
-
interface_gan_map = {"None": None,
|
43 |
-
"Smiling": ("smile", 1.0)
|
44 |
-
|
|
|
45 |
|
46 |
|
47 |
def get_models():
|
@@ -218,15 +219,15 @@ with blocks:
|
|
218 |
with gr.Column():
|
219 |
style_choice = gr.CheckboxGroup(choices=editor.get_style_list(), value=editor.get_style_list(), type="value", label="Styles")
|
220 |
alter = gr.Dropdown(
|
221 |
-
choices=["None", "Smiling"
|
|
|
222 |
img_button = gr.Button("Edit Image")
|
223 |
-
|
224 |
with gr.Row():
|
225 |
img_output = gr.Gallery(label="Output Images")
|
226 |
img_output.style(grid=(3, 3, 4, 4, 6, 6))
|
227 |
|
228 |
img_button.click(fn=editor.edit_image, inputs=[input_img, style_choice, alter], outputs=img_output)
|
229 |
-
ex = gr.Examples(examples=['pose.jpg', editor.get_style_list(), "Smiling"], fn=editor.edit_image, inputs=[input_img, style_choice, alter],
|
230 |
outputs=[img_output], cache_examples=True,
|
231 |
run_on_click=True)
|
232 |
ex.dataset.headers = [""]
|
|
|
39 |
|
40 |
}
|
41 |
|
42 |
+
interface_gan_map = {"None": None, "Masculine": ("gender", 1.0), "Feminine": ("gender", -1.0),
|
43 |
+
"Smiling": ("smile", 1.0),
|
44 |
+
"Frowning": ("smile", -1.0), "Young": ("age", -1.0), "Old": ("age", 1.0),
|
45 |
+
"Long Hair": ("hair_length", -1.0), "Short Hair": ("hair_length", 1.0)}
|
46 |
|
47 |
|
48 |
def get_models():
|
|
|
219 |
with gr.Column():
|
220 |
style_choice = gr.CheckboxGroup(choices=editor.get_style_list(), value=editor.get_style_list(), type="value", label="Styles")
|
221 |
alter = gr.Dropdown(
|
222 |
+
choices=["None", "Masculine", "Feminine", "Smiling", "Frowning", "Young", "Old", "Short Hair",
|
223 |
+
"Long Hair"], value="None", label="Additional Modifiers")
|
224 |
img_button = gr.Button("Edit Image")
|
|
|
225 |
with gr.Row():
|
226 |
img_output = gr.Gallery(label="Output Images")
|
227 |
img_output.style(grid=(3, 3, 4, 4, 6, 6))
|
228 |
|
229 |
img_button.click(fn=editor.edit_image, inputs=[input_img, style_choice, alter], outputs=img_output)
|
230 |
+
ex = gr.Examples(examples=[['pose.jpg', editor.get_style_list(), "Smiling"],['pose.jpg', editor.get_style_list(), "Long Hair"]], fn=editor.edit_image, inputs=[input_img, style_choice, alter],
|
231 |
outputs=[img_output], cache_examples=True,
|
232 |
run_on_click=True)
|
233 |
ex.dataset.headers = [""]
|