Project 1 Virtual Make-up Part 1 - Feature apply lipstick
Here we
are again with another project:
Project1:
Virtual Makeup
We have
already seen interesting applications of facial features and landmarks such as
aging, beardify, face swap etc.
In this
project, you will build features for a Virtual Makeup application! Given below
are a few features
that are
required to be built in the application.
Apply
Lipstick
Apply
Blush
Apply
Eye-Liners or Eye-Lashes
Apply
Glasses
Apply
Eye Color ( Lens Color)
Apply
Hat/Cap
Apply
Ear-Rings
Change
Hair Color
Your
Task
Implement
any 2 features from the list above
The
course staff has provided a sample image. You can use your own image for
experimentation as well as come up with other interesting features. This is the
image:
This is
part 1, and the choosen feature is Apply Lipstick.
There
are several ways of do it:
We read
the image im from disk, we get a copy img2 from it, we can get the landmarks
parts of the upper lip and use the function cv2.fillPoly() with the flag fill
inside on the image img2, after that we can
get the landmarks parts of the lower lip and use the function cv2.fillPoly()
with the flag fill inside on the image img2. we will get a solid color like
this on the lips.
We can use
the function image_new =addWeigthed(im, alpha, img2, (1-alpha),0), Then the
lips get transparent as a funcion of alpha, and we get the shadows and lights
that we wanted.
I was
searching information about virtual makeup for this project, then I got this
page:
https://rsrivatsan.wordpress.com/2016/03/05/virtual-makeup/
He wrote that you can get the mean in the zone of the lips in the color
space Lab, then you add the difference between the mean and the color that you
want, this way you preserve the texture. So I decided to try it for this part
of the project.
Always try to run the program in my system:Cell 7. - First import libraries
Project1: Virtual Makeup
We have already seen interesting applications of facial features and landmarks such as aging, beardify, face swap etc.
In this project, you will build features for a Virtual Makeup application! Given below are a few features
that are required to be built in the application.
Apply Lipstick
Apply Blush
Apply Eye-Liners or Eye-Lashes
Apply Glasses
Apply Eye Color ( Lens Color)
Apply Hat/Cap
Apply Ear-Rings
Change Hair Color
Your Task
Implement any 2 features from the list above
The course staff has provided a sample image. You can use your own image for experimentation as well as come up with other interesting features. This is the image:
This is part 1, and the choosen feature is Apply Lipstick.
There are several ways of do it:
We read the image im from disk, we get a copy img2 from it, we can get the landmarks parts of the upper lip and use the function cv2.fillPoly() with the flag fill inside on the image img2, after that we can get the landmarks parts of the lower lip and use the function cv2.fillPoly() with the flag fill inside on the image img2. we will get a solid color like this on the lips.
We can use the function image_new =addWeigthed(im, alpha, img2, (1-alpha),0), Then the lips get transparent as a funcion of alpha, and we get the shadows and lights that we wanted.
I was searching information about virtual makeup for this project, then I got this page:
https://rsrivatsan.wordpress.com/2016/03/05/virtual-makeup/ He wrote that you can get the mean in the zone of the lips in the color space Lab, then you add the difference between the mean and the color that you want, this way you preserve the texture. So I decided to try it for this part of the project.
Cell 7. - First import libraries
Load landmark detector
Read Image
We load the image and convert it to RGB format so that it can be used by Dlib and also for displaying using matplotlib.
We load the image and convert it to RGB format so that it can be used by Dlib and also for displaying using matplotlib.
No hay comentarios:
Publicar un comentario