Mlops Task-4

Mlops Task-4

Face Recognition using Transfer Learning

Task description.

Create a project using transfer learning solving various problems like Face Recognition, Image Classification, using existing Deep Learning models like VGG16, VGG19, ResNet, etc.

So lets get started, firstly we need to setup our environment. Some of the required library to run our code. I have listed below

  • opencv-python
  • numpy
  • keras
  • tensorflow
  • pillow

Lets collect our data for training and testing our model

I have used simple code of opencv library to collect the data, This program will click my 100's of images in sec and save into the specified directory.

No alt text provided for this image

Once we have collect the dataset, Lets move to train our model. I'm using hear MobileNet for Face Recognition

we gonna Freeze all layers here, because Layers are set to trainable as True by default

No alt text provided for this image

 Let's make a function that returns our FC Head

No alt text provided for this image

Let's add our FC Head back onto MobileNet

No alt text provided for this image

Now lets Load our Face Recognition Dataset

No alt text provided for this image

Now we gonna train our model with the collected datatset

No alt text provided for this image
No alt text provided for this image


Once the model is trained, It will be saved in the specified directory. We will now load our model and then use it for testing.

No alt text provided for this image

Now lets test our model on some test images

No alt text provided for this image

Here's the output

No alt text provided for this image
No alt text provided for this image

Ping me if u find any error, we can solve together. You can get the code from the GitHub link provided below.

Thanks for reading.


To view or add a comment, sign in

More articles by Chandan S

Others also viewed

Explore content categories