From 6ec905fb6858b1b91dc62aa0caf5106676327777 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Mon, 17 Aug 2020 11:56:48 +0300 Subject: [PATCH 01/10] dlib license --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ad80f3..06bcf20 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ You can also read a translated version of deepface tutorials in [Chinese (深臉 Reference face recognition models have different type of licenses. This framework is just a wrapper for those models. That's why, licence types are inherited as well. You should check the licenses for the face recognition models before use. -Herein, [OpenFace](https://github.com/cmusatyalab/openface/blob/master/LICENSE) is licensed under Apache License 2.0. [FB DeepFace](https://github.com/swghosh/DeepFace) and [Facenet](https://github.com/davidsandberg/facenet/blob/master/LICENSE.md) is licensed under MIT License. The both Apache License 2.0 and MIT license types allow you to use for commercial purpose. +Herein, [OpenFace](https://github.com/cmusatyalab/openface/blob/master/LICENSE) is licensed under Apache License 2.0. [FB DeepFace](https://github.com/swghosh/DeepFace) and [Facenet](https://github.com/davidsandberg/facenet/blob/master/LICENSE.md) is licensed under MIT License. [Dlib](https://github.com/davisking/dlib/blob/master/dlib/LICENSE.txt) is licensed under Boost Software License. They all allow you to use for commercial purpose. On the other hand, [VGG-Face](http://www.robots.ox.ac.uk/~vgg/software/vgg_face/) is licensed under Creative Commons Attribution License. That's why, it is restricted to adopt VGG-Face for commercial use. From fffb087baab22354475915eb8b612fce8e1c6c0a Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Mon, 17 Aug 2020 11:57:34 +0300 Subject: [PATCH 02/10] personal usage --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06bcf20..0d768d4 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ You can also read a translated version of deepface tutorials in [Chinese (深臉 Reference face recognition models have different type of licenses. This framework is just a wrapper for those models. That's why, licence types are inherited as well. You should check the licenses for the face recognition models before use. -Herein, [OpenFace](https://github.com/cmusatyalab/openface/blob/master/LICENSE) is licensed under Apache License 2.0. [FB DeepFace](https://github.com/swghosh/DeepFace) and [Facenet](https://github.com/davidsandberg/facenet/blob/master/LICENSE.md) is licensed under MIT License. [Dlib](https://github.com/davisking/dlib/blob/master/dlib/LICENSE.txt) is licensed under Boost Software License. They all allow you to use for commercial purpose. +Herein, [OpenFace](https://github.com/cmusatyalab/openface/blob/master/LICENSE) is licensed under Apache License 2.0. [FB DeepFace](https://github.com/swghosh/DeepFace) and [Facenet](https://github.com/davidsandberg/facenet/blob/master/LICENSE.md) is licensed under MIT License. [Dlib](https://github.com/davisking/dlib/blob/master/dlib/LICENSE.txt) is licensed under Boost Software License. They all allow you to use for personal and commercial purpose free. On the other hand, [VGG-Face](http://www.robots.ox.ac.uk/~vgg/software/vgg_face/) is licensed under Creative Commons Attribution License. That's why, it is restricted to adopt VGG-Face for commercial use. From 03b250f3e5f5b61c87447f6b9bdb53e3b5298e62 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Tue, 18 Aug 2020 11:48:31 +0300 Subject: [PATCH 03/10] dlib overperforms --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d768d4..d66342a 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ for model in models: result = DeepFace.verify("img1.jpg", "img2.jpg", model_name = model) ``` -FaceNet and VGG-Face [overperforms](https://youtu.be/i_MOwvhbLdI) than OpenFace, DeepFace and DeepID based on experiments. +FaceNet, VGG-Face and Dlib [overperforms](https://youtu.be/i_MOwvhbLdI) than OpenFace, DeepFace and DeepID based on experiments. **Similarity** From c72781a27056a15f1cffaa42fda52184ee6344ff Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Tue, 18 Aug 2020 15:16:21 +0300 Subject: [PATCH 04/10] state-of-the-art models in intro --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d66342a..ec606ee 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

-**deepface** is a lightweight [face recognition](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) and facial attribute analysis ([age](https://sefiks.com/2019/02/13/apparent-age-and-gender-prediction-in-keras/), [gender](https://sefiks.com/2019/02/13/apparent-age-and-gender-prediction-in-keras/), [emotion](https://sefiks.com/2018/01/01/facial-expression-recognition-with-keras/) and [race](https://sefiks.com/2019/11/11/race-and-ethnicity-prediction-in-keras/)) framework for python. You can apply facial analysis with just a few lines of code. It plans to bridge a gap between software engineering and machine learning studies. +**deepface** is a lightweight [face recognition](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) and facial attribute analysis ([age](https://sefiks.com/2019/02/13/apparent-age-and-gender-prediction-in-keras/), [gender](https://sefiks.com/2019/02/13/apparent-age-and-gender-prediction-in-keras/), [emotion](https://sefiks.com/2018/01/01/facial-expression-recognition-with-keras/) and [race](https://sefiks.com/2019/11/11/race-and-ethnicity-prediction-in-keras/)) framework for python. It is a hybrid face recognition framework wrapping **state-of-the-art** models: [`VGG-Face`](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) , [`Google FaceNet`](https://sefiks.com/2018/09/03/face-recognition-with-facenet-in-keras/), [`OpenFace`](https://sefiks.com/2019/07/21/face-recognition-with-openface-in-keras/), [`Facebook DeepFace`](https://sefiks.com/2020/02/17/face-recognition-with-facebook-deepface-in-keras/), [`DeepID`](https://sefiks.com/2020/06/16/face-recognition-with-deepid-in-keras/) and [`Dlib`](https://sefiks.com/2020/07/11/face-recognition-with-dlib-in-python/). ## Installation From 25c066fa674c585cbf8c1f16eca01c4b6902c467 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Wed, 19 Aug 2020 12:06:05 +0300 Subject: [PATCH 05/10] license badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ec606ee..192c5f4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # deepface [![Downloads](https://pepy.tech/badge/deepface)](https://pepy.tech/project/deepface) +[![License](http://img.shields.io/:license-mit-blue.svg?style=flat)](https://github.com/serengil/deepface/blob/master/LICENSE)

From d572b8808341be530df583a191c88589fcd4c170 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Wed, 19 Aug 2020 12:21:33 +0300 Subject: [PATCH 06/10] license badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 192c5f4..926d5b6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # deepface [![Downloads](https://pepy.tech/badge/deepface)](https://pepy.tech/project/deepface) -[![License](http://img.shields.io/:license-mit-blue.svg?style=flat)](https://github.com/serengil/deepface/blob/master/LICENSE) +[![License](http://img.shields.io/:license-MIT-blue.svg?style=flat)](https://github.com/serengil/deepface/blob/master/LICENSE)

From 0c539563601d562ac9f5184ffc318a213aa2b6fd Mon Sep 17 00:00:00 2001 From: Pradeep Date: Wed, 26 Aug 2020 12:14:39 +0100 Subject: [PATCH 07/10] Provide the ability to override the default gdrive model weights --- deepface/basemodels/DeepID.py | 3 +-- deepface/basemodels/Facenet.py | 3 +-- deepface/basemodels/FbDeepFace.py | 4 +--- deepface/basemodels/OpenFace.py | 3 +-- deepface/basemodels/VGGFace.py | 5 ++--- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/deepface/basemodels/DeepID.py b/deepface/basemodels/DeepID.py index c31bb0e..30f67c1 100644 --- a/deepface/basemodels/DeepID.py +++ b/deepface/basemodels/DeepID.py @@ -8,7 +8,7 @@ import zipfile #------------------------------------- -def loadModel(): +def loadModel(url = 'https://drive.google.com/uc?id=1uRLtBCTQQAvHJ_KVrdbRJiCKxU8m5q2J'): myInput = Input(shape=(55, 47, 3)) @@ -43,7 +43,6 @@ def loadModel(): if os.path.isfile(home+'/.deepface/weights/deepid_keras_weights.h5') != True: print("deepid_keras_weights.h5 will be downloaded...") - url = 'https://drive.google.com/uc?id=1uRLtBCTQQAvHJ_KVrdbRJiCKxU8m5q2J' output = home+'/.deepface/weights/deepid_keras_weights.h5' gdown.download(url, output, quiet=False) diff --git a/deepface/basemodels/Facenet.py b/deepface/basemodels/Facenet.py index 8222191..7a63502 100644 --- a/deepface/basemodels/Facenet.py +++ b/deepface/basemodels/Facenet.py @@ -530,7 +530,7 @@ def InceptionResNetV2(): return model -def loadModel(): +def loadModel(url = 'https://drive.google.com/uc?id=1971Xk5RwedbudGgTIrGAL4F7Aifu7id1'): model = InceptionResNetV2() #----------------------------------- @@ -540,7 +540,6 @@ def loadModel(): if os.path.isfile(home+'/.deepface/weights/facenet_weights.h5') != True: print("facenet_weights.h5 will be downloaded...") - url = 'https://drive.google.com/uc?id=1971Xk5RwedbudGgTIrGAL4F7Aifu7id1' output = home+'/.deepface/weights/facenet_weights.h5' gdown.download(url, output, quiet=False) diff --git a/deepface/basemodels/FbDeepFace.py b/deepface/basemodels/FbDeepFace.py index 98c0485..6d130da 100644 --- a/deepface/basemodels/FbDeepFace.py +++ b/deepface/basemodels/FbDeepFace.py @@ -8,7 +8,7 @@ import zipfile #------------------------------------- -def loadModel(): +def loadModel(url = 'https://github.com/swghosh/DeepFace/releases/download/weights-vggface2-2d-aligned/VGGFace2_DeepFace_weights_val-0.9034.h5.zip'): base_model = Sequential() base_model.add(Convolution2D(32, (11, 11), activation='relu', name='C1', input_shape=(152, 152, 3))) base_model.add(MaxPooling2D(pool_size=3, strides=2, padding='same', name='M2')) @@ -28,8 +28,6 @@ def loadModel(): if os.path.isfile(home+'/.deepface/weights/VGGFace2_DeepFace_weights_val-0.9034.h5') != True: print("VGGFace2_DeepFace_weights_val-0.9034.h5 will be downloaded...") - url = 'https://github.com/swghosh/DeepFace/releases/download/weights-vggface2-2d-aligned/VGGFace2_DeepFace_weights_val-0.9034.h5.zip' - output = home+'/.deepface/weights/VGGFace2_DeepFace_weights_val-0.9034.h5.zip' gdown.download(url, output, quiet=False) diff --git a/deepface/basemodels/OpenFace.py b/deepface/basemodels/OpenFace.py index c2f3e71..82a4af9 100644 --- a/deepface/basemodels/OpenFace.py +++ b/deepface/basemodels/OpenFace.py @@ -15,7 +15,7 @@ from keras import backend as K #--------------------------------------- -def loadModel(): +def loadModel(url = 'https://drive.google.com/uc?id=1LSe1YCV1x-BfNnfb7DFZTNpv_Q9jITxn'): myInput = Input(shape=(96, 96, 3)) x = ZeroPadding2D(padding=(3, 3), input_shape=(96, 96, 3))(myInput) @@ -237,7 +237,6 @@ def loadModel(): if os.path.isfile(home+'/.deepface/weights/openface_weights.h5') != True: print("openface_weights.h5 will be downloaded...") - url = 'https://drive.google.com/uc?id=1LSe1YCV1x-BfNnfb7DFZTNpv_Q9jITxn' output = home+'/.deepface/weights/openface_weights.h5' gdown.download(url, output, quiet=False) diff --git a/deepface/basemodels/VGGFace.py b/deepface/basemodels/VGGFace.py index f354526..48d8495 100644 --- a/deepface/basemodels/VGGFace.py +++ b/deepface/basemodels/VGGFace.py @@ -54,7 +54,7 @@ def baseModel(): return model -def loadModel(): +def loadModel(url = 'https://drive.google.com/uc?id=1CPSeum3HpopfomUEK1gybeuIVoeJT_Eo'): model = baseModel() @@ -63,9 +63,8 @@ def loadModel(): home = str(Path.home()) if os.path.isfile(home+'/.deepface/weights/vgg_face_weights.h5') != True: - print("vgg_face_weights.h5 will be downloaded...") + print("vgg_face_weights.h5 will be downloaded...") - url = 'https://drive.google.com/uc?id=1CPSeum3HpopfomUEK1gybeuIVoeJT_Eo' output = home+'/.deepface/weights/vgg_face_weights.h5' gdown.download(url, output, quiet=False) From a2df129426e286516dce63a0a780243fbd4e4e7b Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Sun, 30 Aug 2020 18:13:27 +0300 Subject: [PATCH 08/10] face detection link changed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 926d5b6..6068934 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ pip install deepface ## Face Recognition -A modern [**face recognition pipeline**](https://sefiks.com/2020/05/01/a-gentle-introduction-to-face-recognition-in-deep-learning/) consists of 4 common stages: [detect](https://sefiks.com/2020/02/23/face-alignment-for-face-recognition-in-python-within-opencv/), [align](https://sefiks.com/2020/02/23/face-alignment-for-face-recognition-in-python-within-opencv/), [represent](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) and [verify](https://sefiks.com/2020/05/22/fine-tuning-the-threshold-in-face-recognition/). **DeepFace** handles all these common stages in the background. +A modern [**face recognition pipeline**](https://sefiks.com/2020/05/01/a-gentle-introduction-to-face-recognition-in-deep-learning/) consists of 4 common stages: [detect](https://sefiks.com/2020/08/25/deep-face-detection-with-opencv-in-python/), [align](https://sefiks.com/2020/02/23/face-alignment-for-face-recognition-in-python-within-opencv/), [represent](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) and [verify](https://sefiks.com/2020/05/22/fine-tuning-the-threshold-in-face-recognition/). **DeepFace** handles all these common stages in the background. **Face Verification** - [`Demo`](https://youtu.be/KRCvkNCOphE) From 93196266d4d9e433cd1326aaeaf3791b29d28b36 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Sun, 30 Aug 2020 18:18:09 +0300 Subject: [PATCH 09/10] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6068934..6e98aae 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ pip install deepface ## Face Recognition -A modern [**face recognition pipeline**](https://sefiks.com/2020/05/01/a-gentle-introduction-to-face-recognition-in-deep-learning/) consists of 4 common stages: [detect](https://sefiks.com/2020/08/25/deep-face-detection-with-opencv-in-python/), [align](https://sefiks.com/2020/02/23/face-alignment-for-face-recognition-in-python-within-opencv/), [represent](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) and [verify](https://sefiks.com/2020/05/22/fine-tuning-the-threshold-in-face-recognition/). **DeepFace** handles all these common stages in the background. +A modern [**face recognition pipeline**](https://sefiks.com/2020/05/01/a-gentle-introduction-to-face-recognition-in-deep-learning/) consists of 4 common stages: [detect](https://sefiks.com/2020/08/25/deep-face-detection-with-opencv-in-python/), [align](https://sefiks.com/2020/02/23/face-alignment-for-face-recognition-in-python-within-opencv/), [represent](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) and [verify](https://sefiks.com/2020/05/22/fine-tuning-the-threshold-in-face-recognition/). **deepface** handles all these common stages in the background. **Face Verification** - [`Demo`](https://youtu.be/KRCvkNCOphE) From 54d3dce37d52a7bba603b0f285b196766126c650 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Tue, 1 Sep 2020 14:09:42 +0300 Subject: [PATCH 10/10] Face recognition models link added --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e98aae..7ab671f 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ df = DeepFace.find(img_path = "img1.jpg", db_path = "C:/workspace/my_db")

-**Face recognition models** +**Face recognition models** - [`Demo`](https://youtu.be/i_MOwvhbLdI) Deepface is a hybrid face recognition package. It currently wraps the **state-of-the-art** face recognition models: [`VGG-Face`](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) , [`Google FaceNet`](https://sefiks.com/2018/09/03/face-recognition-with-facenet-in-keras/), [`OpenFace`](https://sefiks.com/2019/07/21/face-recognition-with-openface-in-keras/), [`Facebook DeepFace`](https://sefiks.com/2020/02/17/face-recognition-with-facebook-deepface-in-keras/), [`DeepID`](https://sefiks.com/2020/06/16/face-recognition-with-deepid-in-keras/) and [`Dlib`](https://sefiks.com/2020/07/11/face-recognition-with-dlib-in-python/). The default configuration verifies faces with **VGG-Face** model. You can set the base model while verification as illustared below.