Skip to content

Commit 1e2a5a8

Browse files
authored
Update finger_live_detection.m
1 parent 0516679 commit 1e2a5a8

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

finger_live_detection.m

-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
fullyConnectedLayer(5)
1919
softmaxLayer
2020
classificationLayer];
21-
2221
options = trainingOptions('sgdm', ...
2322
'InitialLearnRate', 0.001, ...
2423
'LearnRateSchedule', 'piecewise', ...
@@ -30,9 +29,7 @@
3029
'Verbose', true, 'Plots','training-progress');
3130

3231
% Train the network
33-
3432
cifar10Net = trainNetwork(imdsTrain, layers, options );
35-
3633
% TO AVOID TRAINING, YOU CAN LOAD TRAINED MODEL
3734
%load('final_train.mat');
3835

@@ -45,22 +42,19 @@
4542
ax2.ActivePositionProperty = 'position';
4643
keepRolling = true;
4744
set(gcf,'CloseRequestFcn','keepRolling = false; closereq');
48-
4945
while keepRolling
5046
% Display and classify the image
5147
im = snapshot(camera);
5248
image(ax1,im)
5349
im = imresize(im, [128 128]);
5450
[label,score] = classify(cifar10Net,im);
5551
title(ax1,{char(label),num2str(max(score),2)});
56-
5752
% Select the top five predictions
5853
classNames = cifar10Net.Layers(end).ClassNames
5954
[~,idx] = sort(score,'descend');
6055
idx = idx(5:-1:1);
6156
scoreTop = score(idx);
6257
classNamesTop = classNames(idx);
63-
6458
% Plot the histogram
6559
barh(ax2,scoreTop)
6660
title(ax2,'Top 5')

0 commit comments

Comments
 (0)