Skip to content

Commit 7463042

Browse files
authored
555 add new logo to installer and update finetune gui (#556)
Updates to finetuning GUI + misc changes
1 parent 7693bf9 commit 7463042

File tree

5 files changed

+35
-37
lines changed

5 files changed

+35
-37
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: pip install --no-deps -e .
4444

4545
- name: Run tests
46-
uses: aganders3/headless-gui@v1
46+
uses: aganders3/headless-gui@v2
4747
with:
4848
shell: bash -l {0}
4949
run: pytest

deployment/construct.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ version: 0.0.1
33
license_file: ../LICENSE
44
installer_type: pkg #[osx] # This will trigger pkg build on Mac Os. On windows and linux, native build will be done and this has no effect.
55
environment: __MICROSAM_BUILD_ENV__
6-
welcome_image: ../doc/images/micro-sam-logo.png
7-
header_image: ../doc/images/micro-sam-logo.png
8-
icon_image: ../doc/images/micro-sam-logo.png
6+
welcome_image: ../doc/images/logo/logo.png
7+
header_image: ../doc/images/logo/logo.png
8+
icon_image: ../doc/images/logo/logo.png
99
channels:
1010
- conda-forge
1111
welcome_text: Install Segment Anything for Microscopy.

micro_sam/bioimageio/model_export.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _create_test_inputs_and_outputs(
8585
point_prompt_path = os.path.join(tmp_dir, "point_prompts.npy")
8686
point_label_path = os.path.join(tmp_dir, "point_labels.npy")
8787
mask_prompt_path = os.path.join(tmp_dir, "mask_prompts.npy")
88-
np.save(box_prompt_path, box_prompts)
88+
np.save(box_prompt_path, box_prompts.astype("int64"))
8989
np.save(point_prompt_path, point_prompts)
9090
np.save(point_label_path, point_labels)
9191
np.save(mask_prompt_path, mask_prompts)
@@ -321,7 +321,6 @@ def export_sam_model(
321321
id=spec.AxisId("object"),
322322
size=spec.ARBITRARY_SIZE
323323
),
324-
# TODO double check the axis names
325324
spec.ChannelAxis(channel_names=[spec.Identifier(bname) for bname in "hwxy"]),
326325
],
327326
test_tensor=spec.FileDescr(source=input_paths["box_prompts"]),

micro_sam/sam_annotator/_tooltips.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,22 @@
4848
"pattern": "Select a pattern for selecting files. E.g. '*.tif' to only select tif files. By default all files in the input folder are selected.",
4949
"is_volumetric": "Choose if the data you annotate is volumetric.",
5050
},
51-
# TODO update these once we have finalized the names in the widget.
5251
"training": {
53-
"checkpoint": "checkpoint",
54-
"device": "device",
55-
"initial_model": "initial_model",
56-
"label_key": "label_key",
57-
"label_path": "label_path",
58-
"label_path_val": "label_path_val",
59-
"name": "Name of the new model.",
60-
"patch": "patch",
61-
"raw_key": "raw_key",
62-
"raw_path": "raw_path",
63-
"raw_path_val": "raw_path_val",
64-
"segmentation_decoder": "segmentation_decoder",
65-
"output_path": "output_path",
66-
"n_epochs": "n_epochs",
67-
"configuration": "configuration",
52+
"checkpoint": "Select a checkpoint (saved model) to resume training from.",
53+
"device": "Select the computational device to use for processing.",
54+
"initial_model": "Select the model name used as starting point for training.",
55+
"label_key": "Define the key that holds to the segmentation labels. Use a pattern, e.g. \"*.tif\" select multiple files or an internal path for hdf5, zarr or similar formats.",
56+
"label_path": "Specify the path to the segmentaiton labels for training. Can either point to a directory or single file.",
57+
"label_path_val": "Specify the path to the segmentation labels for validation. Can either point to a directory or single file.",
58+
"name": "Enter the name of the model that will be trained.",
59+
"patch": "Select the size of image patches used for training.",
60+
"raw_key": "Define the key that holds to the image data. Use a pattern, e.g. \"*.tif\" select multiple files or an internal path for hdf5, zarr or similar formats.",
61+
"raw_path": "Specify the path to the image data for training. Can either point to a directory or single file.",
62+
"raw_path_val": "Specify the path to the image data for training. Can either point to a directory or single file.",
63+
"segmentation_decoder": "Choose whether to train with additional segmentation decoder or not.",
64+
"output_path": "Specify the path where you want to save the trained model after the training process.",
65+
"n_epochs": "Define the number of training epochs for your model.",
66+
"configuration": "Specifiy the hardware configuration to use for training.",
6867
},
6968
}
7069

micro_sam/sam_annotator/training_ui.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,42 +52,42 @@ def __init__(self, parent=None):
5252
def _create_options(self):
5353
self.raw_path = None
5454
_, layout = self._add_path_param(
55-
"raw_path", self.raw_path, "both", placeholder="Image data ...",
55+
"Path to images", self.raw_path, "both", placeholder="/path/to/images",
5656
tooltip=get_tooltip("training", "raw_path")
5757
)
5858
self.layout().addLayout(layout)
5959

