Main Content

Instance Segmentation

Perform instance segmentation using pretrained deep learning networks and train networks using transfer learning on custom data

Instance segmentation is a computer vision technique that plays a crucial role in tasks requiring precise object localization and the identification of individual object instances, such as in medical imaging and autonomous driving. By combining the principles of object detection and semantic segmentation, instance segmentation provides a more refined understanding of visual data by identifying individual object instances and delineating their boundaries pixel-by-pixel. Use instance segmentation to precisely identify, classify, and separate individual objects within an image.

You can run inference on an image using a pretrained deep learning network, or perform transfer learning, an approach that enables you to start with a pretrained network and then train it on custom data set for your application. To generate ground truth data for training, you can use the Image Labeler, Video Labeler, or Ground Truth Labeler (Automated Driving Toolbox) app to interactively label pixels and export label data. Instance segmentation requires Deep Learning Toolbox™. Training and inference support CUDA®-enabled GPU. Use of a GPU is recommended, and requires Parallel Computing Toolbox™. For more information, see Parallel Computing Support in MathWorks Products (Parallel Computing Toolbox).

Instance segmentation using SOLOv2: Left — segmented and labeled road scenario using a sample modified RGB image from the CamVid data set, Right — segmented image of PVC pipe connectors

Funktionen

alle erweitern

Configure Instance Segmentation Network

solov2Segment objects using SOLOv2 instance segmentation network (Seit R2023b)
maskrcnnDetect objects using Mask R-CNN instance segmentation (Seit R2021b)

Perform Inference

segmentObjectsSegment objects using Mask R-CNN instance segmentation (Seit R2021b)
segmentObjectsSegment objects using SOLOv2 instance segmentation (Seit R2023b)

Load Training Data

boxLabelDatastoreDatastore for bounding box label data (Seit R2019b)
groundTruthGround truth label data
imageDatastoreDatastore for image data
combineCombine data from multiple datastores

Train Instance Segmentation Networks

trainSOLOV2Train SOLOv2 network to perform instance segmentation (Seit R2023b)
trainMaskRCNNTrain Mask R-CNN network to perform instance segmentation (Seit R2022a)

Augment and Preprocess Training Data

poly2maskConvert region of interest (ROI) polygon to region mask
bwboundariesTrace object boundaries in binary image
balanceBoxLabelsBalance bounding box labels for object detection (Seit R2020a)
bboxcropCrop bounding boxes (Seit R2019b)
bboxeraseRemove bounding boxes (Seit R2021a)
bboxresizeResize bounding boxes (Seit R2019b)
bboxwarpApply geometric transformation to bounding boxes (Seit R2019b)
bbox2pointsConvert rectangle to corner points list
imwarpApply geometric transformation to image
imcropCrop image
imresizeResize image
randomAffine2dCreate randomized 2-D affine transformation (Seit R2019b)
centerCropWindow2dCreate rectangular center cropping window (Seit R2019b)
randomWindow2dRandomly select rectangular region in image (Seit R2021a)
posemaskrcnnPredict object pose using Pose Mask R-CNN pose estimation (Seit R2024a)
predictPoseEstimate object pose using Pose Mask R-CNN deep learning network (Seit R2024a)
trainPoseMaskRCNNTrain Pose Mask R-CNN network to perform pose estimation (Seit R2024a)
insertObjectMask Insert masks in image or video stream (Seit R2020b)
insertObjectAnnotationAnnotate truecolor or grayscale image or video
insertShapeInsert shapes in image or video
showShapeDisplay shapes on image, video, or point cloud (Seit R2020b)
evaluateInstanceSegmentationEvaluate instance segmentation data set against ground truth (Seit R2022b)
instanceSegmentationMetricsInstance segmentation quality metrics (Seit R2022b)
metricsByAreaEvaluate instance segmentation across object mask size ranges (Seit R2023b)

Themen

Get Started

Train Data for Instance Segmentation