Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions micro_sam/sam_annotator/_annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ def _require_layers(self, layer_choices: Optional[List[str]] = None):
widgets._validation_window_for_missing_layer("current_object")
self._viewer.add_labels(data=dummy_data, name="current_object")
if image_scale is not None:
self.layers["current_objects"].scale = image_scale
self._viewer.layers["current_object"].scale = image_scale

if "auto_segmentation" not in self._viewer.layers:
if layer_choices and "auto_segmentation" in layer_choices: # Check at 'commit' call button.
widgets._validation_window_for_missing_layer("auto_segmentation")
self._viewer.add_labels(data=dummy_data, name="auto_segmentation")
if image_scale is not None:
self.layers["auto_segmentation"].scale = image_scale
self._viewer.layers["auto_segmentation"].scale = image_scale

if "committed_objects" not in self._viewer.layers:
if layer_choices and "committed_objects" in layer_choices: # Check at 'commit' call button.
Expand All @@ -50,7 +50,7 @@ def _require_layers(self, layer_choices: Optional[List[str]] = None):
# Randomize colors so it is easy to see when object committed.
self._viewer.layers["committed_objects"].new_colormap()
if image_scale is not None:
self.layers["committed_objects"].scale = image_scale
self._viewer.layers["committed_objects"].scale = image_scale

# Add the point layer for point prompts.
self._point_labels = ["positive", "negative"]
Expand Down
6 changes: 3 additions & 3 deletions micro_sam/sam_annotator/annotator_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ def _require_layers(self, layer_choices: Optional[List[str]] = None):
widgets._validation_window_for_missing_layer("current_object")
self._viewer.add_labels(data=dummy_data, name="current_object")
if image_scale is not None:
self.layers["current_objects"].scale = image_scale
self._viewer.layers["current_object"].scale = image_scale

if "auto_segmentation" not in self._viewer.layers:
if layer_choices and "auto_segmentation" in layer_choices: # Check at 'commit' call button.
widgets._validation_window_for_missing_layer("auto_segmentation")
self._viewer.add_labels(data=dummy_data, name="auto_segmentation")
if image_scale is not None:
self.layers["auto_segmentation"].scale = image_scale
self._viewer.layers["auto_segmentation"].scale = image_scale

if "committed_objects" not in self._viewer.layers:
if layer_choices and "committed_objects" in layer_choices: # Check at 'commit' call button.
Expand All @@ -148,7 +148,7 @@ def _require_layers(self, layer_choices: Optional[List[str]] = None):
# Randomize colors so it is easy to see when object committed.
self._viewer.layers["committed_objects"].new_colormap()
if image_scale is not None:
self.layers["committed_objects"].scale = image_scale
self._viewer.layers["committed_objects"].scale = image_scale

# Add the point prompts layer.
self._point_labels = ["positive", "negative"]
Expand Down