Reading Combined Datastores Converts to Array ?

2 views (last 30 days)
Francis Barchesky
Francis Barchesky on 19 Jun 2021
I have a augmented image datastore and a box label datastore. I am able to read each individually and receive the appropriate syntax. Here is a my augmented image datastore image (I would have included a '.mat' file however since it has directories specific to my computer I do not believe the data will be able to be processed on another computer):
Here is my box label datastore output (Note: the type of the output is a cell array when using the read function):
I believe this is due to how I created my boxLabelDatastore since I used cell2table function, see code below:
blds = boxLabelDatastore(cell2table(lookup_matrix,'VariableNames',{'char_48','char_49','char_50','char_51','char_52','char_53','char_54','char_55','char_56','char_57'}));
When I combine these datastores the bounding box information is converted to an matrix rather than a cell array. See below for code/output:
This Var2 is the bounding box however it is nolonger a cell array which causes an error when attempting to train:
Error using vision.internal.cnn.validation.checkGroundTruthDatastore>iCheckBoxes (line 75)
The bounding box (2nd column) from the read method output of the training input datastore must be an M-by-1 cell array, containing elements of
N-by-4 double matrix, where N equals the number of bounding boxes.
Error in vision.internal.cnn.validation.checkGroundTruthDatastore (line 46)
mSize = iCheckBoxes(boxes);
Error in trainFasterRCNNObjectDetector>iParseInputs (line 1037)
params.ClassNames = vision.internal.cnn.validation.checkGroundTruthDatastore(trainingDs);
Error in trainFasterRCNNObjectDetector (line 408)
[trainingData, options, params] = iParseInputs(...
Error in main_rev1 (line 20)
detector = trainFasterRCNNObjectDetector(ds, lgraph, options, ...

Community Treasure Hunt

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

Start Hunting!

Translated by