Skip to content

Commit

Permalink
Fix amg for the image series annotator (#398)
Browse files Browse the repository at this point in the history
* Fix amg for the image series annotator

* Skip widget test on windows

* Bump version
  • Loading branch information
constantinpape authored Feb 20, 2024
1 parent 95216eb commit e5e7550
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Compared to these we support more applications (2d, 3d and tracking), and provid

## Release Overview

**New in version 0.4.1**

- Bugfix for the image series annotator. Before the automatic segmentation did not work correctly.

**New in version 0.4.0**

- Significantly improved model finetuning
Expand Down
2 changes: 1 addition & 1 deletion micro_sam/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.0"
__version__ = "0.4.1"
3 changes: 3 additions & 0 deletions micro_sam/sam_annotator/image_series_annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .. import util
from ..precompute_state import _precompute_state_for_files
from .annotator_2d import annotator_2d
from ._state import AnnotatorState


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

v.window.add_dock_widget(next_image)
Expand Down
3 changes: 3 additions & 0 deletions test/test_sam_annotator/test_widgets.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import json
import os
import platform

from mobile_sam.predictor import SamPredictor as MobileSamPredictor
from segment_anything.predictor import SamPredictor
import pytest
import torch
import zarr

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

0 comments on commit e5e7550

Please sign in to comment.