load('gTruth.mat')
smokedetection = selectLabels(gTruth,'alarm');
if ~isfolder(fullfile('EvaluationData'))
mkdir EvaluationData
addpath('EvaluationData');
evaluationData = objectDetectorTrainingData(gTruth,...
'SamplingFactor',1,'WriteLocation','EvaluationData');
end
imds = imageDatastore(fullfile('EvaluationData'));
numImages = height(evaluationData);
result(numImages,:) = struct('Boxes',[],'Scores',[]);
for i = 1:numImages
I = readimage(imds,i);
[bboxes, scores] = detect(detector,I,'MiniBatchSize', 32);
result(i).Boxes = bboxes;
T = 0.58;
idx = scores >= T;
result(i).Scores = scores(idx);
end
results = struct2table(result);
overlap = 0.1;
[ap,recall,precision] = evaluateDetectionPrecision(results...
,evaluationData(:,2),overlap);
[am,fppi,missRate] = evaluateDetectionMissRate(results,evaluationData(:,2),overlap);
Error using vision.internal.detector.evaluationInputValidation>checkDetectionResultsTable (line 66)
Invalid score value in row 1 of the detection results table: Expected input to be an array with number of
elements equal to 8.
Error in vision.internal.detector.evaluationInputValidation (line 6)
checkDetectionResultsTable(detectionResults, groundTruth, mfilename);
Error in evaluateDetectionPrecision (line 94)
vision.internal.detector.evaluationInputValidation(detectionResults, ...
Error in Evaluationthedetector (line 33)
[ap,recall,precision] = evaluateDetectionPrecision(results...