SplitEachLabel Error for divide Images into Train and Test Data for Faster R-CNN
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Julian Lopez Baasch
le 6 Déc 2018
Modifié(e) : Julian Lopez Baasch
le 6 Déc 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.
Réponses (1)
Obaid Rafiq Jan
le 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 commentaire
Krishnapuram Nithinsai
le 29 Août 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
Voir également
Catégories
En savoir plus sur Datastore dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!