trainFaste​rRCNNObjec​tDetector does not work

조회 수: 1 (최근 30일)
YUNYI GUANG
YUNYI GUANG 2019년 7월 6일
댓글: Dheeraj Singh 2019년 8월 5일
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