Update app.py
Browse files
app.py
CHANGED
@@ -193,9 +193,10 @@ def generate_object_history(object_name):
|
|
193 |
|
194 |
gif_path = f"{object_name}_evolution.gif"
|
195 |
images[0].save(gif_path, save_all=True, append_images=images[1:], duration=1000, loop=0)
|
196 |
-
return [(f"{object_name}_past.png", labels["past"]),
|
197 |
-
|
198 |
-
|
|
|
199 |
|
200 |
# =========================================================
|
201 |
# Gradio Interface
|
@@ -220,7 +221,8 @@ def create_gradio_interface():
|
|
220 |
with gr.Column():
|
221 |
object_name_input = gr.Textbox(label="Enter an object name", placeholder="e.g. bicycle, car, phone")
|
222 |
generate_button = gr.Button("Generate Evolution")
|
223 |
-
image_gallery = gr.Gallery(label="Generated Images", columns=3, rows=1, value=default_images)
|
|
|
224 |
gif_output = gr.Image(label="Generated GIF", value=default_gif_path)
|
225 |
|
226 |
generate_button.click(fn=generate_object_history, inputs=[object_name_input], outputs=[image_gallery, gif_output])
|
|
|
193 |
|
194 |
gif_path = f"{object_name}_evolution.gif"
|
195 |
images[0].save(gif_path, save_all=True, append_images=images[1:], duration=1000, loop=0)
|
196 |
+
#return [(f"{object_name}_past.png", labels["past"]),
|
197 |
+
# (f"{object_name}_present.png", labels["present"]),
|
198 |
+
# (f"{object_name}_future.png", labels["future"])], gif_path
|
199 |
+
return images, gif_path
|
200 |
|
201 |
# =========================================================
|
202 |
# Gradio Interface
|
|
|
221 |
with gr.Column():
|
222 |
object_name_input = gr.Textbox(label="Enter an object name", placeholder="e.g. bicycle, car, phone")
|
223 |
generate_button = gr.Button("Generate Evolution")
|
224 |
+
#image_gallery = gr.Gallery(label="Generated Images", columns=3, rows=1, value=default_images)
|
225 |
+
image_gallery = gr.Gallery(label="Generated Images", columns=3, rows=1, type="filepath")
|
226 |
gif_output = gr.Image(label="Generated GIF", value=default_gif_path)
|
227 |
|
228 |
generate_button.click(fn=generate_object_history, inputs=[object_name_input], outputs=[image_gallery, gif_output])
|