Skip to content

Commit

Permalink
Expose title argument to _add_shape_param
Browse files Browse the repository at this point in the history
  • Loading branch information
anwai98 committed Oct 26, 2024
1 parent 09868f0 commit 9b4442a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions micro_sam/sam_annotator/_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,20 @@ def _add_choice_param(self, name, value, options, title=None, layout=None, updat
layout.addWidget(dropdown)
return dropdown, layout

def _add_shape_param(self, names, values, min_val, max_val, step=1, tooltip=None):
def _add_shape_param(self, names, values, min_val, max_val, step=1, title=None, tooltip=None):
layout = QtWidgets.QHBoxLayout()

x_layout = QtWidgets.QVBoxLayout()
x_param, _ = self._add_int_param(
names[0], values[0], min_val=min_val, max_val=max_val, layout=x_layout, step=step,
tooltip=tooltip
title=title[0] if title is not None else title, tooltip=tooltip
)
layout.addLayout(x_layout)

y_layout = QtWidgets.QVBoxLayout()
y_param, _ = self._add_int_param(
names[1], values[1], min_val=min_val, max_val=max_val, layout=y_layout, step=step,
tooltip=tooltip
title=title[1] if title is not None else title, tooltip=tooltip
)
layout.addLayout(y_layout)

Expand Down
2 changes: 1 addition & 1 deletion micro_sam/sam_annotator/training_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _create_settings(self):
self.patch_x, self.patch_y = 512, 512
self.patch_x_param, self.patch_y_param, layout = self._add_shape_param(
("patch_x", "patch_y"), (self.patch_x, self.patch_y), min_val=0, max_val=2048,
tooltip=get_tooltip("training", "patch")
tooltip=get_tooltip("training", "patch"), title=("Patch size x", "Patch size y")
)
setting_values.layout().addLayout(layout)

Expand Down

0 comments on commit 9b4442a

Please sign in to comment.