Nina.Konovalova
commited on
Commit
·
25073a7
1
Parent(s):
d6c12af
upd hints
Browse files
app.py
CHANGED
@@ -72,49 +72,49 @@ def action1():
|
|
72 |
concept = "kettle" #############
|
73 |
img = Image.open(info["image"].format(concept))
|
74 |
description = temaplte.format(CAPTIONS[concept])
|
75 |
-
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True), gr.update(value=concept)
|
76 |
|
77 |
def action2():
|
78 |
concept = "face_lifting" ###################
|
79 |
img = Image.open(info["image"].format(concept))
|
80 |
description = temaplte.format(CAPTIONS[concept])
|
81 |
-
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True), gr.update(value=concept)
|
82 |
|
83 |
def action3():
|
84 |
concept = "pendant" #############
|
85 |
img = Image.open(info["image"].format(concept))
|
86 |
description = temaplte.format(CAPTIONS[concept])
|
87 |
-
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True), gr.update(value=concept)
|
88 |
|
89 |
def action4():
|
90 |
concept = "car"
|
91 |
img = Image.open(info["image"].format(concept))
|
92 |
description = temaplte.format(CAPTIONS[concept])
|
93 |
-
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True), gr.update(value=concept)
|
94 |
|
95 |
def action5():
|
96 |
concept = "body_lotion" #################
|
97 |
img = Image.open(info["image"].format(concept))
|
98 |
description = temaplte.format(CAPTIONS[concept])
|
99 |
-
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True), gr.update(value=concept)
|
100 |
|
101 |
def action6():
|
102 |
concept = "toy" ############
|
103 |
img = Image.open(info["image"].format(concept))
|
104 |
description = temaplte.format(CAPTIONS[concept])
|
105 |
-
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True), gr.update(value=concept)
|
106 |
|
107 |
def action7():
|
108 |
concept = "bag" ##############
|
109 |
img = Image.open(info["image"].format(concept))
|
110 |
description = temaplte.format(CAPTIONS[concept])
|
111 |
-
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True), gr.update(value=concept)
|
112 |
|
113 |
def action8():
|
114 |
concept = "armchair" ############
|
115 |
img = Image.open(info["image"].format(concept))
|
116 |
description = temaplte.format(CAPTIONS[concept])
|
117 |
-
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True), gr.update(value=concept)
|
118 |
|
119 |
|
120 |
css2 = """
|
@@ -199,7 +199,12 @@ def get_demo():
|
|
199 |
btn7 = gr.Button("", icon=info["image"].format("bag"), elem_classes=["my-custom-button"])
|
200 |
btn8 = gr.Button("", icon=info["image"].format("armchair"), elem_classes=["my-custom-button"])
|
201 |
|
202 |
-
prod_desc = gr.Markdown(value="""<div style="font-size: 20px;">Choose the product you want to showcase </div"> 🠕""", visible=True)
|
|
|
|
|
|
|
|
|
|
|
203 |
|
204 |
input_image = gr.Image(label="Chosen product", type="pil", height=300, width=300, visible=False, interactive=False, container=True, elem_classes=["input_image_container"])
|
205 |
descr = gr.Markdown(value=temaplte.format(""), visible=False)
|
@@ -226,11 +231,17 @@ def get_demo():
|
|
226 |
with gr.Row():
|
227 |
res3 = gr.Image(label="Result 2", visible=False, height=450, width=450)
|
228 |
res4 = gr.Image(label="Result 4", visible=False) #<div style="text-align: center; font-size: 18px;">
|
229 |
-
gr.Markdown('''
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
|
235 |
btn_generate.click(
|
236 |
fn=generate_image,
|
|
|
72 |
concept = "kettle" #############
|
73 |
img = Image.open(info["image"].format(concept))
|
74 |
description = temaplte.format(CAPTIONS[concept])
|
75 |
+
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True, placeholder="in a cozy kitchen"), gr.update(visible=True), gr.update(value=concept)
|
76 |
|
77 |
def action2():
|
78 |
concept = "face_lifting" ###################
|
79 |
img = Image.open(info["image"].format(concept))
|
80 |
description = temaplte.format(CAPTIONS[concept])
|
81 |
+
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True, placeholder="in a cozy bathroom"), gr.update(visible=True), gr.update(value=concept)
|
82 |
|
83 |
def action3():
|
84 |
concept = "pendant" #############
|
85 |
img = Image.open(info["image"].format(concept))
|
86 |
description = temaplte.format(CAPTIONS[concept])
|
87 |
+
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True, placeholder="on a beautiful blonde woman"), gr.update(visible=True), gr.update(value=concept)
|
88 |
|
89 |
def action4():
|
90 |
concept = "car"
|
91 |
img = Image.open(info["image"].format(concept))
|
92 |
description = temaplte.format(CAPTIONS[concept])
|
93 |
+
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True, placeholder="driving in a desert"), gr.update(visible=True), gr.update(value=concept)
|
94 |
|
95 |
def action5():
|
96 |
concept = "body_lotion" #################
|
97 |
img = Image.open(info["image"].format(concept))
|
98 |
description = temaplte.format(CAPTIONS[concept])
|
99 |
+
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True, placeholder="in a cozy bathroom"), gr.update(visible=True), gr.update(value=concept)
|
100 |
|
101 |
def action6():
|
102 |
concept = "toy" ############
|
103 |
img = Image.open(info["image"].format(concept))
|
104 |
description = temaplte.format(CAPTIONS[concept])
|
105 |
+
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True, placeholder="in a cozy living room"), gr.update(visible=True), gr.update(value=concept)
|
106 |
|
107 |
def action7():
|
108 |
concept = "bag" ##############
|
109 |
img = Image.open(info["image"].format(concept))
|
110 |
description = temaplte.format(CAPTIONS[concept])
|
111 |
+
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True, placeholder="in a cozy living room"), gr.update(visible=True), gr.update(value=concept)
|
112 |
|
113 |
def action8():
|
114 |
concept = "armchair" ############
|
115 |
img = Image.open(info["image"].format(concept))
|
116 |
description = temaplte.format(CAPTIONS[concept])
|
117 |
+
return gr.update(value=img, visible=True), gr.update(value=description, visible=True), gr.update(visible=False), gr.update(visible=True, placeholder="in a cozy living room"), gr.update(visible=True), gr.update(value=concept)
|
118 |
|
119 |
|
120 |
css2 = """
|
|
|
199 |
btn7 = gr.Button("", icon=info["image"].format("bag"), elem_classes=["my-custom-button"])
|
200 |
btn8 = gr.Button("", icon=info["image"].format("armchair"), elem_classes=["my-custom-button"])
|
201 |
|
202 |
+
# prod_desc = gr.Markdown(value="""<div style="font-size: 20px;">Choose the product you want to showcase </div"> 🠕""", visible=True)
|
203 |
+
prod_desc = gr.Markdown(
|
204 |
+
'<div style="font-size: 20px; text-align: center;">'
|
205 |
+
'<span>Choose the product you want to showcase 🠕</span>'
|
206 |
+
'</div>'
|
207 |
+
)
|
208 |
|
209 |
input_image = gr.Image(label="Chosen product", type="pil", height=300, width=300, visible=False, interactive=False, container=True, elem_classes=["input_image_container"])
|
210 |
descr = gr.Markdown(value=temaplte.format(""), visible=False)
|
|
|
231 |
with gr.Row():
|
232 |
res3 = gr.Image(label="Result 2", visible=False, height=450, width=450)
|
233 |
res4 = gr.Image(label="Result 4", visible=False) #<div style="text-align: center; font-size: 18px;">
|
234 |
+
# gr.Markdown('''
|
235 |
+
# <div style="display: flex; align-items: center; gap: 10px; font-size: 20px; text-align: center; margin-left: 200px;">
|
236 |
+
# <div>Made by FusionBrainLab, AIRI</div><img src="https://static.tildacdn.com/tild3633-6662-4437-a333-646631346335/Airinet.png" style="width: 70px; height: auto;">
|
237 |
+
# </div>
|
238 |
+
# ''')
|
239 |
+
gr.Markdown(
|
240 |
+
'<div style="display: flex; align-items: center; gap: 10px; font-size: 20px; text-align: center; margin-left: 200px;">'
|
241 |
+
'<span>Made by FusionBrainLab, AIRI</span>'
|
242 |
+
'<img src="https://static.tildacdn.com/tild3633-6662-4437-a333-646631346335/Airinet.png" style="width: 70px; height: auto;">'
|
243 |
+
'</div>'
|
244 |
+
)
|
245 |
|
246 |
btn_generate.click(
|
247 |
fn=generate_image,
|