trainFaste​rRCNNObjec​tDetector does not work

1 次查看(过去 30 天)
clear all
close all
clc
FIRE_PATH = 'DataSet\posFire\';
load('DataSet\posFire\fires_training.mat');
% set up parameters
doTrainingAndEval = true;
options = trainingOptions('sgdm', ...
'MaxEpochs', 5, ...
'MiniBatchSize', 1, ...
'InitialLearnRate', 1e-3, ...
'CheckpointPath', tempdir);
if doTrainingAndEval
% Train Faster R-CNN detector.
% * Use 'vgg16' as the feature extraction network.
% * Adjust the NegativeOverlapRange and PositiveOverlapRange to ensure
% training samples tightly overlap with ground truth.
[detector, info] = trainFasterRCNNObjectDetector(fires_training, 'vgg16', options, ...
'NegativeOverlapRange', [0 0.3], ...
'PositiveOverlapRange', [0.6 1]);
save(strcat(FIRE_PATH,'fasterRCNNVgg16FireDetection.mat'), 'detector');
else
% Load pretrained detector for the example.
pretrained = load('fasterRCNNResNet50FireDetection.mat');
detector = pretrained.detector;
end
% testing
I = imread('DataSet\posFire\Testing\6_12.jpg');
[box, score, label] = detect(detector, I);
Hi all, I met a problem when using the detect function which is displayed in the last two lines. When I run the code to test one image, the returning box and score are null. I don't know whether there is something wrong with the detector or not. But everything goes well when I use the ResNet50 rather than VGG16.
My MATLAB version is 2018b.
Please help me!
  2 个评论
YUNYI GUANG
YUNYI GUANG 2019-7-6
For further information, the vgg16 detector I've trained is shared with this link: https://drive.google.com/open?id=1DU1104zvvNMAPF2K_1mO6CJoHdnmguGH
Thanks all!
Dheeraj Singh
Dheeraj Singh 2019-8-5
Using the mat file, you provided, we can see that the network might not have converged. Please check the training parameters. Please refer to the following link for setting the parameters:

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Recognition, Object Detection, and Semantic Segmentation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by