The selfie is definitely one of the most prominent cultural phenomena of the 21st century. Everyone always wants his/her state perfect in that tiny square. However, even though we try our best to keep everything good when we take a selfie, there is something we can't control. For example, our blinking behavior. This natural behavior usually makes our eye closed in selfies, thus we need to take a selfie again and again, which is why we developed Beautify Your Selfie with Eye-Closeness Estimation. It is a system that aims to repair your eye_closeness of your selfiie with eye landmark detection and image fusion. Roughly speaking, it contains two marjor parts: web interface and closed-eye repair algorithmn. Users can use our web interface to upload their selfies with eye_closness and the closed-eye repair algorithmn behind the intereface would repair them after they press the repair button and our system would send them the repaired selfie by email.
Only six steps, everyone can get a pair of charming eyes in his/her selfie in seconds.
- upload three continuous selfies
- leave your email address
- press the repair button
- check your email(the system will automatically sends you the repaired selfie)
- download the repaired selfie attached in email
- done
- python == 3.7.4
- boost == 0.1
- cmake == 3.20.3
- Django == 3.2.4
- dlib == 19.22.0
- face-recognition-models == 0.3.0
- imutils == 0.5.4
- numpy == 1.16.5
- opencv-python == 4.5.2.52
- requests == 2.22.0
- Gamil API
- Dlib Python API(Someone calls it API, and someone not)
-
Clone this project to your local
$ git clone https://github.com/patty5531998/bys_sce_e_web.git $ cd bys_sce_e_web ``
-
Download shape_predictor_68_face_landmarks.dat and put it in ./
-
Enable Gmail API
- 根據Google 官方文件生成OAuth 2.0 用戶端的JSON檔
- 將自己加進API的使用者裡
- 將步驟i. 的JSON檔重新命名為credentials.json,放進./
- 生成token.pickle(需放在./)
python genToken.py
-
Fill your own email address to our_email in line34, ./app/views.py
our_email = '[email protected]'
-
Use your own email address to initialize demail in line86, ./app/views.py
demail = '[email protected]'
-
Run the local server
python manage.py runserver
-
Visit the url that the command line give you
針對使用者介面,我們使用了Django架構,以方便後續跟閉眼修復演算法做照片資料的傳輸,並且,在後續串接了GmailAPI,讓使用者能將修復完畢的照片,寄給自己或任何想傳遞的人。
針對閉眼修復演算法,我們主要的修復原理,是利用臉部和眼部偵測技術,定位出照片中每位自拍者的眼睛位置,接著,藉由計算眼睛面積大小來對每隻眼睛做閉眼狀態的分析,最後,利用這些分析結果製作成遮罩,對照片做合成,以此來修復照片中的閉眼。
以下是我們所設計的前端網頁使用者介面,以及使用者使用完此系統,所獲得的修復完畢的照片。
以下是我們閉眼修復演算法,針對不同場域拍攝的自拍照修復成效之質化與量化分析。
- Quantitative Analysis
- Qualitative Analysis
Scenes | Repair Rate(%) |
---|---|
selfie with glasses | 100 |
selfie with cap | 86.66 |
single person | 86.66 |
group people | 93.33 |
indoor selfie | 93.33 |
outdoor selfie | 93.33 |
daytime selfie | 93.33 |
night selfie | 86.66 |
https://www.pyimagesearch.com/2017/04/10/detect-eyes-nose-lips-jaw-dlib-opencv-python/
https://developers.google.com/workspace/guides/create-project