Split data set into training and test set however labels not linked to imds

3 ビュー (過去 30 日間)
Lotte van Dijk
Lotte van Dijk 2022 年 12 月 13 日
回答済み: Amey Waghmare 2023 年 1 月 4 日
I have a dataset of images (tiff files) and a seperate Labels.mat file containing the labels 1 or 0. I want to split the dataset into a training and test set however i dont know how to couple the labels to the imds. Can someone help me to create the training and test set?

回答 (1 件)

Amey Waghmare
Amey Waghmare 2023 年 1 月 4 日
Hi,
As per my understanding, you have a dataset of images and a separate labels file and want to couple the labels with the images so as to split the dataset into training and test set.
After creating the Image Datastore ‘imds’, the labels for the files can be set using the ‘Labels’ property of the datastore as follows,
imds.Labels = label
This would link the labels to the images in the datastore. The ‘label’ for the files can be specified as a vector, a cell array or a string array.
For more information, please refer to the Image datastore documentation: https://in.mathworks.com/help/matlab/ref/matlab.io.datastore.imagedatastore.html

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by