# Face-Recognition-using-FaceNet
This face recognition system is implemented upon a pre-trained FaceNet model achieving a state-of-the-art accuracy.
The system comes with
both Live recognition & Image recognition.
It is trained on faces of some celebrities.
For any queries Contact: [Ankur Goswami](https://github.com/Ankur1401/)
* __Installing dependencies:__
* For Anaconda users: `conda install --file requirements.txt`<br>
* For python users: `pip install -r requirements.txt`<br>
(even Anaconda users can use this if they use anaconda prompt instead of terminal)
* __Downloading the model__:<br>
The repository requires an additional file to work. The file is too large to upload here.
So I've provided a Google Drive link of it. Download the file and keep it inside [`/data/model/`](https://github.com/Ankur1401/Face-Recognition-using-FaceNet/tree/master/data/model) directory.<br> [Click Here](https://drive.google.com/open?id=1PZ_6Zsy1Vb0s0JmjEmVd8FS99zoMCiN1) to download the file.
* __Training on other faces:__ <br>
To train model on different faces, follow the given steps:<br>
1. Put the images containing clear frontal face in [`/data/images/`](https://github.com/Ankur1401/Face-Recognition-using-FaceNet/tree/master/data/images) directory.
1. Open the repository directory in terminal and run following commands in given order:
1. `cd script`
1. `python generate_data.py`
1. Follow program instructions.
* __Testing/Detecting faces:__ <br>
1. __Face Recognition from Images__:
1. Put the images containing the faces to predict in [`/test/`](https://github.com/Ankur1401/Face-Recognition-using-FaceNet/tree/master/test) directory.
1. Open the repository directory in terminal and run following command:
```
python image_recognition.py
```
1. Output images will then be available in [`/test/predicted/`](https://github.com/Ankur1401/Face-Recognition-using-FaceNet/tree/master/test/predicted) directory.
1. __Live Face Recognition(Obviously using camera):__
<br>Open the repository directory in terminal and run following command:
```
python live_recognition.py
```
## Examples:
__NOTE:__ Faces with __Unidentified__ labels are faces on which the model is not trained.
__Example #1:__
<br>Before:<br>
<img src=https://github.com/Ankur1401/Face-Recognition-using-FaceNet/blob/master/test/vampire-diaries.jpg width=50%>
<br>After:<br>
<img src=https://github.com/Ankur1401/Face-Recognition-using-FaceNet/blob/master/test/predicted/vampire-diaries.jpg width=50%>
__Example #2:__
<br>Before:<br>
<img src=https://github.com/Ankur1401/Face-Recognition-using-FaceNet/blob/master/test/the-avengers-walt03.jpg width=50%>
<br>After:<br>
<img src=https://github.com/Ankur1401/Face-Recognition-using-FaceNet/blob/master/test/predicted/the-avengers-walt03.jpg width=50%>
__Example #3:__
<br>Before:<br>
<img src=https://github.com/Ankur1401/Face-Recognition-using-FaceNet/blob/master/test/2ec945ecd5f7c08789f3ef5da5287410.jpg width=50%>
<br>After:<br>
<img src=https://github.com/Ankur1401/Face-Recognition-using-FaceNet/blob/master/test/predicted/2ec945ecd5f7c08789f3ef5da5287410.jpg width=50%>
__Example #4:__
<br>Before:<br>
<img src=https://github.com/Ankur1401/Face-Recognition-using-FaceNet/blob/master/test/3840x2160-avengers-cast-photocall-moscow-05.JPG width=75%>
<br>After:(Need to zoom)<br>
<img src=https://github.com/Ankur1401/Face-Recognition-using-FaceNet/blob/master/test/predicted/3840x2160-avengers-cast-photocall-moscow-05.JPG width=75%>
__Example #5:__
<br>In this example, the model was trained on faces of my friends.
<br>Before:<br>
<img src=https://github.com/Ankur1401/Face-Recognition-using-FaceNet/blob/master/test/00000PORTRAIT_00000_BURST20180310144236486.jpg width=75%>
<br>After:<br>
<img src=https://github.com/Ankur1401/Face-Recognition-using-FaceNet/blob/master/test/predicted/00000PORTRAIT_00000_BURST20180310144236486.jpg width=75%>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Face-Recognition-using-FaceNet-master.zip (44个子文件)
Face-Recognition-using-FaceNet-master
data
arrays
vars.npz 520B
embeddings.npz 6KB
font
Calibri Regular.ttf 344KB
faces
Jeremy Renner.jpg 44KB
Joseph Morgan.jpg 90KB
Tom Holland.jpg 30KB
Kit Harington.jpg 165KB
Chris Hemsworth.jpg 11KB
Scarlett Johansson .jpg 39KB
Robert Downey Jr..jpg 77KB
Nathaniel Buzolic.jpg 24KB
Hugh Jackman.jpg 54KB
Mark Ruffalo.jpg 43KB
Ian Somerhalder.jpg 520KB
model
dummy file.txt 47B
images
Jeremy Renner.jpg 101KB
Joseph Morgan.jpg 99KB
Tom Holland.jpg 57KB
Kit Harington.jpg 240KB
Chris Hemsworth.jpg 78KB
Scarlett Johansson .jpg 78KB
Robert Downey Jr..jpg 58KB
Nathaniel Buzolic.jpg 53KB
Hugh Jackman.jpg 85KB
Mark Ruffalo.jpg 54KB
Ian Somerhalder.jpg 838KB
cascade
haarcascade_frontalface_default.xml 1.2MB
image_recognition.py 3KB
requirements.txt 150B
test
2ec945ecd5f7c08789f3ef5da5287410.jpg 93KB
3840x2160-avengers-cast-photocall-moscow-05.JPG 679KB
predicted
2ec945ecd5f7c08789f3ef5da5287410.jpg 97KB
3840x2160-avengers-cast-photocall-moscow-05.JPG 385KB
the-avengers-walt03.jpg 223KB
vampire-diaries.jpg 52KB
00000PORTRAIT_00000_BURST20180310144236486.jpg 681KB
the-avengers-walt03.jpg 311KB
vampire-diaries.jpg 259KB
00000PORTRAIT_00000_BURST20180310144236486.jpg 1.57MB
script
generate_data.py 2KB
fx.py 668B
detect_faces.py 831B
live_recognition.py 3KB
README.md 4KB
共 44 条
- 1
资源评论
sjx_alo
- 粉丝: 1w+
- 资源: 1193
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功