Face Recognition Using Transfer learning with Mobile Net and vgg16
MLOps Task
Face Recognition using Transfer Learning
In this Task we have to create a CNN model using pre trained models and weights like Mobilenet, ImageNet and Vgg16 for face recognition.
In this task we are using the weights from imageNet and Architecture of MobileNet and vgg16
Pre requisite:
1) These libraries should be installed first:
* Keras
* tensorflow
* numpy
* pandas
* opencv-python
Now lets Proceed further:
Step 1:
* First of all we have to collect the dataset on which we are training our model you can use
any images dataset you want or you can open up your webcam and get your face images
Step 2:
* Open Jupyter-notebook and use the following code
this code will open your webcam and take you cropped face images
Step 3:
* Now we are creating the CNN model using mobile net. I am using 5 celebrity datasets
Visit this website:
Download this dataset
https://www.kaggle.com/dansbecker/5-celebrity-faces-dataset
Step 4:
* Use the following code which is uploded on the github
This will Download ImageNet weights
This will import all the CNN layers and Display the model Summary
* Now there are 5 celebrity it depends on you how much you want to classify.
In this tutorial i am taking 5 you can change the datasets if you want
Your Folder names should be same as written here . In this Example the folder names of 5 celebrity are n0, n2, n3, n4 in celebrity_dict_n variable.
Step 5:
That's it After doing all the steps properly your model is ready using Transfer learning with vgg16 face model Architecture trained on image net
By Following the above steps you can also use other Architecture if you want facenet, inception etc.
Github Link for code:
https://github.com/Moiz-Ali-Moomin/MLOps-Task4
moiz.7152@gmail.com
RISE_2020.68.23.5
Thank you for sharing such a useful article. I had a great time. This article was fantastic to read. Continue to publish more articles on
ReplyDeleteData Engineering Services
AI Services
Data Analytics Solutions
Data Modernization Solutions