image-pluser-webui/tabs/Bulk processing/app.py

22 lines
931 B
Python
Raw Normal View History

2023-04-16 08:51:33 +03:00
import gradio as gr
2023-04-16 10:36:29 +03:00
from processing.bulk import bulk_processing
2023-04-16 08:51:33 +03:00
with gr.Blocks() as app:
gr.Markdown(
"Mass processing of images one at a time and saving to video if needed. # **WIP, not working**")
with gr.Row():
with gr.Column():
directory = gr.Text(
2023-04-16 10:36:29 +03:00
placeholder="A directory with many images.", lines=1, label="Directory")
method = gr.Dropdown(
2023-04-16 10:46:55 +03:00
choices=["canny edge", "sharpen"], value="canny edge", label="Method")
2023-04-16 10:36:29 +03:00
with gr.Accordion("Advanced settings", open=False) as acc:
out_dir = gr.Text(
label="Output directory", placeholder="The directory where the processed photos will be saved. If not specified `./output/images`")
2023-04-16 08:51:33 +03:00
submit = gr.Button("Submit")
2023-04-16 10:36:29 +03:00
submit.click(
fn=bulk_processing,
inputs=[directory, out_dir, method],
)