You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/installation.md
+21-20Lines changed: 21 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,41 +1,43 @@
1
1
# Installation
2
2
3
3
We provide three different ways of installing `micro_sam`:
4
-
-[From conda](#from-conda) is the recommended way if you want to use all functionality.
5
-
-[From source](#from-source) for setting up a development environment to change and potentially contribute to our software.
4
+
-[From mamba](#from-mamba) is the recommended way if you want to use all functionality.
5
+
-[From source](#from-source) for setting up a development environment to use the latest version and be able to change and contribute to our software.
6
6
-[From installer](#from-installer) to install without having to use conda. This mode of installation is still experimental! It only provides the annotation tools and does not enable model finetuning.
In case the installation via conda takes too long consider using [mamba](https://mamba.readthedocs.io/en/latest/).
33
-
Once you have it installed you can simply replace the `conda` commands with `mamba`.
31
+
You also need to install napari to use the annotation tool:
32
+
```
33
+
$ mamba install -c conda-forge napari pyqt
34
+
```
35
+
(We don't include napari in the default installation dependencies to keep the choice of rendering backend flexible.)
34
36
35
37
36
38
## From source
37
39
38
-
To install `micro_sam` from source, we recommend to first set up a conda environment with the necessary requirements:
40
+
To install `micro_sam` from source, we recommend to first set up an environment with the necessary requirements:
39
41
-[environment_gpu.yaml](https://github.com/computational-cell-analytics/micro-sam/blob/master/environment_gpu.yaml): sets up an environment with GPU support.
40
42
-[environment_cpu.yaml](https://github.com/computational-cell-analytics/micro-sam/blob/master/environment_cpu.yaml): sets up an environment with CPU support.
41
43
@@ -52,11 +54,11 @@ $ cd micro_sam
52
54
3. Create the GPU or CPU environment:
53
55
54
56
```
55
-
$ conda env create -f <ENV_FILE>.yaml
57
+
$ mamba env create -f <ENV_FILE>.yaml
56
58
```
57
59
4. Activate the environment:
58
60
```
59
-
$ conda activate sam
61
+
$ mamba activate sam
60
62
```
61
63
5. Install `micro_sam`:
62
64
```
@@ -65,7 +67,6 @@ $ pip install -e .
65
67
66
68
**Troubleshooting:**
67
69
68
-
- On some systems `conda` is extremely slow and cannot resolve the environment in the step `conda env create ...`. You can use `mamba` instead, which is a faster re-implementation of `conda`. It can resolve the environment in less than a minute on any system we tried. Check out [this link](https://mamba.readthedocs.io/en/latest/installation.html) for how to install `mamba`. Once you have installed it, run `mamba env create -f <ENV_FILE>.yaml` to create the env.
69
70
- Installation on MAC with a M1 or M2 processor:
70
71
- The pytorch installation from `environment_cpu.yaml` does not work with a MAC that has an M1 or M2 processor. Instead you need to:
71
72
- Create a new environment: `mamba create -c conda-forge python pip -n sam`
@@ -89,7 +90,7 @@ We also provide installers for Linux and Windows:
89
90
90
91
**The installers are stil experimental and not fully tested.** Mac is not supported yet, but we are working on also providing an installer for it.
91
92
92
-
If you encounter problems with them then please consider installing `micro_sam` via [conda](#from-conda) instead.
93
+
If you encounter problems with them then please consider installing `micro_sam` via [mamba](#from-mamba) instead.
Copy file name to clipboardExpand all lines: doc/python_library.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,4 +26,9 @@ TODO: provide link to the paper with results on how much data is needed
26
26
27
27
The training logic is implemented in `micro_sam.training` and is based on [torch-em](https://github.com/constantinpape/torch-em). Please check out [examples/finetuning](https://github.com/computational-cell-analytics/micro-sam/tree/master/examples/finetuning) to see how you can finetune on your own data with it. The script `finetune_hela.py` contains an example for finetuning on a small custom microscopy dataset and `use_finetuned_model.py` shows how this model can then be used in the interactive annotation tools.
28
28
29
+
Since release v0.4.0 we also support training an additional decoder for automatic instance segmentation. This yields better results than the automatic mask generation of segment anything and is significantly faster.
30
+
You can enable training of the decoder by setting `train_instance_segmentation = True`[here](https://github.com/computational-cell-analytics/micro-sam/blob/master/examples/finetuning/finetune_hela.py#L165).
31
+
The script `instance_segmentation_with_finetuned_model.py` shows how to use it for automatic instance segmentation.
32
+
We will fully integrate this functionality with the annotation tool in the next release.
33
+
29
34
More advanced examples, including quantitative and qualitative evaluation, of finetuned models can be found in [finetuning](https://github.com/computational-cell-analytics/micro-sam/tree/master/finetuning), which contains the code for training and evaluating our microscopy models.
This folder contains example scripts that show how to finetune a SAM model on your own data and how the finetuned model can then be used:
4
+
-`finetune_hela.py`: Shows how to finetune the model on new data. Set `train_instance_segmentation` (line 165) to `True` in order to also train a decoder for automatic instance segmentation.
5
+
-`annotator_with_finetuned_model.py`: Use the finetuned model in the 2d annotator.
6
+
-`instance_segmentation_with_finetuned_model`: Use the finetuned model for automatic instance segmentation (only if you have trained with `train_instance_segmentation = True`).
0 commit comments