{"id":13788434,"url":"https://github.com/matlab-deep-learning/pretrained-deeplabv3plus","last_synced_at":"2025-05-07T19:24:28.872Z","repository":{"id":118345320,"uuid":"359412812","full_name":"matlab-deep-learning/pretrained-deeplabv3plus","owner":"matlab-deep-learning","description":"DeepLabv3+ inference and training in MATLAB for Semantic Segmentation","archived":false,"fork":false,"pushed_at":"2021-04-26T13:05:46.000Z","size":846,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-14T21:51:22.855Z","etag":null,"topics":["computer-vision","deep-learning","deeplabv3","deeplabv3-plus","deeplabv3-plus-network","matlab","matlab-deep-learning","pretrained-models","semantic-segmentation","transfer-learning"],"latest_commit_sha":null,"homepage":"https://www.mathworks.com/help/vision/ug/getting-started-with-semantic-segmentation-using-deep-learning.html","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matlab-deep-learning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-04-19T10:06:19.000Z","updated_at":"2024-09-18T10:13:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"a9029e67-15e7-4161-aed5-201317df3d58","html_url":"https://github.com/matlab-deep-learning/pretrained-deeplabv3plus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2Fpretrained-deeplabv3plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2Fpretrained-deeplabv3plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2Fpretrained-deeplabv3plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2Fpretrained-deeplabv3plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matlab-deep-learning","download_url":"https://codeload.github.com/matlab-deep-learning/pretrained-deeplabv3plus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252942231,"owners_count":21829030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","deep-learning","deeplabv3","deeplabv3-plus","deeplabv3-plus-network","matlab","matlab-deep-learning","pretrained-models","semantic-segmentation","transfer-learning"],"created_at":"2024-08-03T21:00:46.120Z","updated_at":"2025-05-07T19:24:28.847Z","avatar_url":"https://github.com/matlab-deep-learning.png","language":"MATLAB","funding_links":[],"categories":["Semantic Segmentation \u003ca name=\"SemanticSegmentation\"/\u003e"],"sub_categories":["Robotics"],"readme":"# Pretrained DeepLabv3+ Network for Semantic Segmentation\n\nThis repository provides a pretrained DeepLabv3+[1] semantic segmentation model for MATLAB\u0026reg;.\n\nRequirements\n------------\n\n- MATLAB\u0026reg; R2020a or later.\n- Deep Learning Toolbox\u0026trade;.\n- Computer Vision Toolbox\u0026trade;.\n\nOverview\n--------\n\nSemantic 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. \n\nFor 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).\n\n \nGetting Started\n---------------\nDownload or clone this repository to your machine and open it in MATLAB\u0026reg;.\n\n### Download the pretrained network\nUse the below helper to download the pretrained network.\n\n```\nmodel = helper.downloadPretrainedDeepLabv3Plus;\nnet = model.net;\n```\n\nSemantic Segmentation Using Pretrained DeepLabv3+\n-------------------------------------------------\n\n```\n% Read test image from images folder\nimage = imread('visionteam.jpg');\n\n% Resize the image to the size used to train the network. \n% The image is resized such that smallest dimension is 513.\nsz = size(image);\n[~,k] = min(sz(1:2));\nscale = 513/sz(k);\nimg  = imresize(image, scale, \"bilinear\");\n\n% Use semanticseg function to generate segmentation map.\nresult = semanticseg(img, net);\n\n% Generate the overlaid result using generated map.\noverlay = labeloverlay(img , result, 'Transparency', 0.4);\n\n% Visualize the input and the result.\noverlay = imresize(overlay, sz(1:2), 'bilinear');\nmontage({image, overlay});\n```\nLeft-side image is the input and right-side image is the corresponding segmentation output.\n\n![alt text](images/result.png?raw=true)\n\n\nTrain Custom DeepLabv3+ Using Transfer Learning\n-----------------------------------------------\nTransfer 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)\n\n\nCode Generation for DeepLabV3+\n------------------------------\nCode generation enables you to generate code and deploy DeepLabv3+ on multiple embedded platforms.\n\nRun `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.\n\n| Model | Inference Speed (FPS) | \n| ------ | ------ | \n| DeepLabv3Plus w/o codegen | 3.5265 |\n| DeepLabv3Plus with codegen | 21.5526 |\n\n- Performance (in FPS) is measured on a TITAN-RTX GPU using 513x513 image.\n\nFor more information about codegen, see [Deep Learning with GPU Coder](https://www.mathworks.com/help/gpucoder/gpucoder-deep-learning.html)\n\n\nAccuracy\n--------\nMetrics are mIoU, global accuracy and mean accuracy computed over 2012 PASCAL VOC val data. \n\n| Model | mIoU | Global Accuracy | Mean Accuracy | Size (MB) | Classes |\n| ------ | ------ | ------ | ------ | ------ | ------ |\n| DeepLabv3Plus-VOC | 0.77299 | 0.94146 | 0.87279 | 209 | [voc class names](+helper/pascal-voc-classes.txt) |\n\n- 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.\n\n\nReferences\n-----------\n[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.\n\n[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.\n\n\nCopyright 2021 The MathWorks, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatlab-deep-learning%2Fpretrained-deeplabv3plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatlab-deep-learning%2Fpretrained-deeplabv3plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatlab-deep-learning%2Fpretrained-deeplabv3plus/lists"}