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

2 views (last 30 days)
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!

Answers (1)

Sindhu Karri
Sindhu Karri on 19 May 2020
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 Comment
Neus Alcon
Neus Alcon on 19 May 2020
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.

Sign in to comment.

Categories

Find more on Image Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!