Skip to content

Commit 4507499

Browse files
committed
Add usage for H&E model
1 parent e78dcef commit 4507499

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ conda install pytorch pytorch-cuda=12.1 -c pytorch -c nvidia
3434
Install Turing Segment using `pip`:
3535

3636
```bash
37-
pip install --upgrade turing_segment
37+
pip install --index-url https://pypi.bioturing.com/simple turing_segment
3838
```
3939

4040
## Usage
@@ -56,6 +56,11 @@ turing_segment --help
5656
```bash
5757
tuirng_segment infer --image-path /path/to/image --output-dir /path/to/output_dir
5858
```
59+
By default, the model used is `cyto3`, if you want to use HE model, you must provide the `--model-type he` argument.
60+
61+
```bash
62+
tuirng_segment infer --image-path /path/to/image --model-type he --output-dir /path/to/output_dir
63+
```
5964

6065
Output format:
6166

@@ -107,10 +112,18 @@ stitch:
107112
---
108113
**3. Specify the `channels`**
109114

110-
To specify channels to segment, use the `--channels` flag. The channels are specified as a comma-separated list of channel indices where the first channel is for membrane and the second channel is for nucleus. If the nucleus channel is not specified, a zero channel is used.
111-
```bash
112-
tuirng_segment infer --image-path /path/to/image --channels 0,1
113-
```
115+
<!-- To specify channels to segment, use the `--channels` flag. The channels are specified as a comma-separated list of channel indices where the first channel is for membrane and the second channel is for nucleus. If the nucleus channel is not specified, a zero channel is used. -->
116+
To specify channels to segment, use the `--channels` flag. The channels are specified as a comma-separated list of channel indices. You must past the channel indices in the order of the model input.
117+
118+
- Fluorescence image: The first channel is for membrane and the second channel is for nucleus. If the nucleus channel is not specified, a zero channel is used.
119+
```bash
120+
tuirng_segment infer --image-path /path/to/image --model-type cyto3 --channels 0,1
121+
```
122+
123+
- Hematoxylin and eosin (H&E) image: The first channel is for red, the second channel is for green, and the third channel is for blue (RGB).
124+
```bash
125+
tuirng_segment infer --image-path /path/to/image --model-type he --channels 0,1,2
126+
```
114127
If the image has the channel in the last dimension, use the `--channel-last` flag.
115128

116129
---
@@ -150,14 +163,14 @@ postprocess:
150163
```
151164

152165
---
153-
**6. Checkpoint download**
166+
**6. Checkpoint download**
154167

155-
By default, the model checkpoints are downloaded if they are not present in the cache directory. If you want to use a custom checkpoint from cellpose training pipeline, you can set the model type as `--model-type manual` and specify the paths to the model and size model checkpoints using the `--model-path` and `--size-model-path` flags, respectively. You may skip specifying `--size-model-path` if a provided scale is specified by ``--scale``.
168+
By default, the model checkpoints are downloaded if they are not present in the cache directory. If you want to use a custom checkpoint from cellpose training pipeline, you can specify the paths to the model and size model checkpoints using the `--model-path` and `--size-model-path` flags, respectively. You may skip specifying `--size-model-path` if a provided scale is specified by ``--scale``.
156169

157170
```bash
158171
turing_segment infer \
159172
--image-path /path/to/image \
160-
--model-type manual \
173+
--model-type <cyto_or_he> \
161174
--model-path /path/to/model_checkpoint \
162175
--size-model-path /path/to/size_model_checkpoint
163176
```

0 commit comments

Comments
 (0)