diff --git a/scripts/main.py b/scripts/main.py index 918dfac..232fa79 100644 --- a/scripts/main.py +++ b/scripts/main.py @@ -51,30 +51,27 @@ def on_ui_tabs(): with gr.Column(): input_image = gr.Image(type="pil") with gr.Accordion("Mask Setting", open=True): - with gr.Accordion("Segment Anything & CLIP", open=True): - with gr.Accordion("Segment Anything & CLIP", open=True): - sa_enabled = gr.Checkbox(label="enabled", show_label=True) - model_name = gr.Dropdown(label="Model", elem_id="sam_model", choices=model_list, - value=model_list[0] if len(model_list) > 0 else None) - seg_query = gr.Textbox(label = "segmentation prompt", show_label=True) - predicted_iou_threshold = gr.Slider(0, 1, value=0.9, step=0.01, label="predicted_iou_threshold", show_label=True) - stability_score_threshold = gr.Slider(0, 1, value=0.9, step=0.01, label="stability_score_threshold", show_label=True) - clip_threshold = gr.Slider(0, 1, value=0.1, step=0.01, label="clip_threshold", show_label=True) - + with gr.Tab("Segment Anything & CLIP"): + sa_enabled = gr.Checkbox(label="enabled", show_label=True) + model_name = gr.Dropdown(label="Model", elem_id="sam_model", choices=model_list, + value=model_list[0] if len(model_list) > 0 else None) + seg_query = gr.Textbox(label = "segmentation prompt", show_label=True) + predicted_iou_threshold = gr.Slider(0, 1, value=0.9, step=0.01, label="predicted_iou_threshold", show_label=True) + stability_score_threshold = gr.Slider(0, 1, value=0.9, step=0.01, label="stability_score_threshold", show_label=True) + clip_threshold = gr.Slider(0, 1, value=0.1, step=0.01, label="clip_threshold", show_label=True) with gr.Accordion("Post Processing", open=True): - with gr.Accordion("tile division BG Removers", open=True): - td_abg_enabled = gr.Checkbox(label="enabled", show_label=True) - h_split = gr.Slider(1, 2048, value=256, step=4, label="horizontal split num", show_label=True) - v_split = gr.Slider(1, 2048, value=256, step=4, label="vertical split num", show_label=True) - - n_cluster = gr.Slider(1, 1000, value=500, step=10, label="cluster num", show_label=True) - alpha = gr.Slider(1, 255, value=50, step=1, label="alpha threshold", show_label=True) - th_rate = gr.Slider(0, 1, value=0.1, step=0.01, label="mask content ratio", show_label=True) + with gr.Tab("tile division BG Removers"): + td_abg_enabled = gr.Checkbox(label="enabled", show_label=True) + h_split = gr.Slider(1, 2048, value=256, step=4, label="horizontal split num", show_label=True) + v_split = gr.Slider(1, 2048, value=256, step=4, label="vertical split num", show_label=True) - with gr.Accordion("cascadePSP", open=True): - cascadePSP_enabled = gr.Checkbox(label="enabled", show_label=True) - fast = gr.Checkbox(label="fast", show_label=True) - psp_L = gr.Slider(1, 2048, value=900, step=1, label="Memory usage", show_label=True) + n_cluster = gr.Slider(1, 1000, value=500, step=10, label="cluster num", show_label=True) + alpha = gr.Slider(1, 255, value=50, step=1, label="alpha threshold", show_label=True) + th_rate = gr.Slider(0, 1, value=0.1, step=0.01, label="mask content ratio", show_label=True) + with gr.Tab("cascadePSP"): + cascadePSP_enabled = gr.Checkbox(label="enabled", show_label=True) + fast = gr.Checkbox(label="fast", show_label=True) + psp_L = gr.Slider(1, 2048, value=900, step=1, label="Memory usage", show_label=True) submit = gr.Button(value="Submit") with gr.Row():