Skip to content

Commit 07a0040

Browse files
authored
Models API
1 parent 8f10772 commit 07a0040

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ The main features of this library are:
1414
1. [Quick start](#start)
1515
2. [Examples](#examples)
1616
3. [Models](#models)
17-
1. [Architectires](#architectires)
17+
1. [Architectures](#architectires)
1818
2. [Encoders](#encoders)
1919
3. [Pretrained weights](#weights)
20-
4. [Installation](#installation)
21-
5. [License](#license)
20+
4. [Models API](#api)
21+
5. [Installation](#installation)
22+
6. [License](#license)
2223

2324
### Quick start <a name="start"></a>
2425
Since the library is built on the PyTorch framework, created segmentation model is just a PyTorch nn.Module, which can be created as easy as:
@@ -77,6 +78,12 @@ preprocess_input = get_preprocessing_fn('renset18', pretrained='imagenet')
7778
| imagenet+5k | dpn68b, dpn92, dpn107 |
7879
| imagenet | * all other encoders |
7980

81+
### Models API <a name="api"></a>
82+
- `model.encoder` - pretrained backbone to extract features of different spatial resolution
83+
- `model.decoder` - segmentation head, depends on models architecture (`Unet`/`Linknet`/`PSPNet`/`FPN`)
84+
- `model.activation` - output activation function, one of `sigmoid`, `softmax`
85+
- `model.forward(x)` - sequentially pass `x` through model\`s encoder and decoder (return logits!)
86+
- `model.predict(x)` - inference method, switch model to `.eval()` mode, call `.forward(x)` and apply activation function with `torch.no_grad()`
8087

8188
### Installation <a name="installation"></a>
8289
PyPI version:

0 commit comments

Comments
 (0)