Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -237,7 +237,7 @@ def run_main_app(semantic_concept, word, letter, font_name, num_steps, example=0
|
|
| 237 |
combine_word(cfg.word, cfg.optimized_letter, cfg.font, cfg.experiment_dir)
|
| 238 |
|
| 239 |
image = os.path.join(cfg.experiment_dir,f"{cfg.font}_{cfg.word}_{cfg.optimized_letter}.svg")
|
| 240 |
-
yield gr.update(value=filename_init,visible=True),gr.update(visible=False),gr.update(value=image,visible=True)
|
| 241 |
|
| 242 |
# with open(filename_init, "r") as f0:
|
| 243 |
# svg_content_init = f0.read()
|
|
@@ -297,9 +297,9 @@ with gr.Blocks() as demo:
|
|
| 297 |
run = gr.Button('Generate')
|
| 298 |
|
| 299 |
with gr.Column():
|
| 300 |
-
result0 = gr.Gallery(label="Initial Word")#gr.HTML("""<style>{width: 333px; height: 333px;}</style>""",label="Initial Word") #gr.Image(type="filepath", label="Initial Word",height=333)
|
| 301 |
-
result1 = gr.Gallery(label="Optimization Process")#gr.Image(type="filepath", label="Optimization Process",height=100)
|
| 302 |
-
result2 = gr.Gallery(label="Final Result")#gr.HTML(label="Final Result") #gr.Image(type="filepath", label="Final Result",visible=False,height=333)
|
| 303 |
|
| 304 |
|
| 305 |
with gr.Row():
|
|
|
|
| 237 |
combine_word(cfg.word, cfg.optimized_letter, cfg.font, cfg.experiment_dir)
|
| 238 |
|
| 239 |
image = os.path.join(cfg.experiment_dir,f"{cfg.font}_{cfg.word}_{cfg.optimized_letter}.svg")
|
| 240 |
+
yield gr.update(value=[filename_init],visible=True),gr.update(visible=False),gr.update(value=[image,visible]=True)
|
| 241 |
|
| 242 |
# with open(filename_init, "r") as f0:
|
| 243 |
# svg_content_init = f0.read()
|
|
|
|
| 297 |
run = gr.Button('Generate')
|
| 298 |
|
| 299 |
with gr.Column():
|
| 300 |
+
result0 = gr.Gallery(label="Initial Word", value=None)#gr.HTML("""<style>{width: 333px; height: 333px;}</style>""",label="Initial Word") #gr.Image(type="filepath", label="Initial Word",height=333)
|
| 301 |
+
result1 = gr.Gallery(label="Optimization Process", value=None)#gr.Image(type="filepath", label="Optimization Process",height=100)
|
| 302 |
+
result2 = gr.Gallery(label="Final Result", value=None)#gr.HTML(label="Final Result") #gr.Image(type="filepath", label="Final Result",visible=False,height=333)
|
| 303 |
|
| 304 |
|
| 305 |
with gr.Row():
|