フィルターのクリア

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

21 ビュー (過去 30 日間)
seyed hosein alhoseiny
seyed hosein alhoseiny 2018 年 12 月 5 日
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 件のコメント
Julian Lopez Baasch
Julian Lopez Baasch 2018 年 12 月 6 日
編集済み: Julian Lopez Baasch 2018 年 12 月 6 日
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.
Michael Mashevsky
Michael Mashevsky 2020 年 6 月 30 日
Did you ever find an anwwer to this question?

サインインしてコメントする。

回答 (1 件)

Obaid Rafiq Jan
Obaid Rafiq Jan 2020 年 11 月 26 日
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 件のコメント
Krishnapuram Nithinsai
Krishnapuram Nithinsai 2023 年 8 月 29 日
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

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePreprocess Data for Deep Neural Networks についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by