From f7908b9f66644ddfa242cc0832edab9dbffc9182 Mon Sep 17 00:00:00 2001 From: Qin Yu Date: Tue, 10 Sep 2024 18:31:11 +0200 Subject: [PATCH] refactor: use `magicgui.types.Separator` (#311) --- plantseg/viewer_napari/widgets/predictions.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plantseg/viewer_napari/widgets/predictions.py b/plantseg/viewer_napari/widgets/predictions.py index df80adfc..72d4faf2 100644 --- a/plantseg/viewer_napari/widgets/predictions.py +++ b/plantseg/viewer_napari/widgets/predictions.py @@ -8,6 +8,7 @@ import napari import torch.cuda from magicgui import magicgui +from magicgui.types import Separator from napari.layers import Image from napari.types import LayerDataTuple @@ -93,12 +94,12 @@ def to_choices(cls): }, advanced={ 'label': 'Show Advanced Parameters', - 'tooltip': 'Change the patch shape, halo shape and batch size.', + 'tooltip': 'Change the patch shape, halo shape, and batch size.', }, - patch_size={'label': 'Patch size', 'tooltip': 'Patch size use to processed the data.'}, + patch_size={'label': 'Patch size', 'tooltip': 'Patch size used to process the data.'}, patch_halo={ 'label': 'Patch halo', - 'tooltip': 'Patch halo is extra padding for correct prediction on image boarder.' + 'tooltip': 'Patch halo is extra padding for correct prediction on image borders. ' 'The value is for one side of a given dimension.', }, single_patch={ @@ -226,7 +227,11 @@ def _on_widget_unet_predictions_plantseg_filter_change(plantseg_filter: bool): if plantseg_filter: widget_unet_predictions.model_id.choices = model_zoo.get_bioimageio_zoo_plantseg_model_names() else: - widget_unet_predictions.model_id.choices = model_zoo.get_bioimageio_zoo_all_model_names() + widget_unet_predictions.model_id.choices = ( + model_zoo.get_bioimageio_zoo_plantseg_model_names() + + [Separator] + + model_zoo.get_bioimageio_zoo_other_model_names() + ) # TODO reinsert this code when _on_prediction_input_image_change is implemented