Using a trained FastRCNNObjectDetector, expected LABEL to be nonempty
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Jingang Wu
il 10 Nov 2019
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.
Risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!