Using a trained FastRCNNObjectDetector, expected LABEL to be nonempty
1 次查看(过去 30 天)
显示 更早的评论
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
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!