MATLAB Answers

Deep Network Designer, Faster R-CNN

2 views (last 30 days)
Monika Zikmundová
Monika Zikmundová on 7 May 2021
Answered: Divya Gaddipati on 13 May 2021
Hello
Can anyone please help me with resolving this error message?
The error message occurs after uploading the network to the deep network designer application
Thank you
My code:
clear all
close all
format long g
data=load('matlab_V21_ROI_11_3_2021.mat')
gTruth=data.gTruth;
gTruth.DataSource
gTruth.LabelDefinitions;
replaceimds=imageDatastore('C:\monika\vse\kratery')
replaceDataSource=groundTruthDataSource(replaceimds)
gTruth.DataSource=replaceDataSource
%objectdetector
trainingDataTable=objectDetectorTrainingData(gTruth);
% [imds,blds]=objectDetectorTrainingData(gTruth);
% cds=combine(imds,blds)
% read(cds)
% counts=countEachLabel(cds)
filenamesImages=trainingDataTable.imageFilename
tblBoxes=trainingDataTable(:,'krater')
imds=imageDatastore(filenamesImages, 'LabelSource','foldernames')
blds=boxLabelDatastore(tblBoxes)
cds=combine(imds,blds)
% anchor boxes I
network = resnet50;%squeezenet; % resnet50
inputImageSize =[224 224 3]; %network.Layers(1).InputSize;
numClasses = 1;
featureLayer = 'activation_40_relu';%'fire5-concat' %'activation_40_relu';
%estimate anchor boxes
numAnchors = 3
[anchorBoxes,meanIoU] = estimateAnchorBoxes(cds,numAnchors);
anchorBoxes
meanIoU
maxNumAnchors = 3;
meanIoU = zeros([maxNumAnchors,1]);
anchorBoxes = cell(maxNumAnchors, 1);
for k = 1:maxNumAnchors
% Estimate anchors and mean IoU.
[anchorBoxes{k},meanIoU(k)] = estimateAnchorBoxes(cds,k);
end
figure
plot(1:maxNumAnchors,meanIoU,'-o')
ylabel("Mean IoU")
xlabel("Number of Anchors")
title("Number of Anchors vs. Mean IoU")
% anchor boxes 2 - pokracovani
anchorBoxes = [72,70; 99,96; 53,51];
lgraph = fasterRCNNLayers(inputImageSize,numClasses,anchorBoxes, ...
network,featureLayer);
analyzeNetwork(lgraph);

Answers (1)

Divya Gaddipati
Divya Gaddipati on 13 May 2021
Deep Network Designer currently doesn't support training of a network with multiple outputs.
To train Faster R-CNN, you could use the trainFasterRCNNObjectDetector function as shown in this example.

Community Treasure Hunt

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

Start Hunting!