フィルターのクリア

How to change the imds.Lables to the subfolders names instead of the parent folder ?

3 ビュー (過去 30 日間)
Mohamed Elbeialy
Mohamed Elbeialy 2020 年 12 月 2 日
編集済み: Marwa Masmoudi 2020 年 12 月 25 日
I am using ImageDataStore for classifications, However, the imds.Labels of classes shows (the source folder), and I am looking to use the subfolder inside it as classes
New RETINA_OCT2020 (the source parent folder ) includes (4 subfolders named ' car, human, dog, tree'). How to change the imds.Lables to the subfolder names instead of the source folder

回答 (1 件)

Nitin Kapgate
Nitin Kapgate 2020 年 12 月 15 日
While creating the ImageDataStore, use the following Name-Value pair option:
imds = imageDatastore('ParentFolder/','IncludeSubFolders',true,'LabelSource','foldernames');
This will assign the labels according to the folder names and the labels are stored in the Labels property of imds.
You can later modify the labels by accessing the Labels property directly.
  1 件のコメント
Marwa Masmoudi
Marwa Masmoudi 2020 年 12 月 25 日
編集済み: Marwa Masmoudi 2020 年 12 月 25 日
I have a dataset folder contain 2 subfolders (classes '0' and '1' ), each class contain subfolders witch contains images sequences. i used
imds = imageDatastore('ParentFolder/','IncludeSubFolders',true,'LabelSource','foldernames');
i have the sub-subfolders as classes but in my case I want to take parent folder ('0' and '1') as classes not. How i can do this .

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

カテゴリ

Help Center および File ExchangeImages についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by