MATLAB Answers

loading a new .MAT file with ground truths in an excel file

5 views (last 30 days)
Matpar
Matpar on 17 Jan 2020
Edited: Matpar on 17 Jan 2020
Hi can a professional assist me please,
I am having a challenge creating a new .MAT file with the ground truths located in an .XLSX excel file.
Can someone guide me please? This has been evading me nevertheless I made several attemps at some of the examples displayed in the community forum.
I am not getting it! someone please assist and thank you in advance for acknowledging my requests.

  1 Comment

AdamG2013468
AdamG2013468 on 17 Jan 2020
You may have to elaborate on your issue. What do you mean by ground truths?
Do you have any MATLAB code written already. If so, you can post it here and that will help with troubleshooting.

Sign in to comment.

Accepted Answer

Matpar
Matpar on 17 Jan 2020
Edited: Matpar on 17 Jan 2020
Hi Professionals,
I have gotten this far with my code,
I took a break and came back still cannot see the error! can some point me in the right direction please!
I really would like to solve this!
%% Train R-CNN Stop Sign Detector
% Load training data and network layers.
load('gunx.mat', 'guntr', 'layers')
%% Add the image directory to the MATLAB path.
imDir = fullfile(matlabroot, 'toolbox', 'vision', 'visiondata','gunsGT');
addpath(imDir);
%% Set network training options to use mini-batch size of 32 to reduce
% GPU/CPU memory usage. Lower the InitialLearnRate to reduce the rate at which
% network parameters are changed. This is beneficial when fine-tuning a
% pre-trained network and prevents the network from changing too rapidly.
options = trainingOptions('sgdm','MiniBatchSize', 32,'InitialLearnRate', 1e-6,'MaxEpochs', 10);
%% Train the R-CNN detector. Training can take a few minutes to complete.
rcnn = trainRCNNObjectDetector(gunsGT, layers, options, 'NegativeOverlapRange', [0 0.3]);
%% Test the R-CNN detector on a test image.
img = imread('Gun00012.jpg');
[bbox, score, label] = detect(rcnn, img, 'MiniBatchSize', 32);
%% Display strongest detection result.
[score, idx] = max(score);
bbox = bbox(idx, :);
annotation = sprintf('%s: (Confidence = %f)', label(idx), score);
detectedImg = insertObjectAnnotation(img, 'rectangle', bbox, annotation);
figure
imshow(detectedImg)
%% Remove the image directory from the path.
rmpath(imDir);
%% MY ERRORS:
>> guntest2
Warning: Variable 'layers' not found.
> In guntest2 (line 3)
Undefined function or variable 'gunsGT'.
Error in guntest2 (line 16)
rcnn = trainRCNNObjectDetector(gunsGT, layers, options, 'NegativeOverlapRange', [0 0.3]);

  0 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by