boxlabelDatastore for 2 or more classes
1 view (last 30 days)
Show older comments
Hello everyone! I need some hel with a custom multiclass object detector. I'm new in matlab programming and I can't figure how to use boxlabeldatastore for 2 classes. I'm using a Tutorial video post by matlab but they only detect 1 class. I'd really appreciate some help
here's the code for the boxlabeldatastore
rng(0)
shuffledIndices = randperm(height(fileNames{1}));
idx = floor(0.7 * height(fileNames{1}));
trainingIdx = 1:idx;
TrainingSelectedIndices = shuffledIndices(trainingIdx);
trainingDataTbl = fileNames{1}(TrainingSelectedIndices,:);
trainingDataTblBX = labelData{1}(TrainingSelectedIndices,:);
imdsTrain = imageDatastore(trainingDataTbl);
bldBigRedBuoy = trainingDataTblBX(:,1);
bldBigGreenBuoy = trainingDataTblBX(:,2);
bldsTrain = boxLabelDatastore(bldBigRedBuoy,bldBigGreenBuoy);
bldsTrain = boxLabelDatastore(bldBigRedBuoy,bldBigGreenBuoy);
bldsTrain seems only use "bldBigRedBuoy"
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1420408/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1420413/image.png)
0 Comments
Answers (1)
Harsh
on 27 Jun 2023
I believe bldsTrain has data from both the bldBigRedBuoy and bldBigGreenBuoy. The values for bldBigGreenBuoy are stacked at the bottom of bldBigRedBuoy. You can verify that by checking the size of bldBigRedBuoy and bldBigGreenBuoy. In the example above, it should be 183.
Check the documentation of boxlabeldatastore for more clarity -
Please let me know if this answers your query !
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!