Skip to content

Latest commit

 

History

History
75 lines (56 loc) · 2.44 KB

README.md

File metadata and controls

75 lines (56 loc) · 2.44 KB

Introduction

In this pet project, I use dlib to predict facial landmarks, then extract eyes from face and finally make transform the eyes into special eyes in Naruto anime.

Installation

git clone https://github.com/baoanh1310/sharingan.git
cd sharingan
sudo apt-get update
sudo apt-get install build-essential cmake
sudo apt-get install libopenblas-dev liblapack-dev 
sudo apt-get install libx11-dev libgtk-3-dev
sudo apt-get install python python-dev python-pip
sudo apt-get install python3 python3-dev python3-pip
mkvirtualenv sharingan -p python3
workon sharingan
pip install -r requirements.txt

How to run?

1. If you want to predict facial landmarks from input image

python facial_landmarks.py --shape-predictor shape_predictor_68_face_landmarks.dat --image images/sample.jpg

2. If you want to predict facial landmark in real-time video stream

python facial_landmarks_stream.py --shape-predictor shape_predictor_68_face_landmarks.dat

3. If you want to extract face parts from input image

python extract_parts.py --shape-predictor shape_predictor_68_face_landmarks.dat --image images/elon.jpg

4. If you want to count your eye blink in real-time video stream

python eye_blink_detect.py --shape-predictor shape_predictor_68_face_landmarks.dat

5. If you want to try glasses filter on input image

python glasses_effect.py --shape-predictor shape_predictor_68_face_landmarks.dat --image images/elon.jpg --glass images/glasses.png

6. If you want to try glasses filter on video stream

python glasses_stream.py --shape-predictor shape_predictor_68_face_landmarks.dat --glass images/glasses.png

7. If you want to try sharingan filter on input image

python sharingan.py --shape-predictor shape_predictor_68_face_landmarks.dat --image images/elon.jpg --eye images/sharingan.png

8. If you want to try sharingan filter on video stream

python sharingan_stream.py --shape-predictor shape_predictor_68_face_landmarks.dat --eye images/sharingan.png

References

1. Dlib

I use this library to detect face, facial landmarks and extract face parts.

2. Papers

If you really want to know the details in the libraries or functions in my code, I recommend you read the following papers: