Face Recognition Project in MATLAB using Transfer learning (with complete code)
0 بار بازدید -
4 سال پیش
-
Sorry for the spelling mistake
Sorry for the spelling mistake in the name of Shahrukh Khan.
Check the complete Project explanation & implementation from scratch:
• Complete Face Recognition Project Usi...
Note:
You need to create the database which contains 2 folders (total number of different classes you want to keep in your project , which is in this case 2 , one is my face , another is face of Shahrukh Khan)
Code to create database (take image & extract the face part using viola-jones algorithm and resize to 227 *227 , to train alexnet is given in the comment section)
Train Model:
clc
close all
g=alexnet;
layers=g.Layers;
layers(23)=fullyConnectedLayer(2);
layers(25)=classificationLayer;
allImages=imageDatastore('Dhamna','IncludeSubfolders',true, 'LabelSource','foldernames');
opts=trainingOptions('sgdm','InitialLearnRate',0.001,'MaxEpochs',20,'MiniBatchSize',64);
myNet=trainNetwork(allImages,layers,opts);
save myNet;
Testing Model:
clc;close;clear
c=webcam;
load myNet;
faceDetector=vision.CascadeObjectDetector;
while true
e=c.snapshot;
bboxes =step(faceDetector,e);
if(sum(sum(bboxes))~=0)
es=imcrop(e,bboxes(1,:));
es=imresize(es,[227 227]);
label=classify(myNet,es);
image(e);
title(char(label));
drawnow;
else
image(e);
title('No Face Detected');
end
end
Learn Digital Image Processing using MATLAB:
• Digital Image Processing using MATLAB
Learn Machine Learning & Data Science using MATLAB:
• Data Science & Machine Learning using... …
#DigitalImageProcessing #MATLAB #ComputerVision #MachineLearning #DeepLearning #TransferLearning
4 سال پیش
در تاریخ 1399/06/28 منتشر شده
است.
0
بـار بازدید شده