Datastore for semantic segmentation networks
Use pixelLabelImageDatastore
to create a datastore for
training a semantic segmentation network using deep learning.
returns a datastore for training a semantic segmentation network based on the
input pximds
= pixelLabelImageDatastore(gTruth
)groundTruth
object or array of
groundTruth
objects. Use the output
pixelLabelImageDatastore
object with the Deep Learning Toolbox™ function trainNetwork
(Deep Learning Toolbox) to train convolutional
neural networks for semantic segmentation.
returns a datastore based on the input image datastore and the pixel label
datastore objects. pximds
= pixelLabelImageDatastore(imds
,pxds
)imds
is an ImageDatastore
object that
represents the training input to the network. pxds
is a
PixelLabelDatastore
object that represents the required network
output.
additionally uses name-value pairs to set the pximds
= pixelLabelImageDatastore(___,Name,Value
)DispatchInBackground
and OutputSizeMode
properties. For 2-D data, you can
also use name-value pairs to specify the ColorPreprocessing
, DataAugmentation
, and OutputSize
augmentation properties. You can
specify multiple name-value pairs. Enclose each property name in quotes.
For example,
pixelLabelImageDatastore(gTruth,'PatchesPerImage',40)
creates a pixel label image datastore that randomly generates 40 patches from
each ground truth object in gTruth
.
combine | Combine data from multiple datastores |
countEachLabel | Count occurrence of pixel or box labels |
hasdata | Determine if data is available to read |
partitionByIndex | Partition pixelLabelImageDatastore according to
indices |
preview | Preview subset of data in datastore |
read | Read data from a datastore |
readall | Read all data in datastore |
readByIndex | Read data specified by index from
pixelLabelImageDatastore |
reset | Reset datastore to initial state |
shuffle | Return shuffled version of datastore |
transform | Transform datastore |
The pixelLabelDatastore
pxds
and the imageDatastore
imds
store files that are located in a folder in
lexicographical order. For example, if you have twelve files named
'file1.jpg'
, 'file2.jpg'
, … ,
'file11.jpg'
, and 'file12.jpg'
, then
the files are stored in this
order:
'file1.jpg'
'file10.jpg'
'file11.jpg'
'file12.jpg'
'file2.jpg'
'file3.jpg'
...'file9.jpg'
If the order of files in pxds
and
imds
are not the same, then you may encounter a
mismatch when you read a ground truth image and corresponding label data using a
pixelLabelImageDatastore
. If this occurs, then rename the
pixel label files so that they have the correct order. For example, rename
'file1.jpg'
, … , 'file9.jpg'
to
'file01.jpg'
, …, 'file09.jpg'
.
To extract semantic segmentation data from a groundTruth
object generated by the Video
Labeler, use the pixelLabelTrainingData
function.
trainNetwork
(Deep Learning Toolbox)