Skip to content

Commit ebbf602

Browse files
committed
Merge branch 'master' into dev
2 parents c2f012e + 393a05b commit ebbf602

14 files changed

Lines changed: 283 additions & 54 deletions

File tree

RELEASE_OVERVIEW.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Overview
22

3+
**New in version 1.7.1**
4+
5+
Fixing minor issues in 1.7.0 (related to trackastra, automatic segmentation and training functions) and adding new section in documentation for our new automatic segmentation pipeline, APG.
6+
37
**New in version 1.7.0**
48

59
Updates to the automatic instance segmentation pipeline (introduces APG - automatic prompt generation).

doc/deprecated/development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This software consists of four different python (sub-)modules:
66
- The top-level `micro_sam` module implements general purpose functionality for using Segment Anything for multi-dimensional data.
77
- `micro_sam.evaluation` provides functionality to evaluate Segment Anything models on (microscopy) segmentation tasks.
8-
- `micro_sam.traning` implements the training functionality to finetune Segment Anything for custom segmentation datasets.
8+
- `micro_sam.training` implements the training functionality to finetune Segment Anything for custom segmentation datasets.
99
- `micro_sam.sam_annotator` implements the interactive annotation tools.
1010

1111
## Annotation Tools

examples/object_classifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _get_livecell_data():
8282

8383
embedding_path = os.path.join(EMBEDDING_CACHE, "embeddings-livecell-vit_b_lm.zarr")
8484

85-
# This is the vit-b-lm segmentation and a test annotaiton.
85+
# This is the vit-b-lm segmentation and a test annotation.
8686
segmentation = imageio.imread("./clf-test-data/livecell-test-seg.tif")
8787
annotations = imageio.imread("./clf-test-data/livecell-test-annotations.tif")
8888

@@ -97,7 +97,7 @@ def _get_wholeslide_data():
9797

9898
embedding_path = os.path.join(EMBEDDING_CACHE, "whole-slide-embeddings-vit_b_lm.zarr")
9999

100-
# This is the vit-b-lm segmentation and a test annotaiton.
100+
# This is the vit-b-lm segmentation and a test annotation.
101101
segmentation = imageio.imread("./clf-test-data/whole-slide-seg.tif")
102102
annotations = imageio.imread("./clf-test-data/wholeslide-annotations.tif")
103103

micro_sam/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.7.0"
1+
__version__ = "1.7.1"

micro_sam/bioimageio/model_export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def export_sam_model(
283283
284284
Args:
285285
image: The image for generating test data.
286-
label_image: The segmentation correspoding to `image`.
286+
label_image: The segmentation corresponding to `image`.
287287
It is used to derive prompt inputs for the model.
288288
model_type: The type of the SAM model.
289289
name: The name of the exported model.

micro_sam/instance_segmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ def prompt_function(foreground, center_distances, boundary_distances, **kwargs)
14081408

14091409
# 2.) Apply the predictor to the prompts.
14101410
if prompts is None: # No prompts were derived, we can't do much further and return empty masks.
1411-
return np.zeros(foreground.shape, dtype="uint32") if output_mode == "instance_egmentation" else []
1411+
return np.zeros(foreground.shape, dtype="uint32") if output_mode == "instance_segmentation" else []
14121412
else:
14131413
predictions = batched_inference(
14141414
self._predictor,

micro_sam/models/peft_sam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def allow_gradient_update_for_parameters(
269269
Args:
270270
prefix: Matches the part of parameter name in front.
271271
suffix: Matches the part of parameter name at the end.
272-
infix: Matches parts of parameter name occuring in between.
272+
infix: Matches parts of parameter name occurring in between.
273273
"""
274274
for k, v in self.block.named_parameters():
275275
if prefix is not None and k.startswith(tuple(prefix)):

micro_sam/multi_dimensional_segmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ def _filter_lineages(lineages, tracking_result):
567567
def _tracking_impl(timeseries, segmentation, mode, min_time_extent, output_folder=None):
568568
device = "cuda" if torch.cuda.is_available() else "cpu"
569569
model = Trackastra.from_pretrained("general_2d", device=device)
570-
lineage_graph = model.track(timeseries, segmentation, mode=mode)
570+
lineage_graph, _ = model.track(timeseries, segmentation, mode=mode)
571571
track_data, parent_graph, _ = graph_to_napari_tracks(lineage_graph)
572572
node_to_track, lineages = _extract_tracks_and_lineages(segmentation, track_data, parent_graph)
573573
tracking_result = recolor_segmentation(segmentation, node_to_track)

micro_sam/sam_annotator/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ def _batched_interactive_segmentation(predictor, points, labels, boxes, image_em
448448
# (This is left here as a reference for how this can be implemented.
449449
# I have not decided yet if this is actually a good idea or not.)
450450
# # If we have no objects: this is the first call for a batched segmentation.
451-
# # We treat each positive point or box as a separate obejct.
451+
# # We treat each positive point or box as a separate object.
452452
# if len(seg_ids) == 1:
453453
# # Create a list of all prompts.
454454
# batched_prompts = [(None, point, label) for point, label in zip(batched_points, batched_labels)]

micro_sam/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ def segmentation_to_one_hot(segmentation: np.ndarray, segmentation_ids: Optional
13601360
masks = masks.unsqueeze(0) # add dimension to scatter
13611361
masks = torch.zeros(one_hot_shape).scatter_(0, masks, 1)[1:]
13621362

1363-
# add the extra singleton dimenion to get shape NUM_OBJECTS x 1 x H x W
1363+
# add the extra singleton dimension to get shape NUM_OBJECTS x 1 x H x W
13641364
masks = masks.unsqueeze(1)
13651365
return masks
13661366

0 commit comments

Comments
 (0)