6060
self.raw_key = None
6161
_, layout = self._add_string_param(
62-
"raw_key", self.raw_key, placeholder="Image data key ...",
62+
"Image data key", self.raw_key, placeholder="e.g. \"*.tif\"",
6363
tooltip=get_tooltip("training", "raw_key")
6464
)
6565
self.layout().addLayout(layout)
6666

6767
self.label_path = None
6868
_, layout = self._add_path_param(
69-
"label_path", self.label_path, "both", placeholder="Label data ...",
69+
"Path to labels", self.label_path, "both", placeholder="/path/to/labels",
7070
tooltip=get_tooltip("training", "label_path")
7171
)
7272
self.layout().addLayout(layout)
7373

7474
self.label_key = None
7575
_, layout = self._add_string_param(
76-
"label_key", self.label_key, placeholder="Label data key ...",
76+
"Label data key", self.label_key, placeholder="e.g. \"*.tif\"",
7777
tooltip=get_tooltip("training", "label_key")
7878
)
7979
self.layout().addLayout(layout)
8080

8181
self.configuration = _find_best_configuration()
8282
self.setting_dropdown, layout = self._add_choice_param(
83-
"configuration", self.configuration, list(CONFIGURATIONS.keys()),
83+
"Configuration", self.configuration, list(CONFIGURATIONS.keys()),
8484
tooltip=get_tooltip("training", "configuration")
8585
)
8686
self.layout().addLayout(layout)
8787

8888
self.with_segmentation_decoder = True
8989
self.layout().addWidget(self._add_boolean_param(
90-
"with_segmentation_decoder", self.with_segmentation_decoder,
90+
"With segmentation decoder", self.with_segmentation_decoder,
9191
tooltip=get_tooltip("training", "segmentation_decoder")
9292
))
9393

@@ -100,28 +100,28 @@ def _create_settings(self):
100100
self.device = "auto"
101101
device_options = ["auto"] + util._available_devices()
102102
self.device_dropdown, layout = self._add_choice_param(
103-
"device", self.device, device_options, tooltip=get_tooltip("training", "device")
103+
"Device", self.device, device_options, tooltip=get_tooltip("training", "device")
104104
)
105105
setting_values.layout().addLayout(layout)
106106

107107
self.patch_x, self.patch_y = 512, 512
108108
self.patch_x_param, self.patch_y_param, layout = self._add_shape_param(
109-
("patch_x", "patch_y"), (self.patch_x, self.patch_y), min_val=0, max_val=2048,
109+
("Patch size x", "Patch size y"), (self.patch_x, self.patch_y), min_val=0, max_val=2048,
110110
tooltip=get_tooltip("training", "patch")
111111
)
112112
setting_values.layout().addLayout(layout)
113113

114114
# Paths for validation data.
115115
self.raw_path_val = None
116116
_, layout = self._add_path_param(
117-
"raw_path_val", self.raw_path_val, "both", placeholder="Image data for validation ...",
117+
"Path to validation images", self.raw_path_val, "both", placeholder="/path/to/images",
118118
tooltip=get_tooltip("training", "raw_path_val")
119119
)
120120
setting_values.layout().addLayout(layout)
121121

122122
self.label_path_val = None
123123
_, layout = self._add_path_param(
124-
"label_path_val", self.label_path_val, "both", placeholder="Label data for validation ...",
124+
"Path to validation labels", self.label_path_val, "both", placeholder="/path/to/images",
125125
tooltip=get_tooltip("training", "label_path_val")
126126
)
127127
setting_values.layout().addLayout(layout)
@@ -130,31 +130,31 @@ def _create_settings(self):
130130
# on top of which the finetuning is run.
131131
self.name = "sam_model"
132132
self.name_param, layout = self._add_string_param(
133-
"name", self.name, tooltip=get_tooltip("training", "name")
133+
"Model name", self.name, tooltip=get_tooltip("training", "name")
134134
)
135135
setting_values.layout().addLayout(layout)
136136

137137
self.initial_model = None
138138
self.initial_model_param, layout = self._add_string_param(
139-
"initial_model", self.initial_model, tooltip=get_tooltip("training", "initial_model")
139+
"Initial model", self.initial_model, tooltip=get_tooltip("training", "initial_model")
140140
)
141141
setting_values.layout().addLayout(layout)
142142

143143
self.checkpoint = None
144144
self.checkpoint_param, layout = self._add_string_param(
145-
"checkpoint", self.name, tooltip=get_tooltip("training", "checkpoint")
145+
"Checkpoint", self.name, tooltip=get_tooltip("training", "checkpoint")
146146
)
147147
setting_values.layout().addLayout(layout)
148148

149149
self.output_path = None
150150
self.output_path_param, layout = self._add_string_param(
151-
"output_path", self.output_path, tooltip=get_tooltip("training", "output_path")
151+
"Output Path", self.output_path, tooltip=get_tooltip("training", "output_path")
152152
)
153153
setting_values.layout().addLayout(layout)
154154

155155
self.n_epochs = 100
156156
self.n_epochs_param, layout = self._add_int_param(
157-
"n_epochs", self.n_epochs, tooltip=get_tooltip("training", "n_epochs"),
157+
"Number of epochs", self.n_epochs, tooltip=get_tooltip("training", "n_epochs"),
158158
min_val=1, max_val=1000,
159159
)
160160
setting_values.layout().addLayout(layout)

0 commit comments

Comments
 (0)