From 34889337cb402c9d205504385d1a9a95b9258a78 Mon Sep 17 00:00:00 2001 From: Anwai Archit <52396323+anwai98@users.noreply.github.com> Date: Fri, 31 May 2024 09:42:38 +0200 Subject: [PATCH] Upstream dev with master (#624) * Update modelzoo urls (#619) * Update installation.md (#617) * Bump to 101 (#620) * Update docs (#621) * Add progressbar to pooch download (#623) --------- Co-authored-by: Constantin Pape --- README.md | 4 ++++ doc/installation.md | 14 +++++++++----- micro_sam/__version__.py | 2 +- micro_sam/util.py | 29 ++++++++++++++--------------- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 8a06ba26..8a3442b4 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/doc/installation.md b/doc/installation.md index 1edb5e51..5fb23278 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -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 @@ -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 @@ -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) @@ -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). diff --git a/micro_sam/__version__.py b/micro_sam/__version__.py index 244424e5..5c4105cd 100644 --- a/micro_sam/__version__.py +++ b/micro_sam/__version__.py @@ -1 +1 @@ -__version__ = "1.0.0post0" +__version__ = "1.0.1" diff --git a/micro_sam/util.py b/micro_sam/util.py index f16911be..c9768dc8 100644 --- a/micro_sam/util.py +++ b/micro_sam/util.py @@ -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} @@ -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: