change default interactive_seg_device to cpu;add interactive seg model/device to web_config
This commit is contained in:
parent
6750df13e7
commit
d3f6f69af6
@ -141,7 +141,7 @@ class Config(BaseModel):
|
||||
# plugins
|
||||
enable_interactive_seg: bool = False
|
||||
interactive_seg_model: str = "vit_l"
|
||||
interactive_seg_device: str = "cuda"
|
||||
interactive_seg_device: str = "cpu"
|
||||
enable_remove_bg: bool = False
|
||||
enable_realesrgan: bool = False
|
||||
realesrgan_device: str = "cpu"
|
||||
|
@ -30,6 +30,8 @@ def save_config(
|
||||
output_dir,
|
||||
quality,
|
||||
enable_interactive_seg,
|
||||
interactive_seg_model,
|
||||
interactive_seg_device,
|
||||
enable_remove_bg,
|
||||
enable_realesrgan,
|
||||
realesrgan_device,
|
||||
@ -119,9 +121,21 @@ def main(config_file: str):
|
||||
enable_interactive_seg = gr.Checkbox(
|
||||
init_config.enable_interactive_seg, label=INTERACTIVE_SEG_HELP
|
||||
)
|
||||
interactive_seg_model = gr.Radio(
|
||||
AVAILABLE_INTERACTIVE_SEG_MODELS,
|
||||
label="Segment Anything models. Model size: vit_b < vit_l < vit_h. Bigger model size means better segmentation but slower speed.",
|
||||
value=init_config.interactive_seg_model,
|
||||
)
|
||||
interactive_seg_device = gr.Radio(
|
||||
AVAILABLE_INTERACTIVE_SEG_DEVICES,
|
||||
label="Segment Anything Device",
|
||||
value=init_config.interactive_seg_device,
|
||||
)
|
||||
with gr.Row():
|
||||
enable_remove_bg = gr.Checkbox(
|
||||
init_config.enable_remove_bg, label=REMOVE_BG_HELP
|
||||
)
|
||||
|
||||
with gr.Row():
|
||||
enable_realesrgan = gr.Checkbox(
|
||||
init_config.enable_realesrgan, label=REALESRGAN_HELP
|
||||
@ -202,6 +216,8 @@ def main(config_file: str):
|
||||
output_dir,
|
||||
quality,
|
||||
enable_interactive_seg,
|
||||
interactive_seg_model,
|
||||
interactive_seg_device,
|
||||
enable_remove_bg,
|
||||
enable_realesrgan,
|
||||
realesrgan_device,
|
||||
|
Loading…
Reference in New Issue
Block a user