I want to set binary categories to sub-folder names, which will become class labels

1 回表示 (過去 30 日間)
Ignacio Acevedo
Ignacio Acevedo 2021 年 3 月 10 日
回答済み: Asvin Kumar 2021 年 3 月 16 日
Just as explained in the title, i want to set binary categories to sub-folders which will become class labels for a deep learning application, but i am struggling to find the correct syntax to move forward with this step.
  1 件のコメント
Jan
Jan 2021 年 3 月 11 日
I do not understand, what you are asking for. What do you call a "binary category"? Can you give an example?

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

回答 (1 件)

Asvin Kumar
Asvin Kumar 2021 年 3 月 16 日
I assume you are working with image datastores and you're looking to create a dataset with images belong to two classes.
imageDatastore has a Name-Value pair called 'LabelSource'. When this property is set to 'FolderNames', all the images belonging to a a sub-folder will derive their labels from the folder name.
Since you can't have multiple sub-folders with the same name, you would have to organise all your data into two folders representing your two categories and then use the 'LabelSource' N-V pair with imageDatastore. Here's an example you might find helpful: Create ImageDatastore object

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by