MATLAB Answers

NEED HELP WITH Preprocessing gTruth label data

조회 수: 19(최근 30일)
Siim-Joosep Saulep
Siim-Joosep Saulep 2020년 5월 26일
댓글: 泽宇 王 2021년 5월 14일
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
泽宇 王
泽宇 王 2021년 5월 14일
I have the same problem. :(

댓글을 달려면 로그인하십시오.

답변(1개)

Sudheer Dunna
Sudheer Dunna 2021년 4월 9일
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!

Translated by