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
[](https://github.com/qubvel/segmentation_models.pytorch/actions/workflows/tests.yml)
9
-
[](https://smp.readthedocs.io/en/latest/)
[](https://github.com/qubvel/segmentation_models.pytorch/actions/workflows/tests.yml)
9
+
[](https://smp.readthedocs.io/en/latest/)
Visit [Read The Docs Project Page](https://smp.readthedocs.io/) or read the following README to know more about Segmentation Models Pytorch (SMP for short) library
@@ -55,7 +55,7 @@ The segmentation model is just a PyTorch `torch.nn.Module`, which can be created
55
55
import segmentation_models_pytorch as smp
56
56
57
57
model = smp.Unet(
58
-
encoder_name="resnet34", # choose encoder, e.g. mobilenet_v2 or efficientnet-b7
58
+
encoder_name="resnet34", # choose encoder, e.g. mobilenet_v2 or timm-efficientnet-b7
59
59
encoder_weights="imagenet", # use `imagenet` pre-trained weights for encoder initialization
60
60
in_channels=1, # model input channels (1 for gray-scale images, 3 for RGB, etc.)
61
61
classes=3, # model output channels (number of classes in your dataset)
@@ -277,14 +277,6 @@ The following is a list of supported encoders in the SMP. Select the appropriate
@@ -361,7 +353,7 @@ The following is a list of supported encoders in the SMP. Select the appropriate
361
353
362
354
Backbone from SegFormer pretrained on Imagenet! Can be used with other decoders from package, you can combine Mix Vision Transformer with Unet, FPN and others!
363
355
364
-
Limitations:
356
+
Limitations:
365
357
366
358
- encoder is **not** supported by Linknet, Unet++
367
359
- encoder is supported by FPN only for encoder **depth = 5**
@@ -423,18 +415,18 @@ Total number of supported encoders: 549
423
415
##### Input channels
424
416
Input channels parameter allows you to create models, which process tensors with arbitrary number of channels.
425
417
If you use pretrained weights from imagenet - weights of first convolution will be reused. For
426
-
1-channel case it would be a sum of weights of first convolution layer, otherwise channels would be
418
+
1-channel case it would be a sum of weights of first convolution layer, otherwise channels would be
427
419
populated with weights like `new_weight[:, i] = pretrained_weight[:, i % 3]` and than scaled with `new_weight * 3 / new_in_channels`.
428
420
```python
429
421
model = smp.FPN('resnet34', in_channels=1)
430
422
mask = model(torch.ones([1, 1, 64, 64]))
431
423
```
432
424
433
-
##### Auxiliary classification output
434
-
All models support `aux_params` parameters, which is default set to `None`.
425
+
##### Auxiliary classification output
426
+
All models support `aux_params` parameters, which is default set to `None`.
435
427
If `aux_params = None` then classification auxiliary output is not created, else
436
428
model produce not only `mask`, but also `label` output with shape `NC`.
437
-
Classification head consists of GlobalPooling->Dropout(optional)->Linear->Activation(optional) layers, which can be
429
+
Classification head consists of GlobalPooling->Dropout(optional)->Linear->Activation(optional) layers, which can be
0 commit comments