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

17 lines
479 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:
gr.Markdown(
2023-04-16 10:12:04 +03:00
"Convert video to images.")
2023-04-16 08:51:33 +03:00
with gr.Row():
with gr.Column():
2023-04-16 10:12:04 +03:00
2023-04-16 08:51:33 +03:00
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(
choices=["png", "jpg"], value="png", label="Format of image")
submit = gr.Button("Submit")
2023-04-16 10:12:04 +03:00
submit.click(fn=video_to_images, inputs=[video, format])