{"id":25208247,"url":"https://github.com/1010code/hands-on-face-recognition","last_synced_at":"2025-07-24T15:12:08.714Z","repository":{"id":118676316,"uuid":"319199790","full_name":"1010code/hands-on-face-recognition","owner":"1010code","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-02T04:08:13.000Z","size":4466,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T16:51:01.311Z","etag":null,"topics":["dat","face-recognition"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1010code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-07T04:05:37.000Z","updated_at":"2021-02-02T04:08:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae31773a-8b32-4a69-8daf-d9289cc084c8","html_url":"https://github.com/1010code/hands-on-face-recognition","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/1010code/hands-on-face-recognition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1010code%2Fhands-on-face-recognition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1010code%2Fhands-on-face-recognition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1010code%2Fhands-on-face-recognition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1010code%2Fhands-on-face-recognition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1010code","download_url":"https://codeload.github.com/1010code/hands-on-face-recognition/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1010code%2Fhands-on-face-recognition/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266862472,"owners_count":23996854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dat","face-recognition"],"created_at":"2025-02-10T12:19:09.862Z","updated_at":"2025-07-24T15:12:08.707Z","avatar_url":"https://github.com/1010code.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hands-on-face-recognition\n\n\n| 人臉辨識套件 (Demo 1)      |  Digital Makeup (Demo 2) |  手刻人臉辨識統 (Demo 3)                      |\n|--------------------------------------|--------------------------------------|--------------------------------------|\n| [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/1010code/hands-on-face-recognition/blob/main/Face_Recognition_using_face_recognition.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/1010code/hands-on-face-recognition/blob/main/digital_makeup.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/1010code/hands-on-face-recognition/blob/main/face_recognition.ipynb) |\n\n## 人臉辨識套件 (Demo 1)\n第一個手把手使用現成套件 [face_recognition](https://github.com/ageitgey/face_recognition) 來實作人臉辨識系統。透過此套件可以快速的將每張影像中識別人臉的關鍵點，包括`眼睛`、`鼻子`、`嘴`和`下巴`。\n\n### 建立人臉資料庫\n將所有要辨識的人物放到`image`資料夾中(一個人一張照片即可)。\n\n![](https://i.imgur.com/BmZO5GA.png)\n\n### 辨識圖片中人物\n接下來另外實際找幾張照片進行人臉辨識。[face_recognition](https://github.com/ageitgey/face_recognition) 套件呼叫  `face_encodings()` 方法會將輸入的照片進行編碼，並與 `image` 資料夾所有照片逐一比對，尋找特徵相似度最近的人作為輸出。辨識成功就會以綠框表示並顯示人名，若資料庫中尚未此人則以紅框表示。\n\n![](https://i.imgur.com/wiZZhs2.png)\n\n## Digital Makeup (Demo 2)\n我們可以透過人臉辨識偵測圖片中人物的眉毛、眼睛、嘴巴的位置。既然位置都定位得到，是否可以向美圖秀秀APP一樣將人物上妝？答案是可！\n\n![](https://i.imgur.com/y7y2ZHo.png)\n\n## 實作流程\n1. 載入圖片並使用 `face_recognition.face_landmarks()` 找出人臉的輪廓\n2. 將眉毛、眼睛、嘴巴上色\n\n大家可以試試調整 `fill=(X, X, X, X)` 來上不同顏色的妝容。\n\n![](https://i.imgur.com/WKWJLM0.png)\n\n![](https://i.imgur.com/TvPCbET.gif)\n\n## 手刻人臉辨識統 (Demo 3) \n利用預訓練好的 Dlib model，進行人臉辨識，並且實現僅用一張照片作為 database 就可以作出達到一定效果的人臉識別。在實作前需要下載以下兩個是先訓練好的參數，分別為找出68個臉部特徵點以及人臉Embedding模型。\n\n- shape_predictor_68_face_landmarks.dat\n- dlib_face_recognition_resnet_model_v1.dat\n\n![](https://i.imgur.com/CW1CH2T.png)\n\n![](https://i.imgur.com/RQcSUNm.png)\n\n### 系統架構\n\n![](https://i.imgur.com/zJZWVna.png)\n\n### 辨識流程\n\n![](https://i.imgur.com/rggAONr.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1010code%2Fhands-on-face-recognition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1010code%2Fhands-on-face-recognition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1010code%2Fhands-on-face-recognition/lists"}