Azzera filtri
Azzera filtri

SplitEachLabel Error for divide Images into Train and Test Data for Faster R-CNN

21 visualizzazioni (ultimi 30 giorni)
I have 297 Grayscale images (Drone) and I would Like Divide Them into 3 parts (train-test and validation) for Object Detection Using Faster R-CNN method and I used SplitEachLabel Command in Matlab2018a but after write below codes:
imds = imageDatastore('C:\Users\hosein\My Documents\MATLAB\DroneImages');
[trainds,testds,valds] = splitEachLabel(imds,0.6,0.2,'randomized');
matlab showed error: "Input folders or files contain non-standard file extensions.Use FileExtensions Name-Value pair to include the non-standard file extensions."
and when I wrote this code:
[trainds,testds,valds] = splitEachLabel(imds,0.6,0.2)
matlab showed error:"splitEachLabel requires non-empty Labels property.."
  2 Commenti
Julian Lopez Baasch
Julian Lopez Baasch il 6 Dic 2018
Modificato: Julian Lopez Baasch il 6 Dic 2018
Be sure you loaded the data properly. You can check that by computing the data size. Try with
>> size(imds)
If the output is of the shape 0xsomething, then you hadn't load the data properly. Maybe your path is wrong.

Accedi per commentare.

Risposte (1)

Obaid Rafiq Jan
Obaid Rafiq Jan il 26 Nov 2020
The error is quite straightforward; 'splitEachLabel' requires a label from the 'imageDatastore' object which is not defined in your code. One of the input arguments for 'imageDatastore' is its 'LabelSource', by default it is set to none and you can specify any label if you want, or you can simply let the label definition be 'foldernames' which takes the name of your imageDatastore folder and provides that as the label. You can try:
dataDir = fullfile('C:\Users\hosein\My Documents\MATLAB');
imDir = fullfile(dataDir, 'DroneImages');
imds = imageDatastore(imDir, 'LabelSource', 'foldernames');
[trainds,testds,valds] = splitEachLabel(imds,0.6,0.2);
  1 Commento
Krishnapuram Nithinsai
Krishnapuram Nithinsai il 29 Ago 2023
flowerds = imageDatastore("C:\Users\krish\OneDrive\Desktop\deeplearning_course_files\RandomImages");
rng default
[trainImgs,testImgs] = splitEachLabel(flowerds,0.6,"randomized");
//I'm getting same error too

Accedi per commentare.

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by