imagedatastore, Add Folder location
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Rayan Matlob
le 13 Juil 2022
Modifié(e) : Kojiro Saito
le 14 Juil 2022
Hi
for the Folder in imagedatastore, afterrandomizeing the images order and labels, the folder value changed from
"C:\Users\R_9_1_GSM_5_original"
to
val=
any way to manually add location again?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1064765/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1064770/image.jpeg)
the problem accured as follow: as i have 4 imagedatastore and i need to randonly resort the images for all the datastore in the same manner.
for a dataset with two classes (good and bad), when i split data as :
[imdsTrain,imdsValidation] = splitEachLabel(data,0.75)
i will get the images in Files as Good Good Good Good Good Good Good ....948 time then i will get 250 bad bad bad bad bad ...
so i used to change the order and changed the labels manually.
order_train = randperm(numel(imdsTrain.Files))
imdsTrain.Files = imdsTrain_1.Files(order_train);
after these two steps the folder location changed to Val=.
Regards
0 commentaires
Réponse acceptée
Kojiro Saito
le 13 Juil 2022
Modifié(e) : Kojiro Saito
le 14 Juil 2022
[imdsTrain,imdsValidation] = splitEachLabel(data,0.75);
imdsTrain = shuffle(imdsTrain);
UPDATED
imdsTrain = subset(imdsTrain_1, order_train);
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Convert Image Type 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!