Shortcuts

Source code for torchexpo.vision.image_segmentation.deeplabv3_resnet

import abc
import torch.nn as nn
import torchvision
from torchexpo.modules import ImageSegmentationModule


[docs]def deeplabv3_resnet50(): """DeepLabV3-ResNet50 Model pre-trained on COCO train2017""" model = DeepLabV3ResNet(torchvision.models.segmentation.deeplabv3_resnet101(pretrained=True)) obj = ImageSegmentationModule(model, "DeepLabV3-ResNet50", model_example="default") return obj
[docs]def deeplabv3_resnet101(): """DeepLabV3-ResNet101 Model pre-trained on COCO train2017""" model = DeepLabV3ResNet(torchvision.models.segmentation.deeplabv3_resnet101(pretrained=True)) obj = ImageSegmentationModule(model, "DeepLabV3-ResNet101", model_example="default") return obj
class DeepLabV3ResNet(nn.Module): """TorchExpo DeepLabV3-ResNet Scriptable Module""" def __init__(self, model): super(DeepLabV3ResNet, self).__init__() self.deeplab = model @abc.abstractmethod def forward(self, tensor): """Model Forward""" output = self.deeplab(tensor)['out'] return output[0]
Read the Docs v: latest
Versions
latest
Downloads
pdf
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.