Python library with Neural Networks for Image
Segmentation based on PyTorch.
The main features of this library are:
High level API (just two lines to create neural network)
5 models architectures for binary and multi class segmentation (including legendary Unet)
46 available encoders for each architecture
All encoders have pre-trained weights for faster and better convergence
Table of content
Quick start
Since the library is built on the PyTorch framework, created segmentation model is just a PyTorch nn.Module, which can be created as easy as:
import segmentation_models_pytorch as smp
model = smp.Unet()
Depending on the task, you can change the network architecture by choosing backbones with fewer or more parameters and use pretrainded weights to initialize it:
model = smp.Unet('resnet34', encoder_weights='imagenet')
Change number of output classes in the model:
model = smp.Unet('resnet34', classes=3, activation='softmax')
All models have pretrained encoders, so you have to prepare your data the same way as during weights pretraining:
from segmentation_models_pytorch.encoders import get_preprocessing_fn
preprocess_input = get_preprocessing_fn('resnet18', pretrained='imagenet')
Examples
Training model for cars segmentation on CamVid dataset here.
Training SMP model with Catalyst (high-level framework for PyTorch), Ttach (TTA library for PyTorch) and Albumentations (fast image augmentation library) -

Segmentation Models是一个基于PyTorch的图像分割库,提供了高阶API,简单创建神经网络。它包含多个模型架构,如Unet,并提供多种预训练的编码器。该库支持快速收敛,预训练权重,以及自定义输出类别。
最低0.47元/天 解锁文章

3577

被折叠的 条评论
为什么被折叠?



