diff --git a/README.md b/README.md index 97b150c..91a73be 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ df = DeepFace.find(img_path = "img1.jpg", db_path = "C:/workspace/my_db") Deepface is a **hybrid** face recognition package. It currently wraps many **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/), [`ArcFace`](https://sefiks.com/2020/12/14/deep-face-recognition-with-arcface-in-keras-and-python/) and [`Dlib`](https://sefiks.com/2020/07/11/face-recognition-with-dlib-in-python/). The default configuration uses VGG-Face model. ```python -models = ["VGG-Face", "Facenet", "Facenet512", "OpenFace", "DeepFace", "DeepID", "ArcFace", "Dlib"] +models = ["VGG-Face", "Facenet", "Facenet512", "OpenFace", "DeepFace", "DeepID", "ArcFace", "Dlib", "SFace"] #face verification result = DeepFace.verify(img1_path = "img1.jpg", img2_path = "img2.jpg", model_name = models[1]) @@ -187,6 +187,15 @@ python api.py Face recognition, facial attribute analysis and vector representation functions are covered in the API. You are expected to call these functions as http post methods. Service endpoints will be `http://127.0.0.1:5000/verify` for face recognition, `http://127.0.0.1:5000/analyze` for facial attribute analysis, and `http://127.0.0.1:5000/represent` for vector representation. You should pass input images as base64 encoded string in this case. [Here](https://github.com/serengil/deepface/tree/master/api), you can find a postman project. +**Command Line Interface** + +DeepFace comes with a command line interface as well. You are able to access its functions in command line in the command line as shown below. It expects the function name as 1st argument and functions arguments respectively. + +```shell +deepface verify -img1_path tests/dataset/img1.jpg -img2_path tests/dataset/img2.jpg +deepface analyze -img_path tests/dataset/img1.jpg +``` + **Tech Stack** - [`Vlog`](https://youtu.be/R8fHsL7u3eE), [`Tutorial`](https://sefiks.com/2021/03/31/tech-stack-recommendations-for-face-recognition/) Face recognition models represent facial images as vector embeddings. The idea behind facial recognition is that vectors should be more similar for same person than different persons. The question is that where and how to store facial embeddings in a large scale system. Herein, deepface offers a represention function to find vector embeddings from facial images. diff --git a/deepface/DeepFace.py b/deepface/DeepFace.py index 13f870e..07ed3a1 100644 --- a/deepface/DeepFace.py +++ b/deepface/DeepFace.py @@ -13,7 +13,7 @@ from tqdm import tqdm import pickle import fire -from deepface.basemodels import VGGFace, OpenFace, Facenet, Facenet512, FbDeepFace, DeepID, DlibWrapper, ArcFace, Boosting, sface_opencv_wrapper +from deepface.basemodels import VGGFace, OpenFace, Facenet, Facenet512, FbDeepFace, DeepID, DlibWrapper, ArcFace, Boosting, SFaceWrapper from deepface.extendedmodels import Age, Gender, Race, Emotion from deepface.commons import functions, realtime, distance as dst @@ -47,7 +47,7 @@ def build_model(model_name): 'DeepID': DeepID.loadModel, 'Dlib': DlibWrapper.loadModel, 'ArcFace': ArcFace.loadModel, - 'SFace': sface_opencv_wrapper.load_model, + 'SFace': SFaceWrapper.load_model, 'Emotion': Emotion.loadModel, 'Age': Age.loadModel, 'Gender': Gender.loadModel, diff --git a/deepface/basemodels/sface_opencv_wrapper.py b/deepface/basemodels/SFaceWrapper.py similarity index 100% rename from deepface/basemodels/sface_opencv_wrapper.py rename to deepface/basemodels/SFaceWrapper.py diff --git a/requirements.txt b/requirements.txt index 1ca6168..064c5e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ pandas>=0.23.4 gdown>=3.10.1 tqdm>=4.30.0 Pillow>=5.2.0 -opencv-python>=4.5.0.34 +opencv-python>=4.5.5.64 opencv-contrib-python>=4.3.0.36 tensorflow>=1.9.0 keras>=2.2.0 diff --git a/setup.py b/setup.py index df16773..be605b4 100644 --- a/setup.py +++ b/setup.py @@ -24,5 +24,5 @@ setuptools.setup( ["deepface = deepface.DeepFace:cli"], }, python_requires='>=3.5.5', - install_requires=["numpy>=1.14.0", "pandas>=0.23.4", "tqdm>=4.30.0", "gdown>=3.10.1", "Pillow>=5.2.0", "opencv-python>=3.4.4", "tensorflow>=1.9.0", "keras>=2.2.0", "Flask>=1.1.2", "mtcnn>=0.1.0", "retina-face>=0.0.1", "fire>=0.4.0"] + install_requires=["numpy>=1.14.0", "pandas>=0.23.4", "tqdm>=4.30.0", "gdown>=3.10.1", "Pillow>=5.2.0", "opencv-python>=4.5.5.64", "tensorflow>=1.9.0", "keras>=2.2.0", "Flask>=1.1.2", "mtcnn>=0.1.0", "retina-face>=0.0.1", "fire>=0.4.0"] )