Skip to content

Commit efcc4e2

Browse files
committed
add deeplab v3 mobilenetv3
1 parent 45c4ca3 commit efcc4e2

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

pytorch_vision_deeplabv3_resnet101.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
layout: hub_detail
33
background-class: hub-background
44
body-class: hub
5-
title: Deeplabv3-ResNet101
6-
summary: DeepLabV3 model with a ResNet-101 backbone
5+
title: Deeplabv3
6+
summary: DeepLabV3 models with ResNet-50, ResNet-101 and MobileNet-V3 backbones
77
category: researchers
88
image: deeplab2.png
99
author: Pytorch Team
@@ -18,7 +18,10 @@ order: 1
1818

1919
```python
2020
import torch
21-
model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet101', pretrained=True)
21+
model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet50', pretrained=True)
22+
# or any of these variants
23+
# model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet101', pretrained=True)
24+
# model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_mobilenet_v3_large', pretrained=True)
2225
model.eval()
2326
```
2427

@@ -35,7 +38,7 @@ So, `output['out']` is of shape `(N, 21, H, W)`. More documentation can be found
3538
```python
3639
# Download an example image from the pytorch website
3740
import urllib
38-
url, filename = ("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
41+
url, filename = ("https://github.com/pytorch/hub/raw/master/images/deeplab1.png", "deeplab1.png")
3942
try: urllib.URLopener().retrieve(url, filename)
4043
except: urllib.request.urlretrieve(url, filename)
4144
```
@@ -45,6 +48,7 @@ except: urllib.request.urlretrieve(url, filename)
4548
from PIL import Image
4649
from torchvision import transforms
4750
input_image = Image.open(filename)
51+
input_image = input_image.convert("RGB")
4852
preprocess = transforms.Compose([
4953
transforms.ToTensor(),
5054
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
@@ -86,14 +90,17 @@ plt.imshow(r)
8690

8791
### Model Description
8892

89-
Deeplabv3-ResNet101 is constructed by a Deeplabv3 model with a ResNet-101 backbone.
93+
Deeplabv3-ResNet is constructed by a Deeplabv3 model using a ResNet-50 or ResNet-101 backbone.
94+
Deeplabv3-MobileNetV3-Large is constructed by a Deeplabv3 model using the MobileNetV3 large backbone.
9095
The pre-trained model has been trained on a subset of COCO train2017, on the 20 categories that are present in the Pascal VOC dataset.
9196

9297
Their accuracies of the pre-trained models evaluated on COCO val2017 dataset are listed below.
9398

94-
| Model structure | Mean IOU | Global Pixelwise Accuracy |
95-
| ------------------- | ----------- | --------------------------|
96-
| deeplabv3_resnet101 | 67.4 | 92.4 |
99+
| Model structure | Mean IOU | Global Pixelwise Accuracy |
100+
| ---------------------------- | ----------- | --------------------------|
101+
| deeplabv3_resnet50 | 66.4 | 92.4 |
102+
| deeplabv3_resnet101 | 67.4 | 92.4 |
103+
| deeplabv3_mobilenet_v3_large | 60.3 | 91.2 |
97104

98105
### Resources
99106

0 commit comments

Comments
 (0)