MATLAB Answers

NEED HELP WITH Preprocessing gTruth label data

20 views (last 30 days)
Siim-Joosep Saulep
Siim-Joosep Saulep on 26 May 2020
Commented: 泽宇 王 on 14 May 2021
Hello,
I labeled my images by using Image Labeler app, the size of the images were 480x640 and I had 3 classes. I created the trainingData from gTruth. While trying to estimate the anchorboxes It got me the following error: I started to look into it and I realised that the preprocessed trainingdataset had exactly the same values as the inital dataset and they both had most of the bounding box values as 3x4 double. By following the MATLAB example everything worked just fine and the bounding box values seemed single.
Does the issue persist because of the double value of bounding boxes? How to convert them to single?
Error using estimateAnchorBoxes>iCheckBoxesFromDatastore (line 215)
Invalid transform function defined on datastore.
Error in estimateAnchorBoxes>iParseInputs (line 168)
boxes = iCheckBoxesFromDatastore(datastore);
Error in estimateAnchorBoxes (line 136)
[boxes, numAnchors, params] = iParseInputs(datastore, numAnchors,
varargin{:});
Error in newest_detection (line 52)
[anchorBoxes, meanIoU] = estimateAnchorBoxes(trainingDataForEstimation,
numAnchors)
Caused by:
Error using bboxresize>iParseInputs (line 115)
The value of 'bboxA' is invalid. Expected input number 1, bboxA, to be
integer-valued.
  4 Comments

Sign in to comment.

Answers (1)

Sudheer Dunna
Sudheer Dunna on 9 Apr 2021
Make sure that bounding box values in nonzero, nonnegative and double with no decimal value ( Eg: if value is 234.234 make it 234 using floor or int function)
totalSize=size(labelData1{:})
for i=1:totalSize(1,1)
rowSize=size(labelData1{1,1}{i,1}{:})
for j=1:rowSize(1,1)
for k=1:4
if(labelData1{1,1}{i,1}{1,1}(j,k)<=0)
labelData1{1,1}{i,1}{1,1}(j,k)=1
else
labelData1{1,1}{i,1}{1,1}(j,k)=floor(labelData1{1,1}{i,1}{1,1}(j,k))
end
end
end
end
Written code is to access individual elements of boundingBox data and validating for said conditions and updating the values if required.

Community Treasure Hunt

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

Start Hunting!