Skip to content

Commit e5e7550

Browse files
Fix amg for the image series annotator (#398)
* Fix amg for the image series annotator * Skip widget test on windows * Bump version
1 parent 95216eb commit e5e7550

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ Compared to these we support more applications (2d, 3d and tracking), and provid
5858

5959
## Release Overview
6060

61+
**New in version 0.4.1**
62+
63+
- Bugfix for the image series annotator. Before the automatic segmentation did not work correctly.
64+
6165
**New in version 0.4.0**
6266

6367
- Significantly improved model finetuning

micro_sam/__version__.py

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

micro_sam/sam_annotator/image_series_annotator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from .. import util
1515
from ..precompute_state import _precompute_state_for_files
1616
from .annotator_2d import annotator_2d
17+
from ._state import AnnotatorState
1718

1819

1920
def image_series_annotator(
@@ -92,6 +93,8 @@ def next_image(*args):
9293
print("Loading next image from:", image_files[next_image_id])
9394
image = imageio.imread(image_files[next_image_id])
9495
image_embedding_path = None if embedding_paths is None else embedding_paths[next_image_id]
96+
# Reset the state.
97+
AnnotatorState().reset_state()
9598
annotator_2d(image, embedding_path=image_embedding_path, v=v, return_viewer=True, predictor=predictor, **kwargs)
9699

97100
v.window.add_dock_widget(next_image)

test/test_sam_annotator/test_widgets.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import json
22
import os
3+
import platform
34

45
from mobile_sam.predictor import SamPredictor as MobileSamPredictor
56
from segment_anything.predictor import SamPredictor
7+
import pytest
68
import torch
79
import zarr
810

@@ -15,6 +17,7 @@
1517
# you don't need to import it, as long as napari is installed
1618
# in your testing environment.
1719
# tmp_path is a regular pytest fixture.
20+
@pytest.mark.skipif(platform.system() == "Windows", reason="Gui test is not working on windows.")
1821
def test_embedding_widget(make_napari_viewer, tmp_path):
1922
"""Test embedding widget for micro-sam napari plugin."""
2023
# setup

0 commit comments

Comments
 (0)