Using a trained FastRCNNObjectDetector, expected LABEL to be nonempty

조회 수: 17 (최근 30일)
SALEM ALMARRI
SALEM ALMARRI 2019년 3월 9일
댓글: Jingang Wu 2019년 11월 10일
Hello,
I used the following trained Fast R-CNN:
trainingData = objectDetectorTrainingData(gTruth)
net = vgg16;
layersTransfer = net.Layers(1:end-3);
% numClasses = numel(categories(imdsTrain.Labels));
layers = [
layersTransfer
fullyConnectedLayer(9,'WeightLearnRateFactor',10,'BiasLearnRateFactor',10)
softmaxLayer
classificationLayer];
options = trainingOptions('sgdm', ...
'MiniBatchSize', 1, ...
'InitialLearnRate', 1e-6, ...
'MaxEpochs', 10)
frcnn = trainFastRCNNObjectDetector(trainingData, layers , options, ...
'PositiveOverlapRange',[0.1 1], ...
'NegativeOverlapRange',[0 0.1])
The training was based on trainingData which was a an imported gTruth table which included around 8 different ROI labels for 4,000 images of 224x224 dimension.
Then I have saved the trained FRCNN to classify a sample image, the error I have getting is "Expected LABEL to be nonempty", and in workspace the labels is indeed empty, I am confused as to why this has happened though I have trained the network and everything.
load frcnn
detector = frcnn
I = imread('sampleImage.jpg')
imshow(I)
[bboxes,scores,labels] = detect(detector,I)
detectedI = insertObjectAnnotation(I,'Rectangle',bboxes,cellstr(labels))
figure
imshow(detectedI)
  댓글 수: 1
Jingang Wu
Jingang Wu 2019년 11월 10일
I used the pretrained detector in mathwork example "Object Detection Using Faster R-CNN Deep Learning". I encountered the same problem. I applied my own dataset and for the first image it was working well. But for other images, the bboxes was empty.

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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by