image-pluser-webui/tabs/Video to images/app.py

16 lines
482 B
Python
Raw Normal View History

2023-04-16 08:51:33 +03:00
import gradio as gr
2023-04-16 10:12:04 +03:00
from processing.bulk import video_to_images
2023-04-16 08:51:33 +03:00
with gr.Blocks() as app:
2023-04-16 18:40:08 +03:00
gr.Markdown("Convert video to images.")
2023-04-16 08:51:33 +03:00
with gr.Row():
with gr.Column():
video = gr.Video(label="Video")
2023-04-16 10:12:04 +03:00
with gr.Column():
2023-04-16 08:51:33 +03:00
format = gr.Radio(
2023-04-16 18:40:08 +03:00
choices=["png", "jpg"], value="png", label="Format of image"
)
2023-04-16 08:51:33 +03:00
submit = gr.Button("Submit")
2023-04-16 10:12:04 +03:00
submit.click(fn=video_to_images, inputs=[video, format])