Encoders
π Available Encoders
=====================
Segmentation Models PyTorch provides support for a wide range of encoders.
This flexibility allows you to use these encoders with any model in the library by
specifying the encoder name in the `encoder_name parameter during model initialization.
Hereβs a quick example of using a ResNet34 encoder with the Unet model:
.. code-block:: python
from segmentation_models_pytorch import Unet
# Initialize Unet with ResNet34 encoder pre-trained on ImageNet
model = Unet(encoder_name="resnet34", encoder_weights="imagenet")
The following encoder families are supported by the library, enabling you to choose the one that best fits your use case:
- Mix Vision Transformer (mit)
- MobileOne
- MobileNet
- EfficientNet
- ResNet
- ResNeXt
- SENet
- DPN
- VGG
- DenseNet
- Xception
- Inception
Choosing the Right Encoder
--------------------------
1. Small Models for Edge Devices
Consider encoders like MobileNet or MobileOne, which have a smaller parameter count and are optimized for lightweight deployment.
2. High Performance
If you require state-of-the-art accuracy Mix Vision Transformer (mit), EfficientNet families offer excellent balance between performance and computational efficiency.
For each encoder, the table below provides detailed information:
1. Pretrained Weights
Specifies the available pretrained weights (e.g., imagenet, imagenet21k).
2. Params, M:
The total number of parameters in the encoder, measured in millions. This metric helps you assess the model's size and computational requirements.
3. Script:
Indicates whether the encoder can be scripted with torch.jit.script.
4. Compile:
Indicates whether the encoder is compatible with torch.compile(model, fullgraph=True, dynamic=True, backend="eager").
You may still get some issues with another backends, such as inductor, depending on the torch/cuda/... dependencies version,
but most of the time it will work.
5. Export:
Indicates whether the encoder can be exported using torch.export.export, making it suitable for deployment in different environments (e.g., ONNX).
============================ ==================================== =========== ======== ========= ========
Encoder Pretrained weights Params, M Script Compile Export
============================ ==================================== =========== ======== ========= ========
resnet18 imagenet / ssl / swsl 11M β
β
β
resnet34 imagenet 21M β
β
β
resnet50 imagenet / ssl / swsl 23M β
β
β
resnet101 imagenet 42M β
β
β
resnet152 imagenet 58M β
β
β
resnext50_32x4d imagenet / ssl / swsl 22M β
β
β
resnext101_32x4d ssl / swsl 42M β
β
β
resnext101_32x8d imagenet / instagram / ssl / swsl 86M β
β
β
resnext101_32x16d instagram / ssl / swsl 191M β
β
β
resnext101_32x32d instagram 466M β
β
β
resnext101_32x48d instagram 826M β
β
β
dpn68 imagenet 11M β β
β
dpn68b imagenet+5k 11M β β
β
dpn92 imagenet+5k 34M β β
β
dpn98 imagenet 58M β β
β
dpn107 imagenet+5k 84M β β
β
dpn131 imagenet 76M β β
β
vgg11 imagenet 9M β
β
β
vgg11_bn imagenet 9M β
β
β
vgg13 imagenet 9M β
β
β
vgg13_bn imagenet 9M β
β
β
vgg16 imagenet 14M β
β
β
vgg16_bn imagenet 14M β
β
β
vgg19 imagenet 20M β
β
β
vgg19_bn imagenet 20M β
β
β
senet154 imagenet 113M β
β
β
se_resnet50 imagenet 26M β
β
β
se_resnet101 imagenet 47M β
β
β
se_resnet152 imagenet 64M β
β
β
se_resnext50_32x4d imagenet 25M β
β
β
se_resnext101_32x4d imagenet 46M β
β
β
densenet121 imagenet 6M β
β
β
densenet169 imagenet 12M β
β
β
densenet201 imagenet 18M β
β
β
densenet161 imagenet 26M β
β
β
inceptionresnetv2 imagenet / imagenet+background 54M β
β
β
inceptionv4 imagenet / imagenet+background 41M β
β
β
efficientnet-b0 imagenet / advprop 4M β
β
β
efficientnet-b1 imagenet / advprop 6M β
β
β
efficientnet-b2 imagenet / advprop 7M β
β
β
efficientnet-b3 imagenet / advprop 10M β
β
β
efficientnet-b4 imagenet / advprop 17M β
β
β
efficientnet-b5 imagenet / advprop 28M β
β
β
efficientnet-b6 imagenet / advprop 40M β
β
β
efficientnet-b7 imagenet / advprop 63M β
β
β
mobilenet_v2 imagenet 2M β
β
β
xception imagenet 20M β
β
β
timm-efficientnet-b0 imagenet / advprop / noisy-student 4M β
β
β
timm-efficientnet-b1 imagenet / advprop / noisy-student 6M β
β
β
timm-efficientnet-b2 imagenet / advprop / noisy-student 7M β
β
β
timm-efficientnet-b3 imagenet / advprop / noisy-student 10M β
β
β
timm-efficientnet-b4 imagenet / advprop / noisy-student 17M β
β
β
timm-efficientnet-b5 imagenet / advprop / noisy-student 28M β
β
β
timm-efficientnet-b6 imagenet / advprop / noisy-student 40M β
β
β
timm-efficientnet-b7 imagenet / advprop / noisy-student 63M β
β
β
timm-efficientnet-b8 imagenet / advprop 84M β
β
β
timm-efficientnet-l2 noisy-student / noisy-student-475 474M β
β
β
timm-tf_efficientnet_lite0 imagenet 3M β
β
β
timm-tf_efficientnet_lite1 imagenet 4M β
β
β
timm-tf_efficientnet_lite2 imagenet 4M β
β
β
timm-tf_efficientnet_lite3 imagenet 6M β
β
β
timm-tf_efficientnet_lite4 imagenet 11M β
β
β
timm-skresnet18 imagenet 11M β
β
β
timm-skresnet34 imagenet 21M β
β
β
timm-skresnext50_32x4d imagenet 23M β
β
β
mit_b0 imagenet 3M β
β
β
mit_b1 imagenet 13M β
β
β
mit_b2 imagenet 24M β
β
β
mit_b3 imagenet 44M β
β
β
mit_b4 imagenet 60M β
β
β
mit_b5 imagenet 81M β
β
β
mobileone_s0 imagenet 4M β
β
β
mobileone_s1 imagenet 3M β
β
β
mobileone_s2 imagenet 5M β
β
β
mobileone_s3 imagenet 8M β
β
β
mobileone_s4 imagenet 12M β
β
β
============================ ==================================== =========== ======== ========= ========
---
Encoders Dpt
:orphan:
.. _dpt-encoders:
DPT Encoders
============
This is a list of Vision Transformer encoders that are compatible with the DPT architecture.
While other Vision Transformer encoders from timm may also be compatible, the ones listed below are tested to work properly.
.. list-table:: Encoder Name
:widths: 100
:header-rows: 0
* - tu-fastvit_ma36.apple_dist_in1k
* - tu-fastvit_ma36.apple_in1k
* - tu-fastvit_mci0.apple_mclip
* - tu-fastvit_mci1.apple_mclip
* - tu-fastvit_mci2.apple_mclip
* - tu-fastvit_s12.apple_dist_in1k
* - tu-fastvit_s12.apple_in1k
* - tu-fastvit_sa12.apple_dist_in1k
* - tu-fastvit_sa12.apple_in1k
* - tu-fastvit_sa24.apple_dist_in1k
* - tu-fastvit_sa24.apple_in1k
* - tu-fastvit_sa36.apple_dist_in1k
* - tu-fastvit_sa36.apple_in1k
* - tu-fastvit_t8.apple_dist_in1k
* - tu-fastvit_t8.apple_in1k
* - tu-fastvit_t12.apple_dist_in1k
* - tu-fastvit_t12.apple_in1k
* - tu-flexivit_base.300ep_in1k
* - tu-flexivit_base.300ep_in21k
* - tu-flexivit_base.600ep_in1k
* - tu-flexivit_base.1000ep_in21k
* - tu-flexivit_base.1200ep_in1k
* - tu-flexivit_base.patch16_in21k
* - tu-flexivit_base.patch30_in21k
* - tu-flexivit_large.300ep_in1k
* - tu-flexivit_large.600ep_in1k
* - tu-flexivit_large.1200ep_in1k
* - tu-flexivit_small.300ep_in1k
* - tu-flexivit_small.600ep_in1k
* - tu-flexivit_small.1200ep_in1k
* - tu-maxvit_base_tf_224.in1k
* - tu-maxvit_base_tf_224.in21k
* - tu-maxvit_base_tf_384.in1k
* - tu-maxvit_base_tf_384.in21k_ft_in1k
* - tu-maxvit_base_tf_512.in1k
* - tu-maxvit_base_tf_512.in21k_ft_in1k
* - tu-maxvit_large_tf_224.in1k
* - tu-maxvit_large_tf_224.in21k
* - tu-maxvit_large_tf_384.in1k
* - tu-maxvit_large_tf_384.in21k_ft_in1k
* - tu-maxvit_large_tf_512.in1k
* - tu-maxvit_large_tf_512.in21k_ft_in1k
* - tu-maxvit_nano_rw_256.sw_in1k
* - tu-maxvit_rmlp_base_rw_224.sw_in12k
* - tu-maxvit_rmlp_base_rw_224.sw_in12k_ft_in1k
* - tu-maxvit_rmlp_base_rw_384.sw_in12k_ft_in1k
* - tu-maxvit_rmlp_nano_rw_256.sw_in1k
* - tu-maxvit_rmlp_pico_rw_256.sw_in1k
* - tu-maxvit_rmlp_small_rw_224.sw_in1k
* - tu-maxvit_rmlp_tiny_rw_256.sw_in1k
* - tu-maxvit_small_tf_224.in1k
* - tu-maxvit_small_tf_384.in1k
* - tu-maxvit_small_tf_512.in1k
* - tu-maxvit_tiny_rw_224.sw_in1k
* - tu-maxvit_tiny_tf_224.in1k
* - tu-maxvit_tiny_tf_384.in1k
* - tu-maxvit_tiny_tf_512.in1k
* - tu-maxvit_xlarge_tf_224.in21k
* - tu-maxvit_xlarge_tf_384.in21k_ft_in1k
* - tu-maxvit_xlarge_tf_512.in21k_ft_in1k
* - tu-maxxvit_rmlp_nano_rw_256.sw_in1k
* - tu-maxxvit_rmlp_small_rw_256.sw_in1k
* - tu-maxxvitv2_nano_rw_256.sw_in1k
* - tu-maxxvitv2_rmlp_base_rw_224.sw_in12k
* - tu-maxxvitv2_rmlp_base_rw_224.sw_in12k_ft_in1k
* - tu-maxxvitv2_rmlp_base_rw_384.sw_in12k_ft_in1k
* - tu-mobilevit_s.cvnets_in1k
* - tu-mobilevit_xs.cvnets_in1k
* - tu-mobilevit_xxs.cvnets_in1k
* - tu-mobilevitv2_050.cvnets_in1k
* - tu-mobilevitv2_075.cvnets_in1k
* - tu-mobilevitv2_100.cvnets_in1k
* - tu-mobilevitv2_125.cvnets_in1k
* - tu-mobilevitv2_150.cvnets_in1k
* - tu-mobilevitv2_150.cvnets_in22k_ft_in1k
* - tu-mobilevitv2_150.cvnets_in22k_ft_in1k_384
* - tu-mobilevitv2_175.cvnets_in1k
* - tu-mobilevitv2_175.cvnets_in22k_ft_in1k
* - tu-mobilevitv2_175.cvnets_in22k_ft_in1k_384
* - tu-mobilevitv2_200.cvnets_in1k
* - tu-mobilevitv2_200.cvnets_in22k_ft_in1k
* - tu-mobilevitv2_200.cvnets_in22k_ft_in1k_384
* - tu-mvitv2_base.fb_in1k
* - tu-mvitv2_base_cls.fb_inw21k
* - tu-mvitv2_huge_cls.fb_inw21k
* - tu-mvitv2_large.fb_in1k
* - tu-mvitv2_large_cls.fb_inw21k
* - tu-mvitv2_small.fb_in1k
* - tu-mvitv2_tiny.fb_in1k
* - tu-samvit_base_patch16.sa1b
* - tu-samvit_huge_patch16.sa1b
* - tu-samvit_large_patch16.sa1b
* - tu-test_vit2.r160_in1k
* - tu-test_vit3.r160_in1k
* - tu-test_vit.r160_in1k
* - tu-vit_base_mci_224.apple_mclip
* - tu-vit_base_mci_224.apple_mclip_lt
* - tu-vit_base_patch8_224.augreg2_in21k_ft_in1k
* - tu-vit_base_patch8_224.augreg_in21k
* - tu-vit_base_patch8_224.augreg_in21k_ft_in1k
* - tu-vit_base_patch8_224.dino
* - tu-vit_base_patch16_224.augreg2_in21k_ft_in1k
* - tu-vit_base_patch16_224.augreg_in1k
* - tu-vit_base_patch16_224.augreg_in21k
* - tu-vit_base_patch16_224.augreg_in21k_ft_in1k
* - tu-vit_base_patch16_224.dino
* - tu-vit_base_patch16_224.mae
* - tu-vit_base_patch16_224.orig_in21k
* - tu-vit_base_patch16_224.orig_in21k_ft_in1k
* - tu-vit_base_patch16_224.sam_in1k
* - tu-vit_base_patch16_224_miil.in21k
* - tu-vit_base_patch16_224_miil.in21k_ft_in1k
* - tu-vit_base_patch16_384.augreg_in1k
* - tu-vit_base_patch16_384.augreg_in21k_ft_in1k
* - tu-vit_base_patch16_384.orig_in21k_ft_in1k
* - tu-vit_base_patch16_clip_224.datacompxl
* - tu-vit_base_patch16_clip_224.dfn2b
* - tu-vit_base_patch16_clip_224.laion2b
* - tu-vit_base_patch16_clip_224.laion2b_ft_in1k
* - tu-vit_base_patch16_clip_224.laion2b_ft_in12k
* - tu-vit_base_patch16_clip_224.laion2b_ft_in12k_in1k
* - tu-vit_base_patch16_clip_224.laion400m_e32
* - tu-vit_base_patch16_clip_224.metaclip_2pt5b
* - tu-vit_base_patch16_clip_224.metaclip_400m
* - tu-vit_base_patch16_clip_224.openai
* - tu-vit_base_patch16_clip_224.openai_ft_in1k
* - tu-vit_base_patch16_clip_224.openai_ft_in12k
* - tu-vit_base_patch16_clip_224.openai_ft_in12k_in1k
* - tu-vit_base_patch16_clip_384.laion2b_ft_in1k
* - tu-vit_base_patch16_clip_384.laion2b_ft_in12k_in1k
* - tu-vit_base_patch16_clip_384.openai_ft_in1k
* - tu-vit_base_patch16_clip_384.openai_ft_in12k_in1k
* - tu-vit_base_patch16_clip_quickgelu_224.metaclip_2pt5b
* - tu-vit_base_patch16_clip_quickgelu_224.metaclip_400m
* - tu-vit_base_patch16_clip_quickgelu_224.openai
* - tu-vit_base_patch16_plus_clip_240.laion400m_e32
* - tu-vit_base_patch16_rope_reg1_gap_256.sbb_in1k
* - tu-vit_base_patch16_rpn_224.sw_in1k
* - tu-vit_base_patch16_siglip_224.v2_webli
* - tu-vit_base_patch16_siglip_224.webli
* - tu-vit_base_patch16_siglip_256.v2_webli
* - tu-vit_base_patch16_siglip_256.webli
* - tu-vit_base_patch16_siglip_256.webli_i18n
* - tu-vit_base_patch16_siglip_384.v2_webli
* - tu-vit_base_patch16_siglip_384.webli
* - tu-vit_base_patch16_siglip_512.v2_webli
* - tu-vit_base_patch16_siglip_512.webli
* - tu-vit_base_patch16_siglip_gap_224.v2_webli
* - tu-vit_base_patch16_siglip_gap_224.webli
* - tu-vit_base_patch16_siglip_gap_256.v2_webli
* - tu-vit_base_patch16_siglip_gap_256.webli
* - tu-vit_base_patch16_siglip_gap_256.webli_i18n
* - tu-vit_base_patch16_siglip_gap_384.v2_webli
* - tu-vit_base_patch16_siglip_gap_384.webli
* - tu-vit_base_patch16_siglip_gap_512.v2_webli
* - tu-vit_base_patch16_siglip_gap_512.webli
* - tu-vit_base_patch32_224.augreg_in1k
* - tu-vit_base_patch32_224.augreg_in21k
* - tu-vit_base_patch32_224.augreg_in21k_ft_in1k
* - tu-vit_base_patch32_224.orig_in21k
* - tu-vit_base_patch32_224.sam_in1k
* - tu-vit_base_patch32_384.augreg_in1k
* - tu-vit_base_patch32_384.augreg_in21k_ft_in1k
* - tu-vit_base_patch32_clip_224.datacompxl
* - tu-vit_base_patch32_clip_224.laion2b
* - tu-vit_base_patch32_clip_224.laion2b_ft_in1k
* - tu-vit_base_patch32_clip_224.laion2b_ft_in12k_in1k
* - tu-vit_base_patch32_clip_224.laion400m_e32
* - tu-vit_base_patch32_clip_224.metaclip_2pt5b
* - tu-vit_base_patch32_clip_224.metaclip_400m
* - tu-vit_base_patch32_clip_224.openai
* - tu-vit_base_patch32_clip_224.openai_ft_in1k
* - tu-vit_base_patch32_clip_256.datacompxl
* - tu-vit_base_patch32_clip_384.laion2b_ft_in12k_in1k
* - tu-vit_base_patch32_clip_384.openai_ft_in12k_in1k
* - tu-vit_base_patch32_clip_448.laion2b_ft_in12k_in1k
* - tu-vit_base_patch32_clip_quickgelu_224.laion400m_e32
* - tu-vit_base_patch32_clip_quickgelu_224.metaclip_2pt5b
* - tu-vit_base_patch32_clip_quickgelu_224.metaclip_400m
* - tu-vit_base_patch32_clip_quickgelu_224.openai
* - tu-vit_base_patch32_siglip_256.v2_webli
* - tu-vit_base_patch32_siglip_gap_256.v2_webli
* - tu-vit_base_r50_s16_224.orig_in21k
* - tu-vit_base_r50_s16_384.orig_in21k_ft_in1k
* - tu-vit_betwixt_patch16_reg1_gap_256.sbb_in1k
* - tu-vit_betwixt_patch16_reg4_gap_256.sbb2_e200_in12k
* - tu-vit_betwixt_patch16_reg4_gap_256.sbb2_e200_in12k_ft_in1k
* - tu-vit_betwixt_patch16_reg4_gap_256.sbb_in1k
* - tu-vit_betwixt_patch16_reg4_gap_256.sbb_in12k
* - tu-vit_betwixt_patch16_reg4_gap_256.sbb_in12k_ft_in1k
* - tu-vit_betwixt_patch16_reg4_gap_384.sbb2_e200_in12k_ft_in1k
* - tu-vit_betwixt_patch16_rope_reg4_gap_256.sbb_in1k
* - tu-vit_betwixt_patch32_clip_224.tinyclip_laion400m
* - tu-vit_giant_patch16_gap_224.in22k_ijepa
* - tu-vit_giantopt_patch16_siglip_256.v2_webli
* - tu-vit_giantopt_patch16_siglip_384.v2_webli
* - tu-vit_giantopt_patch16_siglip_gap_256.v2_webli
* - tu-vit_giantopt_patch16_siglip_gap_384.v2_webli
* - tu-vit_huge_patch16_gap_448.in1k_ijepa
* - tu-vit_large_patch16_224.augreg_in21k
* - tu-vit_large_patch16_224.augreg_in21k_ft_in1k
* - tu-vit_large_patch16_224.mae
* - tu-vit_large_patch16_224.orig_in21k
* - tu-vit_large_patch16_384.augreg_in21k_ft_in1k
* - tu-vit_large_patch16_siglip_256.v2_webli
* - tu-vit_large_patch16_siglip_256.webli
* - tu-vit_large_patch16_siglip_384.v2_webli
* - tu-vit_large_patch16_siglip_384.webli
* - tu-vit_large_patch16_siglip_512.v2_webli
* - tu-vit_large_patch16_siglip_gap_256.v2_webli
* - tu-vit_large_patch16_siglip_gap_256.webli
* - tu-vit_large_patch16_siglip_gap_384.v2_webli
* - tu-vit_large_patch16_siglip_gap_384.webli
* - tu-vit_large_patch16_siglip_gap_512.v2_webli
* - tu-vit_large_patch32_224.orig_in21k
* - tu-vit_large_patch32_384.orig_in21k_ft_in1k
* - tu-vit_large_r50_s32_224.augreg_in21k
* - tu-vit_large_r50_s32_224.augreg_in21k_ft_in1k
* - tu-vit_large_r50_s32_384.augreg_in21k_ft_in1k
* - tu-vit_little_patch16_reg1_gap_256.sbb_in12k
* - tu-vit_little_patch16_reg1_gap_256.sbb_in12k_ft_in1k
* - tu-vit_little_patch16_reg4_gap_256.sbb_in1k
* - tu-vit_medium_patch16_clip_224.tinyclip_yfcc15m
* - tu-vit_medium_patch16_gap_240.sw_in12k
* - tu-vit_medium_patch16_gap_256.sw_in12k_ft_in1k
* - tu-vit_medium_patch16_gap_384.sw_in12k_ft_in1k
* - tu-vit_medium_patch16_reg1_gap_256.sbb_in1k
* - tu-vit_medium_patch16_reg4_gap_256.sbb_in1k
* - tu-vit_medium_patch16_reg4_gap_256.sbb_in12k
* - tu-vit_medium_patch16_reg4_gap_256.sbb_in12k_ft_in1k
* - tu-vit_medium_patch16_rope_reg1_gap_256.sbb_in1k
* - tu-vit_medium_patch32_clip_224.tinyclip_laion400m
* - tu-vit_mediumd_patch16_reg4_gap_256.sbb2_e200_in12k
* - tu-vit_mediumd_patch16_reg4_gap_256.sbb2_e200_in12k_ft_in1k
* - tu-vit_mediumd_patch16_reg4_gap_256.sbb_in12k
* - tu-vit_mediumd_patch16_reg4_gap_256.sbb_in12k_ft_in1k
* - tu-vit_mediumd_patch16_reg4_gap_384.sbb2_e200_in12k_ft_in1k
* - tu-vit_mediumd_patch16_rope_reg1_gap_256.sbb_in1k
* - tu-vit_pwee_patch16_reg1_gap_256.sbb_in1k
* - tu-vit_relpos_base_patch16_224.sw_in1k
* - tu-vit_relpos_base_patch16_clsgap_224.sw_in1k
* - tu-vit_relpos_base_patch32_plus_rpn_256.sw_in1k
* - tu-vit_relpos_medium_patch16_224.sw_in1k
* - tu-vit_relpos_medium_patch16_cls_224.sw_in1k
* - tu-vit_relpos_medium_patch16_rpn_224.sw_in1k
* - tu-vit_relpos_small_patch16_224.sw_in1k
* - tu-vit_small_patch8_224.dino
* - tu-vit_small_patch16_224.augreg_in1k
* - tu-vit_small_patch16_224.augreg_in21k
* - tu-vit_small_patch16_224.augreg_in21k_ft_in1k
* - tu-vit_small_patch16_224.dino
* - tu-vit_small_patch16_384.augreg_in1k
* - tu-vit_small_patch16_384.augreg_in21k_ft_in1k
* - tu-vit_small_patch32_224.augreg_in21k
* - tu-vit_small_patch32_224.augreg_in21k_ft_in1k
* - tu-vit_small_patch32_384.augreg_in21k_ft_in1k
* - tu-vit_small_r26_s32_224.augreg_in21k
* - tu-vit_small_r26_s32_224.augreg_in21k_ft_in1k
* - tu-vit_small_r26_s32_384.augreg_in21k_ft_in1k
* - tu-vit_so150m2_patch16_reg1_gap_256.sbb_e200_in12k
* - tu-vit_so150m2_patch16_reg1_gap_256.sbb_e200_in12k_ft_in1k
* - tu-vit_so150m2_patch16_reg1_gap_384.sbb_e200_in12k_ft_in1k
* - tu-vit_so150m2_patch16_reg1_gap_448.sbb_e200_in12k_ft_in1k
* - tu-vit_so150m_patch16_reg4_gap_256.sbb_e250_in12k
* - tu-vit_so150m_patch16_reg4_gap_256.sbb_e250_in12k_ft_in1k
* - tu-vit_so150m_patch16_reg4_gap_384.sbb_e250_in12k_ft_in1k
* - tu-vit_so400m_patch16_siglip_256.v2_webli
* - tu-vit_so400m_patch16_siglip_256.webli_i18n
* - tu-vit_so400m_patch16_siglip_384.v2_webli
* - tu-vit_so400m_patch16_siglip_512.v2_webli
* - tu-vit_so400m_patch16_siglip_gap_256.v2_webli
* - tu-vit_so400m_patch16_siglip_gap_256.webli_i18n
* - tu-vit_so400m_patch16_siglip_gap_384.v2_webli
* - tu-vit_so400m_patch16_siglip_gap_512.v2_webli
* - tu-vit_srelpos_medium_patch16_224.sw_in1k
* - tu-vit_srelpos_small_patch16_224.sw_in1k
* - tu-vit_tiny_patch16_224.augreg_in21k
* - tu-vit_tiny_patch16_224.augreg_in21k_ft_in1k
* - tu-vit_tiny_patch16_384.augreg_in21k_ft_in1k
* - tu-vit_tiny_r_s16_p8_224.augreg_in21k
* - tu-vit_tiny_r_s16_p8_224.augreg_in21k_ft_in1k
* - tu-vit_tiny_r_s16_p8_384.augreg_in21k_ft_in1k
* - tu-vit_wee_patch16_reg1_gap_256.sbb_in1k
* - tu-vit_xsmall_patch16_clip_224.tinyclip_yfcc15m
* - tu-vitamin_base_224.datacomp1b_clip
* - tu-vitamin_base_224.datacomp1b_clip_ltt
* - tu-vitamin_large2_224.datacomp1b_clip
* - tu-vitamin_large2_256.datacomp1b_clip
* - tu-vitamin_large2_336.datacomp1b_clip
* - tu-vitamin_large2_384.datacomp1b_clip
* - tu-vitamin_large_224.datacomp1b_clip
* - tu-vitamin_large_256.datacomp1b_clip
* - tu-vitamin_large_336.datacomp1b_clip
* - tu-vitamin_large_384.datacomp1b_clip
* - tu-vitamin_small_224.datacomp1b_clip
* - tu-vitamin_small_224.datacomp1b_clip_ltt
* - tu-vitamin_xlarge_256.datacomp1b_clip
* - tu-vitamin_xlarge_336.datacomp1b_clip
* - tu-vitamin_xlarge_384.datacomp1b_clip
* - tu-hiera_small_abswin_256.sbb2_e200_in12k
* - tu-hiera_small_abswin_256.sbb2_e200_in12k_ft_in1k
* - tu-hiera_small_abswin_256.sbb2_pd_e200_in12k
* - tu-hiera_small_abswin_256.sbb2_pd_e200_in12k_ft_in1k
* - tu-swin_base_patch4_window7_224.ms_in1k
* - tu-swin_base_patch4_window7_224.ms_in22k
* - tu-swin_base_patch4_window7_224.ms_in22k_ft_in1k
* - tu-swin_base_patch4_window12_384.ms_in1k
* - tu-swin_base_patch4_window12_384.ms_in22k
* - tu-swin_base_patch4_window12_384.ms_in22k_ft_in1k
* - tu-swin_large_patch4_window7_224.ms_in22k
* - tu-swin_large_patch4_window7_224.ms_in22k_ft_in1k
* - tu-swin_large_patch4_window12_384.ms_in22k
* - tu-swin_large_patch4_window12_384.ms_in22k_ft_in1k
* - tu-swin_s3_base_224.ms_in1k
* - tu-swin_s3_small_224.ms_in1k
* - tu-swin_s3_tiny_224.ms_in1k
* - tu-swin_small_patch4_window7_224.ms_in1k
* - tu-swin_small_patch4_window7_224.ms_in22k
* - tu-swin_small_patch4_window7_224.ms_in22k_ft_in1k
* - tu-swin_tiny_patch4_window7_224.ms_in1k
* - tu-swin_tiny_patch4_window7_224.ms_in22k
* - tu-swin_tiny_patch4_window7_224.ms_in22k_ft_in1k
* - tu-swinv2_base_window8_256.ms_in1k
* - tu-swinv2_base_window12_192.ms_in22k
* - tu-swinv2_base_window12to16_192to256.ms_in22k_ft_in1k
* - tu-swinv2_base_window12to24_192to384.ms_in22k_ft_in1k
* - tu-swinv2_base_window16_256.ms_in1k
* - tu-swinv2_cr_small_224.sw_in1k
* - tu-swinv2_cr_small_ns_224.sw_in1k
* - tu-swinv2_cr_tiny_ns_224.sw_in1k
* - tu-swinv2_large_window12_192.ms_in22k
* - tu-swinv2_large_window12to16_192to256.ms_in22k_ft_in1k
* - tu-swinv2_large_window12to24_192to384.ms_in22k_ft_in1k
* - tu-swinv2_small_window8_256.ms_in1k
* - tu-swinv2_small_window16_256.ms_in1k
* - tu-swinv2_tiny_window8_256.ms_in1k
* - tu-swinv2_tiny_window16_256.ms_in1k
* - tu-efficientformer_l1.snap_dist_in1k
* - tu-efficientformer_l3.snap_dist_in1k
* - tu-efficientformer_l7.snap_dist_in1k
* - tu-beit_base_patch16_224.in22k_ft_in22k
* - tu-beit_base_patch16_224.in22k_ft_in22k_in1k
* - tu-beit_base_patch16_384.in22k_ft_in22k_in1k
* - tu-beit_large_patch16_224.in22k_ft_in22k
* - tu-beit_large_patch16_224.in22k_ft_in22k_in1k
* - tu-beit_large_patch16_384.in22k_ft_in22k_in1k
* - tu-beit_large_patch16_512.in22k_ft_in22k_in1k
* - tu-beitv2_base_patch16_224.in1k_ft_in1k
* - tu-beitv2_base_patch16_224.in1k_ft_in22k
* - tu-beitv2_base_patch16_224.in1k_ft_in22k_in1k
* - tu-beitv2_large_patch16_224.in1k_ft_in1k
* - tu-beitv2_large_patch16_224.in1k_ft_in22k
* - tu-beitv2_large_patch16_224.in1k_ft_in22k_in1k
* - tu-cait_m36_384.fb_dist_in1k
* - tu-cait_m48_448.fb_dist_in1k
* - tu-cait_s24_224.fb_dist_in1k
* - tu-cait_s24_384.fb_dist_in1k
* - tu-cait_s36_384.fb_dist_in1k
* - tu-cait_xs24_384.fb_dist_in1k
* - tu-cait_xxs24_224.fb_dist_in1k
* - tu-cait_xxs24_384.fb_dist_in1k
* - tu-cait_xxs36_224.fb_dist_in1k
* - tu-cait_xxs36_384.fb_dist_in1k
* - tu-coatnet_0_rw_224.sw_in1k
* - tu-coatnet_1_rw_224.sw_in1k
* - tu-coatnet_2_rw_224.sw_in12k
* - tu-coatnet_2_rw_224.sw_in12k_ft_in1k
* - tu-coatnet_3_rw_224.sw_in12k
* - tu-coatnet_bn_0_rw_224.sw_in1k
* - tu-coatnet_nano_rw_224.sw_in1k
* - tu-coatnet_rmlp_1_rw2_224.sw_in12k
* - tu-coatnet_rmlp_1_rw2_224.sw_in12k_ft_in1k
* - tu-coatnet_rmlp_1_rw_224.sw_in1k
* - tu-coatnet_rmlp_2_rw_224.sw_in1k
* - tu-coatnet_rmlp_2_rw_224.sw_in12k
* - tu-coatnet_rmlp_2_rw_224.sw_in12k_ft_in1k
* - tu-coatnet_rmlp_2_rw_384.sw_in12k_ft_in1k
* - tu-coatnet_rmlp_nano_rw_224.sw_in1k
* - tu-deit3_base_patch16_224.fb_in1k
* - tu-deit3_base_patch16_224.fb_in22k_ft_in1k
* - tu-deit3_base_patch16_384.fb_in1k
* - tu-deit3_base_patch16_384.fb_in22k_ft_in1k
* - tu-deit3_large_patch16_224.fb_in1k
* - tu-deit3_large_patch16_224.fb_in22k_ft_in1k
* - tu-deit3_large_patch16_384.fb_in1k
* - tu-deit3_large_patch16_384.fb_in22k_ft_in1k
* - tu-deit3_medium_patch16_224.fb_in1k
* - tu-deit3_medium_patch16_224.fb_in22k_ft_in1k
* - tu-deit3_small_patch16_224.fb_in1k
* - tu-deit3_small_patch16_224.fb_in22k_ft_in1k
* - tu-deit3_small_patch16_384.fb_in1k
* - tu-deit3_small_patch16_384.fb_in22k_ft_in1k
* - tu-deit_base_distilled_patch16_224.fb_in1k
* - tu-deit_base_distilled_patch16_384.fb_in1k
* - tu-deit_base_patch16_224.fb_in1k
* - tu-deit_base_patch16_384.fb_in1k
* - tu-deit_small_distilled_patch16_224.fb_in1k
* - tu-deit_small_patch16_224.fb_in1k
* - tu-deit_tiny_distilled_patch16_224.fb_in1k
* - tu-deit_tiny_patch16_224.fb_in1k
* - tu-regnety_160.deit_in1k
* - tu-twins_pcpvt_base.in1k
* - tu-twins_pcpvt_large.in1k
* - tu-twins_pcpvt_small.in1k
* - tu-twins_svt_base.in1k
* - tu-twins_svt_large.in1k
* - tu-twins_svt_small.in1k
* - tu-xcit_large_24_p8_224.fb_dist_in1k
* - tu-xcit_large_24_p8_224.fb_in1k
* - tu-xcit_large_24_p8_384.fb_dist_in1k
* - tu-xcit_large_24_p16_224.fb_dist_in1k
* - tu-xcit_large_24_p16_224.fb_in1k
* - tu-xcit_large_24_p16_384.fb_dist_in1k
* - tu-xcit_medium_24_p8_224.fb_dist_in1k
* - tu-xcit_medium_24_p8_224.fb_in1k
* - tu-xcit_medium_24_p8_384.fb_dist_in1k
* - tu-xcit_medium_24_p16_224.fb_dist_in1k
* - tu-xcit_medium_24_p16_224.fb_in1k
* - tu-xcit_medium_24_p16_384.fb_dist_in1k
* - tu-xcit_nano_12_p8_224.fb_dist_in1k
* - tu-xcit_nano_12_p8_224.fb_in1k
* - tu-xcit_nano_12_p8_384.fb_dist_in1k
* - tu-xcit_nano_12_p16_224.fb_dist_in1k
* - tu-xcit_nano_12_p16_224.fb_in1k
* - tu-xcit_nano_12_p16_384.fb_dist_in1k
* - tu-xcit_small_12_p8_224.fb_dist_in1k
* - tu-xcit_small_12_p8_224.fb_in1k
* - tu-xcit_small_12_p8_384.fb_dist_in1k
* - tu-xcit_small_12_p16_224.fb_dist_in1k
* - tu-xcit_small_12_p16_224.fb_in1k
* - tu-xcit_small_12_p16_384.fb_dist_in1k
* - tu-xcit_small_24_p8_224.fb_dist_in1k
* - tu-xcit_small_24_p8_224.fb_in1k
* - tu-xcit_small_24_p8_384.fb_dist_in1k
* - tu-xcit_small_24_p16_224.fb_dist_in1k
* - tu-xcit_small_24_p16_224.fb_in1k
* - tu-xcit_small_24_p16_384.fb_dist_in1k
* - tu-xcit_tiny_12_p8_224.fb_dist_in1k
* - tu-xcit_tiny_12_p8_224.fb_in1k
* - tu-xcit_tiny_12_p8_384.fb_dist_in1k
* - tu-xcit_tiny_12_p16_224.fb_dist_in1k
* - tu-xcit_tiny_12_p16_224.fb_in1k
* - tu-xcit_tiny_12_p16_384.fb_dist_in1k
* - tu-xcit_tiny_24_p8_224.fb_dist_in1k
* - tu-xcit_tiny_24_p8_224.fb_in1k
* - tu-xcit_tiny_24_p8_384.fb_dist_in1k
* - tu-xcit_tiny_24_p16_224.fb_dist_in1k
* - tu-xcit_tiny_24_p16_224.fb_in1k
* - tu-xcit_tiny_24_p16_384.fb_dist_in1k
---
Encoders Timm
π― Timm Encoders
================
Pytorch Image Models (a.k.a. timm) has a lot of pretrained models and interface which allows using these models as encoders in smp,
however, not all models are supported
- not all transformer models have features_only functionality implemented that is required for encoder
- some models have inappropriate strides
Below is a table of suitable encoders (for DeepLabV3, DeepLabV3+, and PAN dilation support is needed also)
Total number of encoders: 812 (593+219)
.. note::
To use following encoders you have to add prefix tu-, e.g. tu-adv_inception_v3
Traditional-Style
~~~~~~~~~~~~~~~~~
These models typically produce feature maps at the following downsampling scales relative to the input resolution: 1/2, 1/4, 1/8, 1/16, and 1/32
+----------------------------------+------------------+
| Encoder name | Support dilation |
+==================================+==================+
| bat_resnext26ts | β
|
+----------------------------------+------------------+
| botnet26t_256 | β
|
+----------------------------------+------------------+
| botnet50ts_256 | β
|
+----------------------------------+------------------+
| coatnet_0_224 | |
+----------------------------------+------------------+
| coatnet_0_rw_224 | |
+----------------------------------+------------------+
| coatnet_1_224 | |
+----------------------------------+------------------+
| coatnet_1_rw_224 | |
+----------------------------------+------------------+
| coatnet_2_224 | |
+----------------------------------+------------------+
| coatnet_2_rw_224 | |
+----------------------------------+------------------+
| coatnet_3_224 | |
+----------------------------------+------------------+
| coatnet_3_rw_224 | |
+----------------------------------+------------------+
| coatnet_4_224 | |
+----------------------------------+------------------+
| coatnet_5_224 | |
+----------------------------------+------------------+
| coatnet_bn_0_rw_224 | |
+----------------------------------+------------------+
| coatnet_nano_cc_224 | |
+----------------------------------+------------------+
| coatnet_nano_rw_224 | |
+----------------------------------+------------------+
| coatnet_pico_rw_224 | |
+----------------------------------+------------------+
| coatnet_rmlp_0_rw_224 | |
+----------------------------------+------------------+
| coatnet_rmlp_1_rw2_224 | |
+----------------------------------+------------------+
| coatnet_rmlp_1_rw_224 | |
+----------------------------------+------------------+
| coatnet_rmlp_2_rw_224 | |
+----------------------------------+------------------+
| coatnet_rmlp_2_rw_384 | |
+----------------------------------+------------------+
| coatnet_rmlp_3_rw_224 | |
+----------------------------------+------------------+
| coatnet_rmlp_nano_rw_224 | |
+----------------------------------+------------------+
| coatnext_nano_rw_224 | |
+----------------------------------+------------------+
| cs3darknet_focus_l | β
|
+----------------------------------+------------------+
| cs3darknet_focus_m | β
|
+----------------------------------+------------------+
| cs3darknet_focus_s | β
|
+----------------------------------+------------------+
| cs3darknet_focus_x | β
|
+----------------------------------+------------------+
| cs3darknet_l | β
|
+----------------------------------+------------------+
| cs3darknet_m | β
|
+----------------------------------+------------------+
| cs3darknet_s | β
|
+----------------------------------+------------------+
| cs3darknet_x | β
|
+----------------------------------+------------------+
| cs3edgenet_x | β
|
+----------------------------------+------------------+
| cs3se_edgenet_x | β
|
+----------------------------------+------------------+
| cs3sedarknet_l | β
|
+----------------------------------+------------------+
| cs3sedarknet_x | β
|
+----------------------------------+------------------+
| cs3sedarknet_xdw | β
|
+----------------------------------+------------------+
| cspdarknet53 | β
|
+----------------------------------+------------------+
| cspresnet50 | β
|
+----------------------------------+------------------+
| cspresnet50d | β
|
+----------------------------------+------------------+
| cspresnet50w | β
|
+----------------------------------+------------------+
| cspresnext50 | β
|
+----------------------------------+------------------+
| darknet17 | β
|
+----------------------------------+------------------+
| darknet21 | β
|
+----------------------------------+------------------+
| darknet53 | β
|
+----------------------------------+------------------+
| darknetaa53 | β
|
+----------------------------------+------------------+
| densenet121 | |
+----------------------------------+------------------+
| densenet161 | |
+----------------------------------+------------------+
| densenet169 | |
+----------------------------------+------------------+
| densenet201 | |
+----------------------------------+------------------+
| densenet264d | |
+----------------------------------+------------------+
| densenetblur121d | |
+----------------------------------+------------------+
| dla34 | |
+----------------------------------+------------------+
| dla46_c | |
+----------------------------------+------------------+
| dla46x_c | |
+----------------------------------+------------------+
| dla60 | |
+----------------------------------+------------------+
| dla60_res2net | |
+----------------------------------+------------------+
| dla60_res2next | |
+----------------------------------+------------------+
| dla60x | |
+----------------------------------+------------------+
| dla60x_c | |
+----------------------------------+------------------+
| dla102 | |
+----------------------------------+------------------+
| dla102x | |
+----------------------------------+------------------+
| dla102x2 | |
+----------------------------------+------------------+
| dla169 | |
+----------------------------------+------------------+
| dm_nfnet_f0 | β
|
+----------------------------------+------------------+
| dm_nfnet_f1 | β
|
+----------------------------------+------------------+
| dm_nfnet_f2 | β
|
+----------------------------------+------------------+
| dm_nfnet_f3 | β
|
+----------------------------------+------------------+
| dm_nfnet_f4 | β
|
+----------------------------------+------------------+
| dm_nfnet_f5 | β
|
+----------------------------------+------------------+
| dm_nfnet_f6 | β
|
+----------------------------------+------------------+
| dpn48b | |
+----------------------------------+------------------+
| dpn68 | |
+----------------------------------+------------------+
| dpn68b | |
+----------------------------------+------------------+
| dpn92 | |
+----------------------------------+------------------+
| dpn98 | |
+----------------------------------+------------------+
| dpn107 | |
+----------------------------------+------------------+
| dpn131 | |
+----------------------------------+------------------+
| eca_botnext26ts_256 | β
|
+----------------------------------+------------------+
| eca_halonext26ts | β
|
+----------------------------------+------------------+
| eca_nfnet_l0 | β
|
+----------------------------------+------------------+
| eca_nfnet_l1 | β
|
+----------------------------------+------------------+
| eca_nfnet_l2 | β
|
+----------------------------------+------------------+
| eca_nfnet_l3 | β
|
+----------------------------------+------------------+
| eca_resnet33ts | β
|
+----------------------------------+------------------+
| eca_resnext26ts | β
|
+----------------------------------+------------------+
| eca_vovnet39b | |
+----------------------------------+------------------+
| ecaresnet26t | β
|
+----------------------------------+------------------+
| ecaresnet50d | β
|
+----------------------------------+------------------+
| ecaresnet50d_pruned | β
|
+----------------------------------+------------------+
| ecaresnet50t | β
|
+----------------------------------+------------------+
| ecaresnet101d | β
|
+----------------------------------+------------------+
| ecaresnet101d_pruned | β
|
+----------------------------------+------------------+
| ecaresnet200d | β
|
+----------------------------------+------------------+
| ecaresnet269d | β
|
+----------------------------------+------------------+
| ecaresnetlight | β
|
+----------------------------------+------------------+
| ecaresnext26t_32x4d | β
|
+----------------------------------+------------------+
| ecaresnext50t_32x4d | β
|
+----------------------------------+------------------+
| efficientnet_b0 | β
|
+----------------------------------+------------------+
| efficientnet_b0_g8_gn | β
|
+----------------------------------+------------------+
| efficientnet_b0_g16_evos | β
|
+----------------------------------+------------------+
| efficientnet_b0_gn | β
|
+----------------------------------+------------------+
| efficientnet_b1 | β
|
+----------------------------------+------------------+
| efficientnet_b1_pruned | β
|
+----------------------------------+------------------+
| efficientnet_b2 | β
|
+----------------------------------+------------------+
| efficientnet_b2_pruned | β
|
+----------------------------------+------------------+
| efficientnet_b3 | β
|
+----------------------------------+------------------+
| efficientnet_b3_g8_gn | β
|
+----------------------------------+------------------+
| efficientnet_b3_gn | β
|
+----------------------------------+------------------+
| efficientnet_b3_pruned | β
|
+----------------------------------+------------------+
| efficientnet_b4 | β
|
+----------------------------------+------------------+
| efficientnet_b5 | β
|
+----------------------------------+------------------+
| efficientnet_b6 | β
|
+----------------------------------+------------------+
| efficientnet_b7 | β
|
+----------------------------------+------------------+
| efficientnet_b8 | β
|
+----------------------------------+------------------+
| efficientnet_blur_b0 | β
|
+----------------------------------+------------------+
| efficientnet_cc_b0_4e | β
|
+----------------------------------+------------------+
| efficientnet_cc_b0_8e | β
|
+----------------------------------+------------------+
| efficientnet_cc_b1_8e | β
|
+----------------------------------+------------------+
| efficientnet_el | β
|
+----------------------------------+------------------+
| efficientnet_el_pruned | β
|
+----------------------------------+------------------+
| efficientnet_em | β
|
+----------------------------------+------------------+
| efficientnet_es | β
|
+----------------------------------+------------------+
| efficientnet_es_pruned | β
|
+----------------------------------+------------------+
| efficientnet_l2 | β
|
+----------------------------------+------------------+
| efficientnet_lite0 | β
|
+----------------------------------+------------------+
| efficientnet_lite1 | β
|
+----------------------------------+------------------+
| efficientnet_lite2 | β
|
+----------------------------------+------------------+
| efficientnet_lite3 | β
|
+----------------------------------+------------------+
| efficientnet_lite4 | β
|
+----------------------------------+------------------+
| efficientnetv2_l | β
|
+----------------------------------+------------------+
| efficientnetv2_m | β
|
+----------------------------------+------------------+
| efficientnetv2_rw_m | β
|
+----------------------------------+------------------+
| efficientnetv2_rw_s | β
|
+----------------------------------+------------------+
| efficientnetv2_rw_t | β
|
+----------------------------------+------------------+
| efficientnetv2_s | β
|
+----------------------------------+------------------+
| efficientnetv2_xl | β
|
+----------------------------------+------------------+
| ese_vovnet19b_dw | |
+----------------------------------+------------------+
| ese_vovnet19b_slim | |
+----------------------------------+------------------+
| ese_vovnet19b_slim_dw | |
+----------------------------------+------------------+
| ese_vovnet39b | |
+----------------------------------+------------------+
| ese_vovnet39b_evos | |
+----------------------------------+------------------+
| ese_vovnet57b | |
+----------------------------------+------------------+
| ese_vovnet99b | |
+----------------------------------+------------------+
| fbnetc_100 | β
|
+----------------------------------+------------------+
| fbnetv3_b | β
|
+----------------------------------+------------------+
| fbnetv3_d | β
|
+----------------------------------+------------------+
| fbnetv3_g | β
|
+----------------------------------+------------------+
| gc_efficientnetv2_rw_t | β
|
+----------------------------------+------------------+
| gcresnet33ts | β
|
+----------------------------------+------------------+
| gcresnet50t | β
|
+----------------------------------+------------------+
| gcresnext26ts | β
|
+----------------------------------+------------------+
| gcresnext50ts | β
|
+----------------------------------+------------------+
| gernet_l | β
|
+----------------------------------+------------------+
| gernet_m | β
|
+----------------------------------+------------------+
| gernet_s | β
|
+----------------------------------+------------------+
| ghostnet_050 | |
+----------------------------------+------------------+
| ghostnet_100 | |
+----------------------------------+------------------+
| ghostnet_130 | |
+----------------------------------+------------------+
| ghostnetv2_100 | |
+----------------------------------+------------------+
| ghostnetv2_130 | |
+----------------------------------+------------------+
| ghostnetv2_160 | |
+----------------------------------+------------------+
| halo2botnet50ts_256 | β
|
+----------------------------------+------------------+
| halonet26t | β
|
+----------------------------------+------------------+
| halonet50ts | β
|
+----------------------------------+------------------+
| halonet_h1 | β
|
+----------------------------------+------------------+
| haloregnetz_b | β
|
+----------------------------------+------------------+
| hardcorenas_a | β
|
+----------------------------------+------------------+
| hardcorenas_b | β
|
+----------------------------------+------------------+
| hardcorenas_c | β
|
+----------------------------------+------------------+
| hardcorenas_d | β
|
+----------------------------------+------------------+
| hardcorenas_e | β
|
+----------------------------------+------------------+
| hardcorenas_f | β
|
+----------------------------------+------------------+
| hrnet_w18 | |
+----------------------------------+------------------+
| hrnet_w18_small | |
+----------------------------------+------------------+
| hrnet_w18_small_v2 | |
+----------------------------------+------------------+
| hrnet_w18_ssld | |
+----------------------------------+------------------+
| hrnet_w30 | |
+----------------------------------+------------------+
| hrnet_w32 | |
+----------------------------------+------------------+
| hrnet_w40 | |
+----------------------------------+------------------+
| hrnet_w44 | |
+----------------------------------+------------------+
| hrnet_w48 | |
+----------------------------------+------------------+
| hrnet_w48_ssld | |
+----------------------------------+------------------+
| hrnet_w64 | |
+----------------------------------+------------------+
| lambda_resnet26rpt_256 | β
|
+----------------------------------+------------------+
| lambda_resnet26t | β
|
+----------------------------------+------------------+
| lambda_resnet50ts | β
|
+----------------------------------+------------------+
| lamhalobotnet50ts_256 | β
|
+----------------------------------+------------------+
| lcnet_035 | β
|
+----------------------------------+------------------+
| lcnet_050 | β
|
+----------------------------------+------------------+
| lcnet_075 | β
|
+----------------------------------+------------------+
| lcnet_100 | β
|
+----------------------------------+------------------+
| lcnet_150 | β
|
+----------------------------------+------------------+
| legacy_senet154 | |
+----------------------------------+------------------+
| legacy_seresnet18 | |
+----------------------------------+------------------+
| legacy_seresnet34 | |
+----------------------------------+------------------+
| legacy_seresnet50 | |
+----------------------------------+------------------+
| legacy_seresnet101 | |
+----------------------------------+------------------+
| legacy_seresnet152 | |
+----------------------------------+------------------+
| legacy_seresnext26_32x4d | |
+----------------------------------+------------------+
| legacy_seresnext50_32x4d | |
+----------------------------------+------------------+
| legacy_seresnext101_32x4d | |
+----------------------------------+------------------+
| maxvit_base_tf_224 | |
+----------------------------------+------------------+
| maxvit_base_tf_384 | |
+----------------------------------+------------------+
| maxvit_base_tf_512 | |
+----------------------------------+------------------+
| maxvit_large_tf_224 | |
+----------------------------------+------------------+
| maxvit_large_tf_384 | |
+----------------------------------+------------------+
| maxvit_large_tf_512 | |
+----------------------------------+------------------+
| maxvit_nano_rw_256 | |
+----------------------------------+------------------+
| maxvit_pico_rw_256 | |
+----------------------------------+------------------+
| maxvit_rmlp_base_rw_224 | |
+----------------------------------+------------------+
| maxvit_rmlp_base_rw_384 | |
+----------------------------------+------------------+
| maxvit_rmlp_nano_rw_256 | |
+----------------------------------+------------------+
| maxvit_rmlp_pico_rw_256 | |
+----------------------------------+------------------+
| maxvit_rmlp_small_rw_224 | |
+----------------------------------+------------------+
| maxvit_rmlp_small_rw_256 | |
+----------------------------------+------------------+
| maxvit_rmlp_tiny_rw_256 | |
+----------------------------------+------------------+
| maxvit_small_tf_224 | |
+----------------------------------+------------------+
| maxvit_small_tf_384 | |
+----------------------------------+------------------+
| maxvit_small_tf_512 | |
+----------------------------------+------------------+
| maxvit_tiny_pm_256 | |
+----------------------------------+------------------+
| maxvit_tiny_rw_224 | |
+----------------------------------+------------------+
| maxvit_tiny_rw_256 | |
+----------------------------------+------------------+
| maxvit_tiny_tf_224 | |
+----------------------------------+------------------+
| maxvit_tiny_tf_384 | |
+----------------------------------+------------------+
| maxvit_tiny_tf_512 | |
+----------------------------------+------------------+
| maxvit_xlarge_tf_224 | |
+----------------------------------+------------------+
| maxvit_xlarge_tf_384 | |
+----------------------------------+------------------+
| maxvit_xlarge_tf_512 | |
+----------------------------------+------------------+
| maxxvit_rmlp_nano_rw_256 | |
+----------------------------------+------------------+
| maxxvit_rmlp_small_rw_256 | |
+----------------------------------+------------------+
| maxxvit_rmlp_tiny_rw_256 | |
+----------------------------------+------------------+
| maxxvitv2_nano_rw_256 | |
+----------------------------------+------------------+
| maxxvitv2_rmlp_base_rw_224 | |
+----------------------------------+------------------+
| maxxvitv2_rmlp_base_rw_384 | |
+----------------------------------+------------------+
| maxxvitv2_rmlp_large_rw_224 | |
+----------------------------------+------------------+
| mixnet_l | β
|
+----------------------------------+------------------+
| mixnet_m | β
|
+----------------------------------+------------------+
| mixnet_s | β
|
+----------------------------------+------------------+
| mixnet_xl | β
|
+----------------------------------+------------------+
| mixnet_xxl | β
|
+----------------------------------+------------------+
| mnasnet_050 | β
|
+----------------------------------+------------------+
| mnasnet_075 | β
|
+----------------------------------+------------------+
| mnasnet_100 | β
|
+----------------------------------+------------------+
| mnasnet_140 | β
|
+----------------------------------+------------------+
| mnasnet_small | β
|
+----------------------------------+------------------+
| mobilenet_edgetpu_100 | β
|
+----------------------------------+------------------+
| mobilenet_edgetpu_v2_l | β
|
+----------------------------------+------------------+
| mobilenet_edgetpu_v2_m | β
|
+----------------------------------+------------------+
| mobilenet_edgetpu_v2_s | β
|
+----------------------------------+------------------+
| mobilenet_edgetpu_v2_xs | β
|
+----------------------------------+------------------+
| mobilenetv1_100 | β
|
+----------------------------------+------------------+
| mobilenetv1_100h | β
|
+----------------------------------+------------------+
| mobilenetv1_125 | β
|
+----------------------------------+------------------+
| mobilenetv2_035 | β
|
+----------------------------------+------------------+
| mobilenetv2_050 | β
|
+----------------------------------+------------------+
| mobilenetv2_075 | β
|
+----------------------------------+------------------+
| mobilenetv2_100 | β
|
+----------------------------------+------------------+
| mobilenetv2_110d | β
|
+----------------------------------+------------------+
| mobilenetv2_120d | β
|
+----------------------------------+------------------+
| mobilenetv2_140 | β
|
+----------------------------------+------------------+
| mobilenetv3_large_075 | β
|
+----------------------------------+------------------+
| mobilenetv3_large_100 | β
|
+----------------------------------+------------------+
| mobilenetv3_large_150d | β
|
+----------------------------------+------------------+
| mobilenetv3_rw | β
|
+----------------------------------+------------------+
| mobilenetv3_small_050 | β
|
+----------------------------------+------------------+
| mobilenetv3_small_075 | β
|
+----------------------------------+------------------+
| mobilenetv3_small_100 | β
|
+----------------------------------+------------------+
| mobilenetv4_conv_aa_large | β
|
+----------------------------------+------------------+
| mobilenetv4_conv_aa_medium | β
|
+----------------------------------+------------------+
| mobilenetv4_conv_blur_medium | β
|
+----------------------------------+------------------+
| mobilenetv4_conv_large | β
|
+----------------------------------+------------------+
| mobilenetv4_conv_medium | β
|
+----------------------------------+------------------+
| mobilenetv4_conv_small | β
|
+----------------------------------+------------------+
| mobilenetv4_conv_small_035 | β
|
+----------------------------------+------------------+
| mobilenetv4_conv_small_050 | β
|
+----------------------------------+------------------+
| mobilenetv4_hybrid_large | β
|
+----------------------------------+------------------+
| mobilenetv4_hybrid_large_075 | β
|
+----------------------------------+------------------+
| mobilenetv4_hybrid_medium | β
|
+----------------------------------+------------------+
| mobilenetv4_hybrid_medium_075 | β
|
+----------------------------------+------------------+
| mobileone_s0 | β
|
+----------------------------------+------------------+
| mobileone_s1 | β
|
+----------------------------------+------------------+
| mobileone_s2 | β
|
+----------------------------------+------------------+
| mobileone_s3 | β
|
+----------------------------------+------------------+
| mobileone_s4 | β
|
+----------------------------------+------------------+
| mobilevit_s | β
|
+----------------------------------+------------------+
| mobilevit_xs | β
|
+----------------------------------+------------------+
| mobilevit_xxs | β
|
+----------------------------------+------------------+
| mobilevitv2_050 | β
|
+----------------------------------+------------------+
| mobilevitv2_075 | β
|
+----------------------------------+------------------+
| mobilevitv2_100 | β
|
+----------------------------------+------------------+
| mobilevitv2_125 | β
|
+----------------------------------+------------------+
| mobilevitv2_150 | β
|
+----------------------------------+------------------+
| mobilevitv2_175 | β
|
+----------------------------------+------------------+
| mobilevitv2_200 | β
|
+----------------------------------+------------------+
| nf_ecaresnet26 | β
|
+----------------------------------+------------------+
| nf_ecaresnet50 | β
|
+----------------------------------+------------------+
| nf_ecaresnet101 | β
|
+----------------------------------+------------------+
| nf_regnet_b0 | β
|
+----------------------------------+------------------+
| nf_regnet_b1 | β
|
+----------------------------------+------------------+
| nf_regnet_b2 | β
|
+----------------------------------+------------------+
| nf_regnet_b3 | β
|
+----------------------------------+------------------+
| nf_regnet_b4 | β
|
+----------------------------------+------------------+
| nf_regnet_b5 | β
|
+----------------------------------+------------------+
| nf_resnet26 | β
|
+----------------------------------+------------------+
| nf_resnet50 | β
|
+----------------------------------+------------------+
| nf_resnet101 | β
|
+----------------------------------+------------------+
| nf_seresnet26 | β
|
+----------------------------------+------------------+
| nf_seresnet50 | β
|
+----------------------------------+------------------+
| nf_seresnet101 | β
|
+----------------------------------+------------------+
| nfnet_f0 | β
|
+----------------------------------+------------------+
| nfnet_f1 | β
|
+----------------------------------+------------------+
| nfnet_f2 | β
|
+----------------------------------+------------------+
| nfnet_f3 | β
|
+----------------------------------+------------------+
| nfnet_f4 | β
|
+----------------------------------+------------------+
| nfnet_f5 | β
|
+----------------------------------+------------------+
| nfnet_f6 | β
|
+----------------------------------+------------------+
| nfnet_f7 | β
|
+----------------------------------+------------------+
| nfnet_l0 | β
|
+----------------------------------+------------------+
| regnetv_040 | β
|
+----------------------------------+------------------+
| regnetv_064 | β
|
+----------------------------------+------------------+
| regnetx_002 | β
|
+----------------------------------+------------------+
| regnetx_004 | β
|
+----------------------------------+------------------+
| regnetx_004_tv | β
|
+----------------------------------+------------------+
| regnetx_006 | β
|
+----------------------------------+------------------+
| regnetx_008 | β
|
+----------------------------------+------------------+
| regnetx_016 | β
|
+----------------------------------+------------------+
| regnetx_032 | β
|
+----------------------------------+------------------+
| regnetx_040 | β
|
+----------------------------------+------------------+
| regnetx_064 | β
|
+----------------------------------+------------------+
| regnetx_080 | β
|
+----------------------------------+------------------+
| regnetx_120 | β
|
+----------------------------------+------------------+
| regnetx_160 | β
|
+----------------------------------+------------------+
| regnetx_320 | β
|
+----------------------------------+------------------+
| regnety_002 | β
|
+----------------------------------+------------------+
| regnety_004 | β
|
+----------------------------------+------------------+
| regnety_006 | β
|
+----------------------------------+------------------+
| regnety_008 | β
|
+----------------------------------+------------------+
| regnety_008_tv | β
|
+----------------------------------+------------------+
| regnety_016 | β
|
+----------------------------------+------------------+
| regnety_032 | β
|
+----------------------------------+------------------+
| regnety_040 | β
|
+----------------------------------+------------------+
| regnety_040_sgn | β
|
+----------------------------------+------------------+
| regnety_064 | β
|
+----------------------------------+------------------+
| regnety_080 | β
|
+----------------------------------+------------------+
| regnety_080_tv | β
|
+----------------------------------+------------------+
| regnety_120 | β
|
+----------------------------------+------------------+
| regnety_160 | β
|
+----------------------------------+------------------+
| regnety_320 | β
|
+----------------------------------+------------------+
| regnety_640 | β
|
+----------------------------------+------------------+
| regnety_1280 | β
|
+----------------------------------+------------------+
| regnety_2560 | β
|
+----------------------------------+------------------+
| regnetz_005 | β
|
+----------------------------------+------------------+
| regnetz_040 | β
|
+----------------------------------+------------------+
| regnetz_040_h | β
|
+----------------------------------+------------------+
| regnetz_b16 | β
|
+----------------------------------+------------------+
| regnetz_b16_evos | β
|
+----------------------------------+------------------+
| regnetz_c16 | β
|
+----------------------------------+------------------+
| regnetz_c16_evos | β
|
+----------------------------------+------------------+
| regnetz_d8 | β
|
+----------------------------------+------------------+
| regnetz_d8_evos | β
|
+----------------------------------+------------------+
| regnetz_d32 | β
|
+----------------------------------+------------------+
| regnetz_e8 | β
|
+----------------------------------+------------------+
| repghostnet_050 | |
+----------------------------------+------------------+
| repghostnet_058 | |
+----------------------------------+------------------+
| repghostnet_080 | |
+----------------------------------+------------------+
| repghostnet_100 | |
+----------------------------------+------------------+
| repghostnet_111 | |
+----------------------------------+------------------+
| repghostnet_130 | |
+----------------------------------+------------------+
| repghostnet_150 | |
+----------------------------------+------------------+
| repghostnet_200 | |
+----------------------------------+------------------+
| repvgg_a0 | β
|
+----------------------------------+------------------+
| repvgg_a1 | β
|
+----------------------------------+------------------+
| repvgg_a2 | β
|
+----------------------------------+------------------+
| repvgg_b0 | β
|
+----------------------------------+------------------+
| repvgg_b1 | β
|
+----------------------------------+------------------+
| repvgg_b1g4 | β
|
+----------------------------------+------------------+
| repvgg_b2 | β
|
+----------------------------------+------------------+
| repvgg_b2g4 | β
|
+----------------------------------+------------------+
| repvgg_b3 | β
|
+----------------------------------+------------------+
| repvgg_b3g4 | β
|
+----------------------------------+------------------+
| repvgg_d2se | β
|
+----------------------------------+------------------+
| res2net50_14w_8s | β
|
+----------------------------------+------------------+
| res2net50_26w_4s | β
|
+----------------------------------+------------------+
| res2net50_26w_6s | β
|
+----------------------------------+------------------+
| res2net50_26w_8s | β
|
+----------------------------------+------------------+
| res2net50_48w_2s | β
|
+----------------------------------+------------------+
| res2net50d | β
|
+----------------------------------+------------------+
| res2net101_26w_4s | β
|
+----------------------------------+------------------+
| res2net101d | β
|
+----------------------------------+------------------+
| res2next50 | β
|
+----------------------------------+------------------+
| resnest14d | β
|
+----------------------------------+------------------+
| resnest26d | β
|
+----------------------------------+------------------+
| resnest50d | β
|
+----------------------------------+------------------+
| resnest50d_1s4x24d | β
|
+----------------------------------+------------------+
| resnest50d_4s2x40d | β
|
+----------------------------------+------------------+
| resnest101e | β
|
+----------------------------------+------------------+
| resnest200e | β
|
+----------------------------------+------------------+
| resnest269e | β
|
+----------------------------------+------------------+
| resnet10t | β
|
+----------------------------------+------------------+
| resnet14t | β
|
+----------------------------------+------------------+
| resnet18 | β
|
+----------------------------------+------------------+
| resnet18d | β
|
+----------------------------------+------------------+
| resnet26 | β
|
+----------------------------------+------------------+
| resnet26d | β
|
+----------------------------------+------------------+
| resnet26t | β
|
+----------------------------------+------------------+
| resnet32ts | β
|
+----------------------------------+------------------+
| resnet33ts | β
|
+----------------------------------+------------------+
| resnet34 | β
|
+----------------------------------+------------------+
| resnet34d | β
|
+----------------------------------+------------------+
| resnet50 | β
|
+----------------------------------+------------------+
| resnet50_clip | β
|
+----------------------------------+------------------+
| resnet50_clip_gap | β
|
+----------------------------------+------------------+
| resnet50_gn | β
|
+----------------------------------+------------------+
| resnet50_mlp | β
|
+----------------------------------+------------------+
| resnet50c | β
|
+----------------------------------+------------------+
| resnet50d | β
|
+----------------------------------+------------------+
| resnet50s | β
|
+----------------------------------+------------------+
| resnet50t | β
|
+----------------------------------+------------------+
| resnet50x4_clip | β
|
+----------------------------------+------------------+
| resnet50x4_clip_gap | β
|
+----------------------------------+------------------+
| resnet50x16_clip | β
|
+----------------------------------+------------------+
| resnet50x16_clip_gap | β
|
+----------------------------------+------------------+
| resnet50x64_clip | β
|
+----------------------------------+------------------+
| resnet50x64_clip_gap | β
|
+----------------------------------+------------------+
| resnet51q | β
|
+----------------------------------+------------------+
| resnet61q | β
|
+----------------------------------+------------------+
| resnet101 | β
|
+----------------------------------+------------------+
| resnet101_clip | β
|
+----------------------------------+------------------+
| resnet101_clip_gap | β
|
+----------------------------------+------------------+
| resnet101c | β
|
+----------------------------------+------------------+
| resnet101d | β
|
+----------------------------------+------------------+
| resnet101s | β
|
+----------------------------------+------------------+
| resnet152 | β
|
+----------------------------------+------------------+
| resnet152c | β
|
+----------------------------------+------------------+
| resnet152d | β
|
+----------------------------------+------------------+
| resnet152s | β
|
+----------------------------------+------------------+
| resnet200 | β
|
+----------------------------------+------------------+
| resnet200d | β
|
+----------------------------------+------------------+
| resnetaa34d | β
|
+----------------------------------+------------------+
| resnetaa50 | β
|
+----------------------------------+------------------+
| resnetaa50d | β
|
+----------------------------------+------------------+
| resnetaa101d | β
|
+----------------------------------+------------------+
| resnetblur18 | β
|
+----------------------------------+------------------+
| resnetblur50 | β
|
+----------------------------------+------------------+
| resnetblur50d | β
|
+----------------------------------+------------------+
| resnetblur101d | β
|
+----------------------------------+------------------+
| resnetrs50 | β
|
+----------------------------------+------------------+
| resnetrs101 | β
|
+----------------------------------+------------------+
| resnetrs152 | β
|
+----------------------------------+------------------+
| resnetrs200 | β
|
+----------------------------------+------------------+
| resnetrs270 | β
|
+----------------------------------+------------------+
| resnetrs350 | β
|
+----------------------------------+------------------+
| resnetrs420 | β
|
+----------------------------------+------------------+
| resnetv2_18 | β
|
+----------------------------------+------------------+
| resnetv2_18d | β
|
+----------------------------------+------------------+
| resnetv2_34 | β
|
+----------------------------------+------------------+
| resnetv2_34d | β
|
+----------------------------------+------------------+
| resnetv2_50 | β
|
+----------------------------------+------------------+
| resnetv2_50d | β
|
+----------------------------------+------------------+
| resnetv2_50d_evos | β
|
+----------------------------------+------------------+
| resnetv2_50d_frn | β
|
+----------------------------------+------------------+
| resnetv2_50d_gn | β
|
+----------------------------------+------------------+
| resnetv2_50t | β
|
+----------------------------------+------------------+
| resnetv2_50x1_bit | β
|
+----------------------------------+------------------+
| resnetv2_50x3_bit | β
|
+----------------------------------+------------------+
| resnetv2_101 | β
|
+----------------------------------+------------------+
| resnetv2_101d | β
|
+----------------------------------+------------------+
| resnetv2_101x1_bit | β
|
+----------------------------------+------------------+
| resnetv2_101x3_bit | β
|
+----------------------------------+------------------+
| resnetv2_152 | β
|
+----------------------------------+------------------+
| resnetv2_152d | β
|
+----------------------------------+------------------+
| resnetv2_152x2_bit | β
|
+----------------------------------+------------------+
| resnetv2_152x4_bit | β
|
+----------------------------------+------------------+
| resnext26ts | β
|
+----------------------------------+------------------+
| resnext50_32x4d | β
|
+----------------------------------+------------------+
| resnext50d_32x4d | β
|
+----------------------------------+------------------+
| resnext101_32x4d | β
|
+----------------------------------+------------------+
| resnext101_32x8d | β
|
+----------------------------------+------------------+
| resnext101_32x16d | β
|
+----------------------------------+------------------+
| resnext101_32x32d | β
|
+----------------------------------+------------------+
| resnext101_64x4d | β
|
+----------------------------------+------------------+
| rexnet_100 | β
|
+----------------------------------+------------------+
| rexnet_130 | β
|
+----------------------------------+------------------+
| rexnet_150 | β
|
+----------------------------------+------------------+
| rexnet_200 | β
|
+----------------------------------+------------------+
| rexnet_300 | β
|
+----------------------------------+------------------+
| rexnetr_100 | β
|
+----------------------------------+------------------+
| rexnetr_130 | β
|
+----------------------------------+------------------+
| rexnetr_150 | β
|
+----------------------------------+------------------+
| rexnetr_200 | β
|
+----------------------------------+------------------+
| rexnetr_300 | β
|
+----------------------------------+------------------+
| sebotnet33ts_256 | β
|
+----------------------------------+------------------+
| sedarknet21 | β
|
+----------------------------------+------------------+
| sehalonet33ts | β
|
+----------------------------------+------------------+
| selecsls42 | |
+----------------------------------+------------------+
| selecsls42b | |
+----------------------------------+------------------+
| selecsls60 | |
+----------------------------------+------------------+
| selecsls60b | |
+----------------------------------+------------------+
| selecsls84 | |
+----------------------------------+------------------+
| semnasnet_050 | β
|
+----------------------------------+------------------+
| semnasnet_075 | β
|
+----------------------------------+------------------+
| semnasnet_100 | β
|
+----------------------------------+------------------+
| semnasnet_140 | β
|
+----------------------------------+------------------+
| senet154 | β
|
+----------------------------------+------------------+
| seresnet18 | β
|
+----------------------------------+------------------+
| seresnet33ts | β
|
+----------------------------------+------------------+
| seresnet34 | β
|
+----------------------------------+------------------+
| seresnet50 | β
|
+----------------------------------+------------------+
| seresnet50t | β
|
+----------------------------------+------------------+
| seresnet101 | β
|
+----------------------------------+------------------+
| seresnet152 | β
|
+----------------------------------+------------------+
| seresnet152d | β
|
+----------------------------------+------------------+
| seresnet200d | β
|
+----------------------------------+------------------+
| seresnet269d | β
|
+----------------------------------+------------------+
| seresnetaa50d | β
|
+----------------------------------+------------------+
| seresnext26d_32x4d | β
|
+----------------------------------+------------------+
| seresnext26t_32x4d | β
|
+----------------------------------+------------------+
| seresnext26ts | β
|
+----------------------------------+------------------+
| seresnext50_32x4d | β
|
+----------------------------------+------------------+
| seresnext101_32x4d | β
|
+----------------------------------+------------------+
| seresnext101_32x8d | β
|
+----------------------------------+------------------+
| seresnext101_64x4d | β
|
+----------------------------------+------------------+
| seresnext101d_32x8d | β
|
+----------------------------------+------------------+
| seresnextaa101d_32x8d | β
|
+----------------------------------+------------------+
| seresnextaa201d_32x8d | β
|
+----------------------------------+------------------+
| skresnet18 | β
|
+----------------------------------+------------------+
| skresnet34 | β
|
+----------------------------------+------------------+
| skresnet50 | β
|
+----------------------------------+------------------+
| skresnet50d | β
|
+----------------------------------+------------------+
| skresnext50_32x4d | β
|
+----------------------------------+------------------+
| spnasnet_100 | β
|
+----------------------------------+------------------+
| tf_efficientnet_b0 | β
|
+----------------------------------+------------------+
| tf_efficientnet_b1 | β
|
+----------------------------------+------------------+
| tf_efficientnet_b2 | β
|
+----------------------------------+------------------+
| tf_efficientnet_b3 | β
|
+----------------------------------+------------------+
| tf_efficientnet_b4 | β
|
+----------------------------------+------------------+
| tf_efficientnet_b5 | β
|
+----------------------------------+------------------+
| tf_efficientnet_b6 | β
|
+----------------------------------+------------------+
| tf_efficientnet_b7 | β
|
+----------------------------------+------------------+
| tf_efficientnet_b8 | β
|
+----------------------------------+------------------+
| tf_efficientnet_cc_b0_4e | β
|
+----------------------------------+------------------+
| tf_efficientnet_cc_b0_8e | β
|
+----------------------------------+------------------+
| tf_efficientnet_cc_b1_8e | β
|
+----------------------------------+------------------+
| tf_efficientnet_el | β
|
+----------------------------------+------------------+
| tf_efficientnet_em | β
|
+----------------------------------+------------------+
| tf_efficientnet_es | β
|
+----------------------------------+------------------+
| tf_efficientnet_l2 | β
|
+----------------------------------+------------------+
| tf_efficientnet_lite0 | β
|
+----------------------------------+------------------+
| tf_efficientnet_lite1 | β
|
+----------------------------------+------------------+
| tf_efficientnet_lite2 | β
|
+----------------------------------+------------------+
| tf_efficientnet_lite3 | β
|
+----------------------------------+------------------+
| tf_efficientnet_lite4 | β
|
+----------------------------------+------------------+
| tf_efficientnetv2_b0 | β
|
+----------------------------------+------------------+
| tf_efficientnetv2_b1 | β
|
+----------------------------------+------------------+
| tf_efficientnetv2_b2 | β
|
+----------------------------------+------------------+
| tf_efficientnetv2_b3 | β
|
+----------------------------------+------------------+
| tf_efficientnetv2_l | β
|
+----------------------------------+------------------+
| tf_efficientnetv2_m | β
|
+----------------------------------+------------------+
| tf_efficientnetv2_s | β
|
+----------------------------------+------------------+
| tf_efficientnetv2_xl | β
|
+----------------------------------+------------------+
| tf_mixnet_l | β
|
+----------------------------------+------------------+
| tf_mixnet_m | β
|
+----------------------------------+------------------+
| tf_mixnet_s | β
|
+----------------------------------+------------------+
| tf_mobilenetv3_large_075 | β
|
+----------------------------------+------------------+
| tf_mobilenetv3_large_100 | β
|
+----------------------------------+------------------+
| tf_mobilenetv3_large_minimal_100 | β
|
+----------------------------------+------------------+
| tf_mobilenetv3_small_075 | β
|
+----------------------------------+------------------+
| tf_mobilenetv3_small_100 | β
|
+----------------------------------+------------------+
| tf_mobilenetv3_small_minimal_100 | β
|
+----------------------------------+------------------+
| tinynet_a | β
|
+----------------------------------+------------------+
| tinynet_b | β
|
+----------------------------------+------------------+
| tinynet_c | β
|
+----------------------------------+------------------+
| tinynet_d | β
|
+----------------------------------+------------------+
| tinynet_e | β
|
+----------------------------------+------------------+
| vgg11 | |
+----------------------------------+------------------+
| vgg11_bn | |
+----------------------------------+------------------+
| vgg13 | |
+----------------------------------+------------------+
| vgg13_bn | |
+----------------------------------+------------------+
| vgg16 | |
+----------------------------------+------------------+
| vgg16_bn | |
+----------------------------------+------------------+
| vgg19 | |
+----------------------------------+------------------+
| vgg19_bn | |
+----------------------------------+------------------+
| vovnet39a | |
+----------------------------------+------------------+
| vovnet57a | |
+----------------------------------+------------------+
| wide_resnet50_2 | β
|
+----------------------------------+------------------+
| wide_resnet101_2 | β
|
+----------------------------------+------------------+
| xception41 | β
|
+----------------------------------+------------------+
| xception41p | β
|
+----------------------------------+------------------+
| xception65 | β
|
+----------------------------------+------------------+
| xception65p | β
|
+----------------------------------+------------------+
| xception71 | β
|
+----------------------------------+------------------+
Transformer-Style
~~~~~~~~~~~~~~~~~
Transformer-style models (e.g., Swin Transformer, ConvNeXt) typically produce feature maps starting at a 1/4 scale, followed by 1/8, 1/16, and 1/32 scales
+------------------------------------+------------------+
| Encoder name | Support dilation |
+====================================+==================+
| caformer_b36 | |
+------------------------------------+------------------+
| caformer_m36 | |
+------------------------------------+------------------+
| caformer_s18 | |
+------------------------------------+------------------+
| caformer_s36 | |
+------------------------------------+------------------+
| convformer_b36 | |
+------------------------------------+------------------+
| convformer_m36 | |
+------------------------------------+------------------+
| convformer_s18 | |
+------------------------------------+------------------+
| convformer_s36 | |
+------------------------------------+------------------+
| convnext_atto | β
|
+------------------------------------+------------------+
| convnext_atto_ols | β
|
+------------------------------------+------------------+
| convnext_atto_rms | β
|
+------------------------------------+------------------+
| convnext_base | β
|
+------------------------------------+------------------+
| convnext_femto | β
|
+------------------------------------+------------------+
| convnext_femto_ols | β
|
+------------------------------------+------------------+
| convnext_large | β
|
+------------------------------------+------------------+
| convnext_large_mlp | β
|
+------------------------------------+------------------+
| convnext_nano | β
|
+------------------------------------+------------------+
| convnext_nano_ols | β
|
+------------------------------------+------------------+
| convnext_pico | β
|
+------------------------------------+------------------+
| convnext_pico_ols | β
|
+------------------------------------+------------------+
| convnext_small | β
|
+------------------------------------+------------------+
| convnext_tiny | β
|
+------------------------------------+------------------+
| convnext_tiny_hnf | β
|
+------------------------------------+------------------+
| convnext_xlarge | β
|
+------------------------------------+------------------+
| convnext_xxlarge | β
|
+------------------------------------+------------------+
| convnext_zepto_rms | β
|
+------------------------------------+------------------+
| convnext_zepto_rms_ols | β
|
+------------------------------------+------------------+
| convnextv2_atto | β
|
+------------------------------------+------------------+
| convnextv2_base | β
|
+------------------------------------+------------------+
| convnextv2_femto | β
|
+------------------------------------+------------------+
| convnextv2_huge | β
|
+------------------------------------+------------------+
| convnextv2_large | β
|
+------------------------------------+------------------+
| convnextv2_nano | β
|
+------------------------------------+------------------+
| convnextv2_pico | β
|
+------------------------------------+------------------+
| convnextv2_small | β
|
+------------------------------------+------------------+
| convnextv2_tiny | β
|
+------------------------------------+------------------+
| davit_base | |
+------------------------------------+------------------+
| davit_base_fl | |
+------------------------------------+------------------+
| davit_giant | |
+------------------------------------+------------------+
| davit_huge | |
+------------------------------------+------------------+
| davit_huge_fl | |
+------------------------------------+------------------+
| davit_large | |
+------------------------------------+------------------+
| davit_small | |
+------------------------------------+------------------+
| davit_tiny | |
+------------------------------------+------------------+
| edgenext_base | |
+------------------------------------+------------------+
| edgenext_small | |
+------------------------------------+------------------+
| edgenext_small_rw | |
+------------------------------------+------------------+
| edgenext_x_small | |
+------------------------------------+------------------+
| edgenext_xx_small | |
+------------------------------------+------------------+
| efficientformer_l1 | |
+------------------------------------+------------------+
| efficientformer_l3 | |
+------------------------------------+------------------+
| efficientformer_l7 | |
+------------------------------------+------------------+
| efficientformerv2_l | |
+------------------------------------+------------------+
| efficientformerv2_s0 | |
+------------------------------------+------------------+
| efficientformerv2_s1 | |
+------------------------------------+------------------+
| efficientformerv2_s2 | |
+------------------------------------+------------------+
| efficientvit_b0 | |
+------------------------------------+------------------+
| efficientvit_b1 | |
+------------------------------------+------------------+
| efficientvit_b2 | |
+------------------------------------+------------------+
| efficientvit_b3 | |
+------------------------------------+------------------+
| efficientvit_l1 | |
+------------------------------------+------------------+
| efficientvit_l2 | |
+------------------------------------+------------------+
| efficientvit_l3 | |
+------------------------------------+------------------+
| fastvit_ma36 | |
+------------------------------------+------------------+
| fastvit_mci0 | |
+------------------------------------+------------------+
| fastvit_mci1 | |
+------------------------------------+------------------+
| fastvit_mci2 | |
+------------------------------------+------------------+
| fastvit_s12 | |
+------------------------------------+------------------+
| fastvit_sa12 | |
+------------------------------------+------------------+
| fastvit_sa24 | |
+------------------------------------+------------------+
| fastvit_sa36 | |
+------------------------------------+------------------+
| fastvit_t8 | |
+------------------------------------+------------------+
| fastvit_t12 | |
+------------------------------------+------------------+
| focalnet_base_lrf | |
+------------------------------------+------------------+
| focalnet_base_srf | |
+------------------------------------+------------------+
| focalnet_huge_fl3 | |
+------------------------------------+------------------+
| focalnet_huge_fl4 | |
+------------------------------------+------------------+
| focalnet_large_fl3 | |
+------------------------------------+------------------+
| focalnet_large_fl4 | |
+------------------------------------+------------------+
| focalnet_small_lrf | |
+------------------------------------+------------------+
| focalnet_small_srf | |
+------------------------------------+------------------+
| focalnet_tiny_lrf | |
+------------------------------------+------------------+
| focalnet_tiny_srf | |
+------------------------------------+------------------+
| focalnet_xlarge_fl3 | |
+------------------------------------+------------------+
| focalnet_xlarge_fl4 | |
+------------------------------------+------------------+
| hgnet_base | |
+------------------------------------+------------------+
| hgnet_small | |
+------------------------------------+------------------+
| hgnet_tiny | |
+------------------------------------+------------------+
| hgnetv2_b0 | |
+------------------------------------+------------------+
| hgnetv2_b1 | |
+------------------------------------+------------------+
| hgnetv2_b2 | |
+------------------------------------+------------------+
| hgnetv2_b3 | |
+------------------------------------+------------------+
| hgnetv2_b4 | |
+------------------------------------+------------------+
| hgnetv2_b5 | |
+------------------------------------+------------------+
| hgnetv2_b6 | |
+------------------------------------+------------------+
| hiera_base_224 | |
+------------------------------------+------------------+
| hiera_base_abswin_256 | |
+------------------------------------+------------------+
| hiera_base_plus_224 | |
+------------------------------------+------------------+
| hiera_huge_224 | |
+------------------------------------+------------------+
| hiera_large_224 | |
+------------------------------------+------------------+
| hiera_small_224 | |
+------------------------------------+------------------+
| hiera_small_abswin_256 | |
+------------------------------------+------------------+
| hiera_tiny_224 | |
+------------------------------------+------------------+
| hieradet_small | |
+------------------------------------+------------------+
| inception_next_base | |
+------------------------------------+------------------+
| inception_next_small | |
+------------------------------------+------------------+
| inception_next_tiny | |
+------------------------------------+------------------+
| mambaout_base | |
+------------------------------------+------------------+
| mambaout_base_plus_rw | |
+------------------------------------+------------------+
| mambaout_base_short_rw | |
+------------------------------------+------------------+
| mambaout_base_tall_rw | |
+------------------------------------+------------------+
| mambaout_base_wide_rw | |
+------------------------------------+------------------+
| mambaout_femto | |
+------------------------------------+------------------+
| mambaout_kobe | |
+------------------------------------+------------------+
| mambaout_small | |
+------------------------------------+------------------+
| mambaout_small_rw | |
+------------------------------------+------------------+
| mambaout_tiny | |
+------------------------------------+------------------+
| mvitv2_base | |
+------------------------------------+------------------+
| mvitv2_base_cls | |
+------------------------------------+------------------+
| mvitv2_huge_cls | |
+------------------------------------+------------------+
| mvitv2_large | |
+------------------------------------+------------------+
| mvitv2_large_cls | |
+------------------------------------+------------------+
| mvitv2_small | |
+------------------------------------+------------------+
| mvitv2_small_cls | |
+------------------------------------+------------------+
| mvitv2_tiny | |
+------------------------------------+------------------+
| nest_base | |
+------------------------------------+------------------+
| nest_base_jx | |
+------------------------------------+------------------+
| nest_small | |
+------------------------------------+------------------+
| nest_small_jx | |
+------------------------------------+------------------+
| nest_tiny | |
+------------------------------------+------------------+
| nest_tiny_jx | |
+------------------------------------+------------------+
| nextvit_base | |
+------------------------------------+------------------+
| nextvit_large | |
+------------------------------------+------------------+
| nextvit_small | |
+------------------------------------+------------------+
| poolformer_m36 | |
+------------------------------------+------------------+
| poolformer_m48 | |
+------------------------------------+------------------+
| poolformer_s12 | |
+------------------------------------+------------------+
| poolformer_s24 | |
+------------------------------------+------------------+
| poolformer_s36 | |
+------------------------------------+------------------+
| poolformerv2_m36 | |
+------------------------------------+------------------+
| poolformerv2_m48 | |
+------------------------------------+------------------+
| poolformerv2_s12 | |
+------------------------------------+------------------+
| poolformerv2_s24 | |
+------------------------------------+------------------+
| poolformerv2_s36 | |
+------------------------------------+------------------+
| pvt_v2_b0 | |
+------------------------------------+------------------+
| pvt_v2_b1 | |
+------------------------------------+------------------+
| pvt_v2_b2 | |
+------------------------------------+------------------+
| pvt_v2_b2_li | |
+------------------------------------+------------------+
| pvt_v2_b3 | |
+------------------------------------+------------------+
| pvt_v2_b4 | |
+------------------------------------+------------------+
| pvt_v2_b5 | |
+------------------------------------+------------------+
| rdnet_base | |
+------------------------------------+------------------+
| rdnet_large | |
+------------------------------------+------------------+
| rdnet_small | |
+------------------------------------+------------------+
| rdnet_tiny | |
+------------------------------------+------------------+
| repvit_m0_9 | |
+------------------------------------+------------------+
| repvit_m1 | |
+------------------------------------+------------------+
| repvit_m1_0 | |
+------------------------------------+------------------+
| repvit_m1_1 | |
+------------------------------------+------------------+
| repvit_m1_5 | |
+------------------------------------+------------------+
| repvit_m2 | |
+------------------------------------+------------------+
| repvit_m2_3 | |
+------------------------------------+------------------+
| repvit_m3 | |
+------------------------------------+------------------+
| sam2_hiera_base_plus | |
+------------------------------------+------------------+
| sam2_hiera_large | |
+------------------------------------+------------------+
| sam2_hiera_small | |
+------------------------------------+------------------+
| sam2_hiera_tiny | |
+------------------------------------+------------------+
| swin_base_patch4_window7_224 | |
+------------------------------------+------------------+
| swin_base_patch4_window12_384 | |
+------------------------------------+------------------+
| swin_large_patch4_window7_224 | |
+------------------------------------+------------------+
| swin_large_patch4_window12_384 | |
+------------------------------------+------------------+
| swin_s3_base_224 | |
+------------------------------------+------------------+
| swin_s3_small_224 | |
+------------------------------------+------------------+
| swin_s3_tiny_224 | |
+------------------------------------+------------------+
| swin_small_patch4_window7_224 | |
+------------------------------------+------------------+
| swin_tiny_patch4_window7_224 | |
+------------------------------------+------------------+
| swinv2_base_window8_256 | |
+------------------------------------+------------------+
| swinv2_base_window12_192 | |
+------------------------------------+------------------+
| swinv2_base_window12to16_192to256 | |
+------------------------------------+------------------+
| swinv2_base_window12to24_192to384 | |
+------------------------------------+------------------+
| swinv2_base_window16_256 | |
+------------------------------------+------------------+
| swinv2_cr_base_224 | |
+------------------------------------+------------------+
| swinv2_cr_base_384 | |
+------------------------------------+------------------+
| swinv2_cr_base_ns_224 | |
+------------------------------------+------------------+
| swinv2_cr_giant_224 | |
+------------------------------------+------------------+
| swinv2_cr_giant_384 | |
+------------------------------------+------------------+
| swinv2_cr_huge_224 | |
+------------------------------------+------------------+
| swinv2_cr_huge_384 | |
+------------------------------------+------------------+
| swinv2_cr_large_224 | |
+------------------------------------+------------------+
| swinv2_cr_large_384 | |
+------------------------------------+------------------+
| swinv2_cr_small_224 | |
+------------------------------------+------------------+
| swinv2_cr_small_384 | |
+------------------------------------+------------------+
| swinv2_cr_small_ns_224 | |
+------------------------------------+------------------+
| swinv2_cr_small_ns_256 | |
+------------------------------------+------------------+
| swinv2_cr_tiny_224 | |
+------------------------------------+------------------+
| swinv2_cr_tiny_384 | |
+------------------------------------+------------------+
| swinv2_cr_tiny_ns_224 | |
+------------------------------------+------------------+
| swinv2_large_window12_192 | |
+------------------------------------+------------------+
| swinv2_large_window12to16_192to256 | |
+------------------------------------+------------------+
| swinv2_large_window12to24_192to384 | |
+------------------------------------+------------------+
| swinv2_small_window8_256 | |
+------------------------------------+------------------+
| swinv2_small_window16_256 | |
+------------------------------------+------------------+
| swinv2_tiny_window8_256 | |
+------------------------------------+------------------+
| swinv2_tiny_window16_256 | |
+------------------------------------+------------------+
| tiny_vit_5m_224 | |
+------------------------------------+------------------+
| tiny_vit_11m_224 | |
+------------------------------------+------------------+
| tiny_vit_21m_224 | |
+------------------------------------+------------------+
| tiny_vit_21m_384 | |
+------------------------------------+------------------+
| tiny_vit_21m_512 | |
+------------------------------------+------------------+
| tresnet_l | |
+------------------------------------+------------------+
| tresnet_m | |
+------------------------------------+------------------+
| tresnet_v2_l | |
+------------------------------------+------------------+
| tresnet_xl | |
+------------------------------------+------------------+
| twins_pcpvt_base | |
+------------------------------------+------------------+
| twins_pcpvt_large | |
+------------------------------------+------------------+
| twins_pcpvt_small | |
+------------------------------------+------------------+
| twins_svt_base | |
+------------------------------------+------------------+
| twins_svt_large | |
+------------------------------------+------------------+
| twins_svt_small | |
+------------------------------------+------------------+
---
Index
.. Segmentation Models documentation master file, created by
sphinx-quickstart on Fri Nov 27 00:00:20 2020.
You can adapt this file completely to your liking, but it should at least
contain the root toctree directive.
Welcome to Segmentation Models's documentation!
===============================================
.. toctree::
:maxdepth: 2
:caption: Contents:
install
quickstart
models
encoders
encoders_timm
losses
metrics
save_load
insights
Indices and tables
==================
* :ref:genindexmodindex
* :ref:search
* :ref:
---
Insights
π‘ Insights
===========
1. Models architecture
~~~~~~~~~~~~~~~~~~~~~~
All segmentation models in SMP (this library short name) are made of:
- encoder (feature extractor, a.k.a backbone)
- decoder (features fusion block to create segmentation mask)
- segmentation head (final head to reduce number of channels from decoder and upsample mask to preserve input-output spatial resolution identity)
- classification head (optional head which build on top of deepest encoder features)
2. Creating your own encoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Encoder is a "classification model" which extract features from image and pass it to decoder.
Each encoder should have following attributes and methods and be inherited from segmentation_models_pytorch.encoders._base.EncoderMixin
.. code-block:: python
class MyEncoder(torch.nn.Module, EncoderMixin):
def __init__(self, kwargs):
super().__init__()
# A number of channels for each encoder feature tensor, list of integers
self._out_channels: List[int] = [3, 16, 64, 128, 256, 512]
# A number of stages in decoder (in other words number of downsampling operations), integer
# use in in forward pass to reduce number of returning features
self._depth: int = 5
# Default number of input channels in first Conv2d layer for encoder (usually 3)
self._in_channels: int = 3
# Define encoder modules below
...
def forward(self, x: torch.Tensor) -> List[torch.Tensor]:
"""Produce list of features of different spatial resolutions, each feature is a 4D torch.tensor of
shape NCHW (features should be sorted in descending order according to spatial resolution, starting
with resolution same as input x tensor).
Input: x with shape (1, 3, 64, 64)
Output: [f0, f1, f2, f3, f4, f5] - features with corresponding shapes
[(1, 3, 64, 64), (1, 64, 32, 32), (1, 128, 16, 16), (1, 256, 8, 8),
(1, 512, 4, 4), (1, 1024, 2, 2)] (C - dim may differ)
also should support number of features according to specified depth, e.g. if depth = 5,
number of feature tensors = 6 (one with same resolution as input and 5 downsampled),
depth = 3 -> number of feature tensors = 4 (one with same resolution as input and 3 downsampled).
"""
return [feat1, feat2, feat3, feat4, feat5, feat6]
When you write your own Encoder class register its build parameters
.. code-block:: python
smp.encoders.encoders["my_awesome_encoder"] = {
"encoder": MyEncoder, # encoder class here
"pretrained_settings": {
"imagenet": {
"mean": [0.485, 0.456, 0.406],
"std": [0.229, 0.224, 0.225],
"url": "https://some-url.com/my-model-weights",
"input_space": "RGB",
"input_range": [0, 1],
},
},
"params": {
# init params for encoder if any
},
},
Now you can use your encoder
.. code-block:: python
model = smp.Unet(encoder_name="my_awesome_encoder")
For better understanding see more examples of encoder in smp.encoders module.
.. note::
If it works fine, dont forget to contribute your work and make a PR to SMP π
3. Aux classification output
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All models support `aux_params parameter, which is default set to None.
If aux_params = None than classification auxiliary output is not created, else
model produce not only mask, but also label output with shape (N, C).
Classification head consist of following layers:
1. GlobalPooling
2. Dropout (optional)
3. Linear
4. Activation (optional)
Example:
.. code-block:: python
aux_params=dict(
pooling='avg', # one of 'avg', 'max'
dropout=0.5, # dropout ratio, default is None
activation='sigmoid', # activation function, default is None
classes=4, # define number of output labels
)
model = smp.Unet('resnet34', classes=4, aux_params=aux_params)
mask, label = model(x)
mask.shape, label.shape
# (N, 4, H, W), (N, 4)
4. Freezing and unfreezing the encoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sometimes you may want to freeze the encoder during training, e.g. when using pretrained backbones and only fine-tuning the decoder and segmentation head.
All segmentation models in SMP provide two helper methods:
.. code-block:: python
model = smp.Unet("resnet34", classes=2)
# Freeze encoder: stops gradient updates and freezes normalization layer stats
model.freeze_encoder()
# Unfreeze encoder: re-enables training for encoder parameters and normalization layers
model.unfreeze_encoder()
.. important::
- Freezing sets requires_grad = False for all encoder parameters.
- Normalization layers that track running statistics (e.g., BatchNorm and InstanceNorm layers) are set to .eval() mode to prevent updates to running_mean and running_var.
- If you later call model.train(), frozen encoders will remain frozen until you call unfreeze_encoder().
---
Install
βοΈ Installation
===============
PyPI version:
.. code-block:: bash
$ pip install -U segmentation-models-pytorch
Latest version from source:
.. code-block:: bash
$ pip install -U git+https://github.com/qubvel/segmentation_models.pytorch
---
Losses
π Losses
=========
Collection of popular semantic segmentation losses. Adapted from
an awesome repo with pytorch utils https://github.com/BloodAxe/pytorch-toolbelt
Constants
~~~~~~~~~
.. automodule:: segmentation_models_pytorch.losses.constants
:members:
JaccardLoss
~~~~~~~~~~~
.. autoclass:: segmentation_models_pytorch.losses.JaccardLoss
DiceLoss
~~~~~~~~
.. autoclass:: segmentation_models_pytorch.losses.DiceLoss
TverskyLoss
~~~~~~~~~~~
.. autoclass:: segmentation_models_pytorch.losses.TverskyLoss
FocalLoss
~~~~~~~~~
.. autoclass:: segmentation_models_pytorch.losses.FocalLoss
LovaszLoss
~~~~~~~~~~
.. autoclass:: segmentation_models_pytorch.losses.LovaszLoss
SoftBCEWithLogitsLoss
~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: segmentation_models_pytorch.losses.SoftBCEWithLogitsLoss
SoftCrossEntropyLoss
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: segmentation_models_pytorch.losses.SoftCrossEntropyLoss
MCCLoss
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: segmentation_models_pytorch.losses.MCCLoss
:members: forward
---
Metrics
π Metrics
==========
Functional metrics
~~~~~~~~~~~~~~~~~~
.. currentmodule:: segmentation_models_pytorch.metrics.functional
.. autosummary::
get_stats
fbeta_score
f1_score
iou_score
accuracy
precision
recall
sensitivity
specificity
balanced_accuracy
positive_predictive_value
negative_predictive_value
false_negative_rate
false_positive_rate
false_discovery_rate
false_omission_rate
positive_likelihood_ratio
negative_likelihood_ratio
.. automodule:: segmentation_models_pytorch.metrics.functional
:members:
---
Models
πΈοΈ Segmentation Models
==============================
.. contents::
:local:
.. _unet:
Unet
~~~~
.. autoclass:: segmentation_models_pytorch.Unet
.. _unetplusplus:
Unet++
~~~~~~
.. autoclass:: segmentation_models_pytorch.UnetPlusPlus
.. _fpn:
FPN
~~~
.. autoclass:: segmentation_models_pytorch.FPN
.. _pspnet:
PSPNet
~~~~~~
.. autoclass:: segmentation_models_pytorch.PSPNet
.. _deeplabv3:
DeepLabV3
~~~~~~~~~
.. autoclass:: segmentation_models_pytorch.DeepLabV3
.. _deeplabv3plus:
DeepLabV3+
~~~~~~~~~~
.. autoclass:: segmentation_models_pytorch.DeepLabV3Plus
.. _linknet:
Linknet
~~~~~~~
.. autoclass:: segmentation_models_pytorch.Linknet
.. _manet:
MAnet
~~~~~~
.. autoclass:: segmentation_models_pytorch.MAnet
.. _pan:
PAN
~~~
.. autoclass:: segmentation_models_pytorch.PAN
.. _upernet:
UPerNet
~~~~~~~
.. autoclass:: segmentation_models_pytorch.UPerNet
.. _segformer:
Segformer
~~~~~~~~~
.. autoclass:: segmentation_models_pytorch.Segformer
.. _dpt:
DPT
~~~
.. note::
See full list of DPT-compatible timm encoders in :ref:dpt-encoders.
.. note::
For some encoders, the model requires dynamic_img_size=True to be passed in order to work with resolutions different from what the encoder was trained for.
.. autoclass:: segmentation_models_pytorch.DPT
---
Quickstart
π Quick Start
==============
1. Create segmentation model
Segmentation model is just a PyTorch nn.Module, which can be created as easy as:
.. code-block:: python
import segmentation_models_pytorch as smp
model = smp.Unet(
encoder_name="resnet34", # choose encoder, e.g. mobilenet_v2 or efficientnet-b7
encoder_weights="imagenet", # use imagenet pre-trained weights for encoder initialization
in_channels=1, # model input channels (1 for gray-scale images, 3 for RGB, etc.)
classes=3, # model output channels (number of classes in your dataset)
)
- Check the page with available :doc:model architectures <models>.available ported encoders and its corresponding weights <encoders>
- Check the table with :doc:.Pytorch Image Models (timm) <https://github.com/huggingface/pytorch-image-models>
- _ encoders are also supported, check it :doc:here<encoders_timm>.
Alternatively, you can use smp.create_model function to create a model by name:
.. code-block:: python
model = smp.create_model(
arch="fpn", # name of the architecture, e.g. 'Unet'/ 'FPN' / etc. Case INsensitive!
encoder_name="mit_b0",
encoder_weights="imagenet",
in_channels=1,
classes=3,
)
2. Configure data preprocessing
All encoders have pretrained weights. Preparing your data the same way as during weights pre-training may give your better results (higher metric score and faster convergence). But it is relevant only for 1-2-3-channels images and not necessary in case you train the whole model, not only decoder.
.. code-block:: python
from segmentation_models_pytorch.encoders import get_preprocessing_fn
preprocess_input = get_preprocessing_fn('resnet18', pretrained='imagenet')
3. Congratulations! π
You are done! Now you can train your model with your favorite framework, or as simple as:
.. code-block:: python
for images, gt_masks in dataloader:
predicted_mask = model(images)
loss = loss_fn(predicted_mask, gt_masks)
loss.backward()
optimizer.step()
Check the following examples:
.. |colab-badge| image:: https://colab.research.google.com/assets/colab-badge.svg
:target: https://colab.research.google.com/github/qubvel/segmentation_models.pytorch/blob/main/examples/binary_segmentation_intro.ipynb
:alt: Open In Colab
- Finetuning notebook on Oxford Pet dataset with PyTorch Lightning <https://github.com/qubvel/segmentation_models.pytorch/blob/main/examples/binary_segmentation_intro.ipynb>__ |colab-badge|PyTorch Lightning <https://github.com/ternaus/cloths_segmentation>
- Finetuning script for cloth segmentation with __
---
Save Load
π Saving and Loading
=====================
In this section, we will discuss how to save a trained model, push it to the Hugging Face Hub, and load it back for later use.
Saving and Sharing a Model
--------------------------
Once you have trained your model, you can save it using the .save_pretrained method. This method saves the model configuration and weights to a directory of your choice.push_to_hub
And, optionally, you can push the model to the Hugging Face Hub by setting the parameter to True.
For example:
.. code:: python
import segmentation_models_pytorch as smp
model = smp.Unet('resnet34', encoder_weights='imagenet')
# After training your model, save it to a directory
model.save_pretrained('./my_model')
# Or saved and pushed to the Hub simultaneously
model.save_pretrained('username/my-model', push_to_hub=True)
Loading Trained Model
---------------------
Once your model is saved and pushed to the Hub, you can load it back using the smp.from_pretrained method. This method allows you to load the model weights and configuration from a directory or directly from the Hub.
For example:
.. code:: python
import segmentation_models_pytorch as smp
# Load the model from the local directory
model = smp.from_pretrained('./my_model')
# Alternatively, load the model directly from the Hugging Face Hub
model = smp.from_pretrained('username/my-model')
Loading pre-trained model with different number of classes for fine-tuning:
.. code:: python
import segmentation_models_pytorch as smp
model = smp.from_pretrained('<path-or-repo-name>', classes=5, strict=False)
Saving model Metrics and Dataset Name
-------------------------------------
You can simply pass the metrics and dataset parameters to the save_pretrained method to save the model metrics and dataset name in Model Card along with the model configuration and weights.
For example:
.. code:: python
import segmentation_models_pytorch as smp
model = smp.Unet('resnet34', encoder_weights='imagenet')
# After training your model, save it to a directory
model.save_pretrained('./my_model', metrics={'accuracy': 0.95}, dataset='my_dataset')
# Or saved and pushed to the Hub simultaneously
model.save_pretrained('username/my-model', push_to_hub=True, metrics={'accuracy': 0.95}, dataset='my_dataset')
Saving with preprocessing transform (Albumentations)
----------------------------------------------------
You can save the preprocessing transform along with the model and push it to the Hub.
This can be useful when you want to share the model with the preprocessing transform that was used during training,
to make sure that the inference pipeline is consistent with the training pipeline.
.. code:: python
import albumentations as A
import segmentation_models_pytorch as smp
# Define a preprocessing transform for image that would be used during inference
preprocessing_transform = A.Compose([
A.Resize(256, 256),
A.Normalize()
])
model = smp.Unet()
directory_or_repo_on_the_hub = "qubvel-hf/unet-with-transform" # <username>/<repo-name>
# Save the model and transform (and pus ot hub, if needed)
model.save_pretrained(directory_or_repo_on_the_hub, push_to_hub=True)
preprocessing_transform.save_pretrained(directory_or_repo_on_the_hub, push_to_hub=True)
# Loading transform and model
restored_model = smp.from_pretrained(directory_or_repo_on_the_hub)
restored_transform = A.Compose.from_pretrained(directory_or_repo_on_the_hub)
print(restored_transform)
Conclusion
----------
By following these steps, you can easily save, share, and load your models, facilitating collaboration and reproducibility in your projects. Don't forget to replace the placeholders with your actual model paths and names.
|binary-segmentation-intro|
|save-load-model-and-share-with-hf-hub|
.. |binary-segmentation-intro| image:: https://colab.research.google.com/assets/colab-badge.svg
:target: https://colab.research.google.com/github/qubvel/segmentation_models.pytorch/blob/main/examples/binary_segmentation_intro.ipynb
:alt: Open In Colab
.. |save-load-model-and-share-with-hf-hub| image:: https://colab.research.google.com/assets/colab-badge.svg
:target: https://colab.research.google.com/github/qubvel/segmentation_models.pytorch/blob/main/examples/save_load_model_and_share_with_hf_hub.ipynb
:alt: Open In Colab
---
README
<div align="center">
Python library with Neural Networks for Image Semantic
Segmentation based on PyTorch.
[](https://github.com/qubvel/segmentation_models.pytorch/actions/workflows/tests.yml)
[](https://smp.readthedocs.io/en/latest/)
<br>
[](https://pypi.org/project/segmentation-models-pytorch/)
[](https://pepy.tech/project/segmentation-models-pytorch)
[](https://pepy.tech/project/segmentation-models-pytorch)
<br>
[](https://github.com/qubvel/segmentation_models.pytorch/blob/main/LICENSE)
[](https://pepy.tech/project/segmentation-models-pytorch)
</div>
The main features of the library are:
- Super simple high-level API (just two lines to create a neural network)
- 12 encoder-decoder model architectures (Unet, Unet++, Segformer, DPT, ...)
- 800+ pretrained convolution- and transform-based encoders, including timm support
- Popular metrics and losses for training routines (Dice, Jaccard, Tversky, ...)
- ONNX export and torch script/trace/compile friendly
π€ Sponsor: withoutBG
<a href="https://github.com/withoutbg/withoutbg" target="_blank">
<img src="https://withoutbg.com/images/img-and-matte.png" alt="Sponsored by withoutBG"/>
</a>
withoutBG is a high-quality background removal tool. They built their open-source image matting and refiner models using smp.Unet and are proudly sponsoring this project.
π Project Documentation π
Visit Read The Docs Project Page or read the following README to know more about Segmentation Models Pytorch (SMP for short) library
π Table of content
1. Quick start
2. Examples
3. Models and encoders
4. Models API
1. Input channels
2. Auxiliary classification output
3. Depth
5. Installation
6. Competitions won with the library
7. Contributing
8. Citing
9. License
β³ Quick start <a name="start"></a>
#### 1. Create your first Segmentation model with SMP
The segmentation model is just a PyTorch torch.nn.Module, which can be created as easy as:
import segmentation_models_pytorch as smpimagenetmodel = smp.Unet(
encoder_name="resnet34", # choose encoder, e.g. mobilenet_v2 or efficientnet-b7
encoder_weights="imagenet", # usepre-trained weights for encoder initialization
in_channels=1, # model input channels (1 for gray-scale images, 3 for RGB, etc.)
classes=3, # model output channels (number of classes in your dataset)
)
- see table with available model architectures
- see table with available encoders and their corresponding weights
#### 2. Configure data preprocessing
All encoders have pretrained weights. Preparing your data the same way as during weights pre-training may give you better results (higher metric score and faster convergence). It is not necessary in case you train the whole model, not only the decoder.
from segmentation_models_pytorch.encoders import get_preprocessing_fnpreprocess_input = get_preprocessing_fn('resnet18', pretrained='imagenet')
Congratulations! You are done! Now you can train your model with your favorite framework!
π‘ Examples <a name="examples"></a>
| Name | Link | Colab |
|-------------------------------------------|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| Train pets binary segmentation on OxfordPets | Notebook | [](https://colab.research.google.com/github/qubvel/segmentation_models.pytorch/blob/main/examples/binary_segmentation_intro.ipynb) |
| Train cars binary segmentation on CamVid | Notebook.ipynb) | [](https://colab.research.google.com/github/qubvel/segmentation_models.pytorch/blob/main/examples/cars%20segmentation%20(camvid).ipynb) |
| Train multiclass segmentation on CamVid | Notebook | [](https://colab.research.google.com/github/qubvel-org/segmentation_models.pytorch/blob/main/examples/camvid_segmentation_multiclass.ipynb) |
| Train clothes binary segmentation by @ternaus | Repo | |
| Load and inference pretrained Segformer | Notebook | [](https://colab.research.google.com/github/qubvel/segmentation_models.pytorch/blob/main/examples/segformer_inference_pretrained.ipynb) |
| Load and inference pretrained DPT | Notebook | [](https://colab.research.google.com/github/qubvel/segmentation_models.pytorch/blob/main/examples/dpt_inference_pretrained.ipynb) |
| Load and inference pretrained UPerNet | Notebook | [](https://colab.research.google.com/github/qubvel/segmentation_models.pytorch/blob/main/examples/upernet_inference_pretrained.ipynb) |
| Save and load models locally / to HuggingFace Hub |Notebook | [](https://colab.research.google.com/github/qubvel/segmentation_models.pytorch/blob/main/examples/save_load_model_and_share_with_hf_hub.ipynb)
| Export trained model to ONNX | Notebook | [](https://colab.research.google.com/github/qubvel/segmentation_models.pytorch/blob/main/examples/convert_to_onnx.ipynb) |
π¦ Models and encoders <a name="models-and-encoders"></a>
Architectures <a name="architectures"></a>
| Architecture | Paper | Documentation | Checkpoints |
|--------------|-------|---------------|------------|
| Unet | paper | docs | |
| Unet++ | paper | docs | |
| MAnet | paper | docs | |
| Linknet | paper | docs | |
| FPN | paper | docs | |
| PSPNet | paper | docs | |
| PAN | paper | docs | |
| DeepLabV3 | paper | docs | |
| DeepLabV3+ | paper | docs | |
| UPerNet | paper | docs | checkpoints |
| Segformer | paper | docs | checkpoints |
| DPT | paper | docs | checkpoints |
Encoders <a name="encoders"></a>
The library provides a wide range of pretrained encoders (also known as backbones) for segmentation models. Instead of using features from the final layer of a classification model, we extract intermediate features and feed them into the decoder for segmentation tasks.
All encoders come with pretrained weights, which help achieve faster and more stable convergence when training segmentation models.
Given the extensive selection of supported encoders, you can choose the best one for your specific use case, for example:
- Lightweight encoders for low-latency applications or real-time inference on edge devices (mobilenet/mobileone).
- High-capacity architectures for complex tasks involving a large number of segmented classes, providing superior accuracy (convnext/swin/mit).
By selecting the right encoder, you can balance efficiency, performance, and model complexity to suit your project needs.
All encoders and corresponding pretrained weight are listed in the documentation:
- table with natively ported encoders
- table with timm encoders supported
π Models API <a name="api"></a>
Input channels
The input channels parameter allows you to create a model that can process a tensor with an arbitrary number of channels.
If you use pretrained weights from ImageNet, the weights of the first convolution will be reused:
- For the 1-channel case, it would be a sum of the weights of the first convolution layer.
- Otherwise, channels would be populated with weights like new_weight[:, i] = pretrained_weight[:, i % 3], and then scaled with new_weight * 3 / new_in_channels.
model = smp.FPN('resnet34', in_channels=1)
mask = model(torch.ones([1, 1, 64, 64]))Auxiliary classification output
All models support aux_params parameters, which is default set to None.aux_params = None
If then classification auxiliary output is not created, elsemask
model produce not only , but also label output with shape NC.aux_params
Classification head consists of GlobalPooling->Dropout(optional)->Linear->Activation(optional) layers, which can be
configured by as follows:aux_params=dict(
pooling='avg', # one of 'avg', 'max'
dropout=0.5, # dropout ratio, default is None
activation='sigmoid', # activation function, default is None
classes=4, # define number of output labels
)
model = smp.Unet('resnet34', classes=4, aux_params=aux_params)
mask, label = model(x)
Depth
Depth parameter specify a number of downsampling operations in encoder, so you can make
your model lighter if specify smaller depth.model = smp.Unet('resnet34', encoder_depth=4)
π Installation <a name="installation"></a>
PyPI version:
$ pip install segmentation-models-pytorchThe latest version from GitHub:
$ pip install git+https://github.com/qubvel/segmentation_models.pytorchπ Competitions won with the library <a name="competitions"></a>
Segmentation Models package is widely used in image segmentation competitions.
Here you can find competitions, names of the winners and links to their solutions.π Projects built with SMP
- withoutBG: An open-source background removal tool that uses
smp.Unet` for its image matting and refinement models. Check withoutBG Focus on HuggingFace.π€ Contributing <a name="contributing"></a>
1. Install SMP in dev mode
make install_dev # Create .venv, install SMP in dev mode2. Run tests and code checks
make test # Run tests suite with pytest
make fixup # Ruff for formatting and lint checks3. Update a table (in case you added an encoder)
make table # Generates a table with encoders and print to stdoutπ Citing <a name="citing"></a>
@misc{Iakubovskii:2019,
Author = {Pavel Iakubovskii},
Title = {Segmentation Models Pytorch},
Year = {2019},
Publisher = {GitHub},
Journal = {GitHub repository},
Howpublished = {\url{https://github.com/qubvel/segmentation_models.pytorch}}
}π‘οΈ License <a name="license"></a>
The project is primarily distributed under MIT License, while some files are subject to other licenses. Please refer to LICENSES and license statements in each file for careful check, especially for commercial use.
---