# Pretrained DeepLabv3+ Network for Semantic Segmentation
This repository provides a pretrained DeepLabv3+[1] semantic segmentation model for MATLAB®.
Requirements
------------
- MATLAB® R2020a or later.
- Deep Learning Toolbox™.
- Computer Vision Toolbox™.
Overview
--------
Semantic segmentation is a computer vision technique for segmenting different classes of objects in images or videos. This pretrained network is trained using PASCAL VOC dataset[2] which have 20 different classes including airplane, bus, car, train, person, horse etc.
For more information about semantic segmentation, see [Getting Started with Semantic Segmentation Using Deep Learning](https://mathworks.com/help/vision/ug/getting-started-with-semantic-segmentation-using-deep-learning.html).
Getting Started
---------------
Download or clone this repository to your machine and open it in MATLAB®.
### Download the pretrained network
Use the below helper to download the pretrained network.
```
model = helper.downloadPretrainedDeepLabv3Plus;
net = model.net;
```
Semantic Segmentation Using Pretrained DeepLabv3+
-------------------------------------------------
```
% Read test image from images folder
image = imread('visionteam.jpg');
% Resize the image to the size used to train the network.
% The image is resized such that smallest dimension is 513.
sz = size(image);
[~,k] = min(sz(1:2));
scale = 513/sz(k);
img = imresize(image, scale, "bilinear");
% Use semanticseg function to generate segmentation map.
result = semanticseg(img, net);
% Generate the overlaid result using generated map.
overlay = labeloverlay(img , result, 'Transparency', 0.4);
% Visualize the input and the result.
overlay = imresize(overlay, sz(1:2), 'bilinear');
montage({image, overlay});
```
Left-side image is the input and right-side image is the corresponding segmentation output.
![alt text](images/result.png?raw=true)
Train Custom DeepLabv3+ Using Transfer Learning
-----------------------------------------------
Transfer learning enables you to adapt a pretrained DeepLabv3+ network to your dataset. Create a custom DeepLabv3+ network for transfer learning with a new set of classes using the `configureDeepLabv3PlusTransferLearn.m` script. For more information about training a DeepLabv3+ network, see [Semantic Segmentation Using Deep Learning](https://www.mathworks.com/help/vision/ug/semantic-segmentation-using-deep-learning.html)
Code Generation for DeepLabV3+
------------------------------
Code generation enables you to generate code and deploy DeepLabv3+ on multiple embedded platforms.
Run `codegenDeepLabv3Plus.m`. This script calls the `deepLabv3Plus_predict.m` entry point function and generate CUDA code for it. It will run the generated MEX and gives output.
| Model | Inference Speed (FPS) |
| ------ | ------ |
| DeepLabv3Plus w/o codegen | 3.5265 |
| DeepLabv3Plus with codegen | 21.5526 |
- Performance (in FPS) is measured on a TITAN-RTX GPU using 513x513 image.
For more information about codegen, see [Deep Learning with GPU Coder](https://www.mathworks.com/help/gpucoder/gpucoder-deep-learning.html)
Accuracy
--------
Metrics are mIoU, global accuracy and mean accuracy computed over 2012 PASCAL VOC val data.
| Model | mIoU | Global Accuracy | Mean Accuracy | Size (MB) | Classes |
| ------ | ------ | ------ | ------ | ------ | ------ |
| DeepLabv3Plus-VOC | 0.77299 | 0.94146 | 0.87279 | 209 | [voc class names](+helper/pascal-voc-classes.txt) |
- During computation of these metrics, val images are first resized such that the smaller dimension of the images are scaled to 513 because that matches the training preprocessing and then a center crop of size 513x513 is used for evaluation.
References
-----------
[1] Chen, Liang-Chieh, et al. "Encoder-decoder with atrous separable convolution for semantic image segmentation." Proceedings of the European conference on computer vision (ECCV). 2018.
[2] The PASCAL Visual Object Classes Challenge: A Retrospective Everingham, M., Eslami, S. M. A., Van Gool, L., Williams, C. K. I., Winn, J. and Zisserman, A. International Journal of Computer Vision, 111(1), 98-136, 2015.
Copyright 2021 The MathWorks, Inc.
AI拉呱
- 粉丝: 2899
- 资源: 5550
最新资源
- 高速追剪程序,定长追剪,威纶触摸屏+汇川5u全套程序,注释清楚
- H3C命令查询工具.zip
- Ubuntu 20.04 LTS安装与优化全流程指南
- 改进鲸鱼优化算法(IWOA,自己融合了多策略改进,名字自己取的破涕为笑),改进包括circle混沌映射,自适应阈值,非线性收敛因子,以及自适应权重和levy飞行策略,具体公式会在readme说明文
- 课程设计大作业-基于python+tkinter+MySQL的选课系统源码(95分以上)
- 西门子PLC屏幕编辑器WIN11可安装板
- STM32单片机开发的串口双机模拟汽车电量里程项目,两个STM32单片机进行数据交互,模拟主控与驱动传感器发送数据,可以手动调节数据,并显示屏显示出来 包括程序源码和protues仿真8.12版本
- 人形机器人灵巧手行业产业链图谱
- 润达医疗(体外诊断产品及技术研发商,上海润达医疗科技股份有限公司)创投信息
- python学生选课信息管理系统源码(tkinter+MySQL)高分项目
- 伺服系统转动惯量离线辨识算法仿真 1.模型简介 模型为永磁同步电机伺服控制仿真,采用Matlab R2018a Simulink搭建 模型内主要包含DC直流电压源、三相逆变器、永磁同步电机、
- HTML环境中WebSocket的应用解析及优化技巧
- MATLAB环境下一种基于深度学习的癫痫发作自动检测方法 算法运行环境为MATLAB R2021b,执行基于深度学习(LSTM)的癫痫发作自动检测 压缩包=程序+数据+参考 运行需要GPU,需要
- dsafagaghjj
- sprinboot+vue+mysql(保证能运行)
- 考虑用户舒适度的冷热电多能互补综合能源系统优化调度-邹云阳 主要内容: 针对综合能源系统优化调度的研究,具体包括: 1.建立含风光、P2G、燃气轮机、燃气锅炉等多能耦合元件的运行特性模型 2.电、热、
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