Skip to content

Commit

Permalink
Merge branch 'dev' into lora-sam
Browse files Browse the repository at this point in the history
  • Loading branch information
anwai98 committed May 31, 2024
2 parents 9f465d0 + 3488933 commit 3b3f896
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ Compared to these we support more applications (2d, 3d and tracking), and provid

## Release Overview

**New in version 1.0.1**

Use stable URL for model downloads and fix issues in state precomputation for automatic segmentation.

**New in version 1.0.0**

This release mainly fixes issues with the previous release and marks the napari user interface as stable.
Expand Down
14 changes: 9 additions & 5 deletions doc/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ There are three ways to install `micro_sam`:

You can find more information on the installation and how to troubleshoot it in [the FAQ section](#installation-questions).

We do *not* recommend installing `micro-sam` with pip.
We do **not** recommend installing `micro-sam` with pip.

## From mamba

Expand All @@ -19,11 +19,11 @@ You can follow the instructions [here](https://mamba.readthedocs.io/en/latest/in

`micro_sam` can be installed in an existing environment via:
```bash
$ mamba install -c conda-forge micro_sam
$ mamba install -c pytorch -c conda-forge micro_sam
```
or you can create a new environment (here called `micro-sam`) via:
```bash
$ mamba create -c conda-forge -n micro-sam micro_sam
$ mamba create -c pytorch -c conda-forge -n micro-sam micro_sam
```
if you want to use the GPU you need to install PyTorch from the `pytorch` channel instead of `conda-forge`. For example:
```bash
Expand Down Expand Up @@ -73,8 +73,8 @@ $ pip install -e .
## From installer

We also provide installers for Linux and Windows:
- [Linux](https://owncloud.gwdg.de/index.php/s/nrNBuHr9ncJqid6)
- [Windows](https://owncloud.gwdg.de/index.php/s/kZmpAIBDmUSu4e9)
- [Linux](https://owncloud.gwdg.de/index.php/s/nvLwlrHE4DkYcWl)
- [Windows](https://owncloud.gwdg.de/index.php/s/feIs9069IrURmbt)
<!---
- [Mac](https://owncloud.gwdg.de/index.php/s/7YupGgACw9SHy2P)
-->
Expand Down Expand Up @@ -113,3 +113,7 @@ https://www.makeuseof.com/how-to-disable-gatekeeper-mac/
TODO detailed instruction
-->

### Easybuild installation

There is also an easy-build recipe for `micro_sam` under development. You can find more information [here](https://github.com/easybuilders/easybuild-easyconfigs/pull/20636).
2 changes: 1 addition & 1 deletion micro_sam/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.0post0"
__version__ = "1.0.1"
29 changes: 14 additions & 15 deletions micro_sam/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,27 +124,26 @@ def models():
}
registry = {**encoder_registry, **decoder_registry}

# Note: the modelzoo urls should be updated at some point to not point at 'staged' but 'published'.
encoder_urls = {
"vit_l": "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth",
"vit_h": "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth",
"vit_b": "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth",
"vit_t": "https://owncloud.gwdg.de/index.php/s/TuDzuwVDHd1ZDnQ/download",
"vit_l_lm": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/idealistic-rat/staged/1/files/vit_l.pt",
"vit_b_lm": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/diplomatic-bug/staged/1/files/vit_b.pt",
"vit_t_lm": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/faithful-chicken/staged/1/files/vit_t.pt",
"vit_l_em_organelles": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/humorous-crab/staged/1/files/vit_l.pt",
"vit_b_em_organelles": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/noisy-ox/staged/1/files/vit_b.pt",
"vit_t_em_organelles": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/greedy-whale/staged/1/files/vit_t.pt",
"vit_l_lm": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/idealistic-rat/1/files/vit_l.pt",
"vit_b_lm": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/diplomatic-bug/1/files/vit_b.pt",
"vit_t_lm": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/faithful-chicken/1/files/vit_t.pt",
"vit_l_em_organelles": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/humorous-crab/1/files/vit_l.pt",
"vit_b_em_organelles": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/noisy-ox/1/files/vit_b.pt",
"vit_t_em_organelles": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/greedy-whale/1/files/vit_t.pt",
}

decoder_urls = {
"vit_l_lm_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/idealistic-rat/staged/1/files/vit_l_decoder.pt",
"vit_b_lm_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/diplomatic-bug/staged/1/files/vit_b_decoder.pt",
"vit_t_lm_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/faithful-chicken/staged/1/files/vit_t_decoder.pt",
"vit_l_em_organelles_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/humorous-crab/staged/1/files/vit_l_decoder.pt",
"vit_b_em_organelles_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/noisy-ox/staged/1/files/vit_b_decoder.pt",
"vit_t_em_organelles_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/greedy-whale/staged/1/files/vit_t_decoder.pt",
"vit_l_lm_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/idealistic-rat/1/files/vit_l_decoder.pt",
"vit_b_lm_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/diplomatic-bug/1/files/vit_b_decoder.pt",
"vit_t_lm_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/faithful-chicken/1/files/vit_t_decoder.pt",
"vit_l_em_organelles_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/humorous-crab/1/files/vit_l_decoder.pt",
"vit_b_em_organelles_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/noisy-ox/1/files/vit_b_decoder.pt",
"vit_t_em_organelles_decoder": "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/greedy-whale/1/files/vit_t_decoder.pt",
}
urls = {**encoder_urls, **decoder_urls}

Expand Down Expand Up @@ -317,13 +316,13 @@ def get_sam_model(
# URL from the model_type. If the model_type is invalid pooch will raise an error.
if checkpoint_path is None:
model_registry = models()
checkpoint_path = model_registry.fetch(model_type)
checkpoint_path = model_registry.fetch(model_type, progressbar=True)
model_hash = model_registry.registry[model_type]

# If we have a custom model then we may also have a decoder checkpoint.
# Download it here, so that we can add it to the state.
decoder_name = f"{model_type}_decoder"
decoder_path = model_registry.fetch(decoder_name) if decoder_name in model_registry.registry else None
decoder_path = model_registry.fetch(decoder_name, progressbar=True) if decoder_name in model_registry.registry else None

# checkpoint_path has been passed, we use it instead of downloading a model.
else:
Expand Down

0 comments on commit 3b3f896

Please sign in to comment.