DataStore, change labels in R2020a
조회 수: 28(최근 30일)
Is there a way to change all labels in an imageDataStore to an appended version of the current label?
I have my images saved in folders with the folder name being the label. Once I load these into an ImageDataStore, I would like to split them into two smaller datastores and then I would like to change each label to be "current label" + "_A".
In psudo code:
For every label in data store 1, rename to be label + "_A".
For every label in data store 2, rename to be label + "_B".
Is this possible?
yanqi liu 2021년 12월 14일
yes，sir，may be use subset and string contract to generate，such as
imds = imageDatastore(fullfile(matlabroot,'toolbox','matlab'),...
imds.Labels=categorical(erase(string(imds.Labels), ' ') + repmat('_A', size(imds.Labels, 1), 1))