how to prepare the data set for boxLabelDatastore function using image labler APP
I have a data set prepared by image labler APP. The format of the bounding box is different to the example showing on the matlab page.
Object Detection Using YOLO v2 Deep Learning – MATLAB & Simulink – MathWorks Australia
I wrote some codes to convert them, but not very successful. There are either single or double quotation marks in my table and
The boxLabelDatastore report an error message as below:
Error using boxLabelDatastore>iAssertValidBBoxFormat
The size of bounding box data must be M-by-4, M-by-5, or M-by-9, where M is the number of boxes in each table element. The column in the training data table that contains the bounding boxes must be a cell array.
My questions are:
1) How could I convert them into a cell array without ‘ or ”
2) Is there a easy way to label image and produce the dataset that mataches the example data set?
Regards
data_snail = load(‘340Ann.mat’);
imageFilename = data_snail.gTruth.DataSource;
% imageFilename = cell2table(imageFilename);
snaillist = data_snail.gTruth.LabelData.snail;
for i =1:length(snaillist)
tmp=snaillist{i};
rowStrings = arrayfun(@(row) strjoin(arrayfun(@(x) num2str(x), tmp(row, :), ‘UniformOutput’, false), ‘, ‘), 1:size(tmp, 1), ‘UniformOutput’, false);
if size(tmp,1)>1
resultString = strjoin(rowStrings, ‘; ‘);
else
resultString = rowStrings;
end
column(i,1) = string(imageFilename{i});
resultString = strcat(‘[‘, resultString, ‘]’);
column(i,2) = string(resultString);
resultString=[];
end
snailDataset = array2table(column, ‘VariableNames’, {‘imageFilename’, ‘snail’});
snailDataset.snail=cellstr(snailDataset.snail);I have a data set prepared by image labler APP. The format of the bounding box is different to the example showing on the matlab page.
Object Detection Using YOLO v2 Deep Learning – MATLAB & Simulink – MathWorks Australia
I wrote some codes to convert them, but not very successful. There are either single or double quotation marks in my table and
The boxLabelDatastore report an error message as below:
Error using boxLabelDatastore>iAssertValidBBoxFormat
The size of bounding box data must be M-by-4, M-by-5, or M-by-9, where M is the number of boxes in each table element. The column in the training data table that contains the bounding boxes must be a cell array.
My questions are:
1) How could I convert them into a cell array without ‘ or ”
2) Is there a easy way to label image and produce the dataset that mataches the example data set?
Regards
data_snail = load(‘340Ann.mat’);
imageFilename = data_snail.gTruth.DataSource;
% imageFilename = cell2table(imageFilename);
snaillist = data_snail.gTruth.LabelData.snail;
for i =1:length(snaillist)
tmp=snaillist{i};
rowStrings = arrayfun(@(row) strjoin(arrayfun(@(x) num2str(x), tmp(row, :), ‘UniformOutput’, false), ‘, ‘), 1:size(tmp, 1), ‘UniformOutput’, false);
if size(tmp,1)>1
resultString = strjoin(rowStrings, ‘; ‘);
else
resultString = rowStrings;
end
column(i,1) = string(imageFilename{i});
resultString = strcat(‘[‘, resultString, ‘]’);
column(i,2) = string(resultString);
resultString=[];
end
snailDataset = array2table(column, ‘VariableNames’, {‘imageFilename’, ‘snail’});
snailDataset.snail=cellstr(snailDataset.snail); I have a data set prepared by image labler APP. The format of the bounding box is different to the example showing on the matlab page.
Object Detection Using YOLO v2 Deep Learning – MATLAB & Simulink – MathWorks Australia
I wrote some codes to convert them, but not very successful. There are either single or double quotation marks in my table and
The boxLabelDatastore report an error message as below:
Error using boxLabelDatastore>iAssertValidBBoxFormat
The size of bounding box data must be M-by-4, M-by-5, or M-by-9, where M is the number of boxes in each table element. The column in the training data table that contains the bounding boxes must be a cell array.
My questions are:
1) How could I convert them into a cell array without ‘ or ”
2) Is there a easy way to label image and produce the dataset that mataches the example data set?
Regards
data_snail = load(‘340Ann.mat’);
imageFilename = data_snail.gTruth.DataSource;
% imageFilename = cell2table(imageFilename);
snaillist = data_snail.gTruth.LabelData.snail;
for i =1:length(snaillist)
tmp=snaillist{i};
rowStrings = arrayfun(@(row) strjoin(arrayfun(@(x) num2str(x), tmp(row, :), ‘UniformOutput’, false), ‘, ‘), 1:size(tmp, 1), ‘UniformOutput’, false);
if size(tmp,1)>1
resultString = strjoin(rowStrings, ‘; ‘);
else
resultString = rowStrings;
end
column(i,1) = string(imageFilename{i});
resultString = strcat(‘[‘, resultString, ‘]’);
column(i,2) = string(resultString);
resultString=[];
end
snailDataset = array2table(column, ‘VariableNames’, {‘imageFilename’, ‘snail’});
snailDataset.snail=cellstr(snailDataset.snail); deep learning, image labelling, boxlabeldatastore MATLAB Answers — New Questions