How to introduce training and labeled image to train a neural network

2 次查看(过去 30 天)
Hello,
I'm trying to work with neural networks... Now I have the images that I want to train (.JPG) the network and the same images labeled (.m) but I'm not able to introduce this data to start the training or at least to run that function pximds = pixelLabelImageDatastore(imds,pxds);
I'm trying to use:
imds = imageDatastore(image) to open the training images
pxds = pixelLabelDatastore(label,classNames,labelIDs); to open the labeled images
but both function don't work and Matlab shows me this Cannot find files or folders matching
Do you have some suggestion to me to fix that ?
Thanks for your help!

回答(1 个)

Sindhu Karri
Sindhu Karri 2020-5-19
Hii,
You can verify the path where respective images, label files are stored and include those paths correctly in the code. The easiest way to access images, label files is to add them to current working folder.
Below is sample code which I have tried ,where images is the folder containing .jpg files placed in the current working folder(matlab path)
imds = imageDatastore('images')
classNames = ["sky" "grass" "blue"];
labelIDs = [1 2 3];
pxds = pixelLabelDatastore('images',classNames,labelIDs);
pximds = pixelLabelImageDatastore(imds,pxds);
Please refer to the below link for more details:
  1 个评论
Neus Alcon
Neus Alcon 2020-5-19
Hi Sindhu!
Thanks for your answer. Now when I try to train the network I have the follow error... Actually I don't know how I have to solve... Could you help me?
My regular image are .JPEG images with 3 channels (RGB) and the labeled images are .PNG with one channel.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by