The world's simplest facial recognition api for Python and the command line

Overview

Face Recognition

You can also read a translated version of this file in Chinese 简体中文版 or in Korean 한국어 or in Japanese 日本語.

Recognize and manipulate faces from Python or from the command line with the world's simplest face recognition library.

Built using dlib's state-of-the-art face recognition built with deep learning. The model has an accuracy of 99.38% on the Labeled Faces in the Wild benchmark.

This also provides a simple face_recognition command line tool that lets you do face recognition on a folder of images from the command line!

PyPI Build Status Documentation Status

Features

Find faces in pictures

Find all the faces that appear in a picture:

import face_recognition
image = face_recognition.load_image_file("your_file.jpg")
face_locations = face_recognition.face_locations(image)

Find and manipulate facial features in pictures

Get the locations and outlines of each person's eyes, nose, mouth and chin.

import face_recognition
image = face_recognition.load_image_file("your_file.jpg")
face_landmarks_list = face_recognition.face_landmarks(image)

Finding facial features is super useful for lots of important stuff. But you can also use it for really stupid stuff like applying digital make-up (think 'Meitu'):

Identify faces in pictures

Recognize who appears in each photo.

import face_recognition
known_image = face_recognition.load_image_file("biden.jpg")
unknown_image = face_recognition.load_image_file("unknown.jpg")

biden_encoding = face_recognition.face_encodings(known_image)[0]
unknown_encoding = face_recognition.face_encodings(unknown_image)[0]

results = face_recognition.compare_faces([biden_encoding], unknown_encoding)

You can even use this library with other Python libraries to do real-time face recognition:

See this example for the code.

Online Demos

User-contributed shared Jupyter notebook demo (not officially supported): Deepnote

Installation

Requirements

  • Python 3.3+ or Python 2.7
  • macOS or Linux (Windows not officially supported, but might work)

Installation Options:

Installing on Mac or Linux

First, make sure you have dlib already installed with Python bindings:

Then, make sure you have cmake installed:

brew install cmake

Finally, install this module from pypi using pip3 (or pip2 for Python 2):

pip3 install face_recognition

Alternatively, you can try this library with Docker, see this section.

If you are having trouble with installation, you can also try out a pre-configured VM.

Installing on an Nvidia Jetson Nano board

  • Jetson Nano installation instructions
    • Please follow the instructions in the article carefully. There is current a bug in the CUDA libraries on the Jetson Nano that will cause this library to fail silently if you don't follow the instructions in the article to comment out a line in dlib and recompile it.

Installing on Raspberry Pi 2+

Installing on FreeBSD

pkg install graphics/py-face_recognition

Installing on Windows

While Windows isn't officially supported, helpful users have posted instructions on how to install this library:

Installing a pre-configured Virtual Machine image

Usage

Command-Line Interface

When you install face_recognition, you get two simple command-line programs:

  • face_recognition - Recognize faces in a photograph or folder full for photographs.
  • face_detection - Find faces in a photograph or folder full for photographs.

face_recognition command line tool

The face_recognition command lets you recognize faces in a photograph or folder full for photographs.

First, you need to provide a folder with one picture of each person you already know. There should be one image file for each person with the files named according to who is in the picture:

known

Next, you need a second folder with the files you want to identify:

unknown

Then in you simply run the command face_recognition, passing in the folder of known people and the folder (or single image) with unknown people and it tells you who is in each image:

$ face_recognition ./pictures_of_people_i_know/ ./unknown_pictures/

/unknown_pictures/unknown.jpg,Barack Obama
/face_recognition_test/unknown_pictures/unknown.jpg,unknown_person

There's one line in the output for each face. The data is comma-separated with the filename and the name of the person found.

An unknown_person is a face in the image that didn't match anyone in your folder of known people.

face_detection command line tool

The face_detection command lets you find the location (pixel coordinatates) of any faces in an image.

Just run the command face_detection, passing in a folder of images to check (or a single image):

$ face_detection  ./folder_with_pictures/

examples/image1.jpg,65,215,169,112
examples/image2.jpg,62,394,211,244
examples/image2.jpg,95,941,244,792

It prints one line for each face that was detected. The coordinates reported are the top, right, bottom and left coordinates of the face (in pixels).

Adjusting Tolerance / Sensitivity

If you are getting multiple matches for the same person, it might be that the people in your photos look very similar and a lower tolerance value is needed to make face comparisons more strict.

You can do that with the --tolerance parameter. The default tolerance value is 0.6 and lower numbers make face comparisons more strict:

$ face_recognition --tolerance 0.54 ./pictures_of_people_i_know/ ./unknown_pictures/

/unknown_pictures/unknown.jpg,Barack Obama
/face_recognition_test/unknown_pictures/unknown.jpg,unknown_person

If you want to see the face distance calculated for each match in order to adjust the tolerance setting, you can use --show-distance true:

$ face_recognition --show-distance true ./pictures_of_people_i_know/ ./unknown_pictures/

/unknown_pictures/unknown.jpg,Barack Obama,0.378542298956785
/face_recognition_test/unknown_pictures/unknown.jpg,unknown_person,None
More Examples

If you simply want to know the names of the people in each photograph but don't care about file names, you could do this:

$ face_recognition ./pictures_of_people_i_know/ ./unknown_pictures/ | cut -d ',' -f2

Barack Obama
unknown_person
Speeding up Face Recognition

Face recognition can be done in parallel if you have a computer with multiple CPU cores. For example, if your system has 4 CPU cores, you can process about 4 times as many images in the same amount of time by using all your CPU cores in parallel.

If you are using Python 3.4 or newer, pass in a --cpus <number_of_cpu_cores_to_use> parameter:

$ face_recognition --cpus 4 ./pictures_of_people_i_know/ ./unknown_pictures/

You can also pass in --cpus -1 to use all CPU cores in your system.

Python Module

You can import the face_recognition module and then easily manipulate faces with just a couple of lines of code. It's super easy!

API Docs: https://face-recognition.readthedocs.io.

Automatically find all the faces in an image
import face_recognition

image = face_recognition.load_image_file("my_picture.jpg")
face_locations = face_recognition.face_locations(image)

# face_locations is now an array listing the co-ordinates of each face!

See this example to try it out.

You can also opt-in to a somewhat more accurate deep-learning-based face detection model.

Note: GPU acceleration (via NVidia's CUDA library) is required for good performance with this model. You'll also want to enable CUDA support when compliling dlib.

import face_recognition

image = face_recognition.load_image_file("my_picture.jpg")
face_locations = face_recognition.face_locations(image, model="cnn")

# face_locations is now an array listing the co-ordinates of each face!

See this example to try it out.

If you have a lot of images and a GPU, you can also find faces in batches.

Automatically locate the facial features of a person in an image
import face_recognition

image = face_recognition.load_image_file("my_picture.jpg")
face_landmarks_list = face_recognition.face_landmarks(image)

# face_landmarks_list is now an array with the locations of each facial feature in each face.
# face_landmarks_list[0]['left_eye'] would be the location and outline of the first person's left eye.

See this example to try it out.

Recognize faces in images and identify who they are
import face_recognition

picture_of_me = face_recognition.load_image_file("me.jpg")
my_face_encoding = face_recognition.face_encodings(picture_of_me)[0]

# my_face_encoding now contains a universal 'encoding' of my facial features that can be compared to any other picture of a face!

unknown_picture = face_recognition.load_image_file("unknown.jpg")
unknown_face_encoding = face_recognition.face_encodings(unknown_picture)[0]

# Now we can see the two face encodings are of the same person with `compare_faces`!

results = face_recognition.compare_faces([my_face_encoding], unknown_face_encoding)

if results[0] == True:
    print("It's a picture of me!")
else:
    print("It's not a picture of me!")

See this example to try it out.

Python Code Examples

All the examples are available here.

Face Detection

Facial Features

Facial Recognition

Creating a Standalone Executable

If you want to create a standalone executable that can run without the need to install python or face_recognition, you can use PyInstaller. However, it requires some custom configuration to work with this library. See this issue for how to do it.

Articles and Guides that cover face_recognition

How Face Recognition Works

If you want to learn how face location and recognition work instead of depending on a black box library, read my article.

Caveats

  • The face recognition model is trained on adults and does not work very well on children. It tends to mix up children quite easy using the default comparison threshold of 0.6.
  • Accuracy may vary between ethnic groups. Please see this wiki page for more details.

Deployment to Cloud Hosts (Heroku, AWS, etc)

Since face_recognition depends on dlib which is written in C++, it can be tricky to deploy an app using it to a cloud hosting provider like Heroku or AWS.

To make things easier, there's an example Dockerfile in this repo that shows how to run an app built with face_recognition in a Docker container. With that, you should be able to deploy to any service that supports Docker images.

You can try the Docker image locally by running: docker-compose up --build

Linux users with a GPU (drivers >= 384.81) and Nvidia-Docker installed can run the example on the GPU: Open the docker-compose.yml file and uncomment the dockerfile: Dockerfile.gpu and runtime: nvidia lines.

Having problems?

If you run into problems, please read the Common Errors section of the wiki before filing a github issue.

Thanks

  • Many, many thanks to Davis King (@nulhom) for creating dlib and for providing the trained facial feature detection and face encoding models used in this library. For more information on the ResNet that powers the face encodings, check out his blog post.
  • Thanks to everyone who works on all the awesome Python data science libraries like numpy, scipy, scikit-image, pillow, etc, etc that makes this kind of stuff so easy and fun in Python.
  • Thanks to Cookiecutter and the audreyr/cookiecutter-pypackage project template for making Python project packaging way more tolerable.
Issues
  • Windows Installation Tutorial

    Windows Installation Tutorial

    Hi, I've successfully installed and tested this tool on my Windows 10 machine, and I'm writing a simple procedure to install it. It may be useful for some people to try to use this tool on a Windows machine.

    IMPORTANT: Actually, this project has been done for Linux systems, especially dlib. In my tests, the performance of this tool in Windows 10 was about a quarter compared to Ubuntu, built with the same specs. But I haven't seen any difference between these two in other subjects.

    Read First: The new version of dlib doesn't need Boost anymore, so you can skip it. Remember that you still need to meet the following requirements. Requirments: (I've used this tutorial with these tools installed on Windows 10, but the newer versions may work too.)

    1. Microsoft Visual Studio 2015 (or newer) with C/C++ Compiler installed. (Visual C++ 2015 Build Tools didn't work for me, and I got into problems in compiling dlib)
    2. Of course Python3 (I used Python3.5 x64 but the other versions may work too)
    3. CMake for windows and add it to your system environment variables.
    4. (ONLY FOR older versions of dlib) Boost library version 1.63 or newer. Also, you can use precompiled binaries for specific MSVC you have, but I don't suggest. (I've included the compiling procedure of Boost in this tutorial)

    Installation: Easy installation: Just install dlib and face_recognition (not always on the newest version): pip install dlib and then pip install face_recognition.

    Manual installation:

    1. Download and install scipy and numpy+mkl (must be mkl version) packages from this link (all credits goes to Christoph Gohlke). Remember to grab the correct version based on your current Python version.
    2. Download Boost library source code or binary release for your current MSVC from this link.
    3. If you downloaded the binary version skip to step 4 else, follow these steps to compile and build Boost by yourself: 3-1. Extract the Boost source files into C:\local\boost_1_XX_X (X means the current version of Boost you have) 3-2. Create a system variable with these parameters: Name: VS140COMNTOOLS Value: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ (or any path where you have installed MSVC) 3-3. Open Developer Command Prompt for Visual Studio and go to the current directory of Boost extracted and try these commands to compile Boost: bootstrap b2 -a --with-python address-model=64 toolset=msvc runtime-link=static 3-4. If you successfully compile Boost, it should create compiled files in stage directory.
    4. (If you have already compiled Boost skip this step) If you already download the binary release, extract the contents to C:\local\boost_1_XX_X
    5. Grab the latest version of dlib from this repo and extract it.
    6. Go to dlibdirectory and open cmd and follow these commands to build dlib: (remember to replace XX with the current version of Boost you have) set BOOST_ROOT=C:\local\boost_X_XX_X set BOOST_LIBRARYDIR=C:\local\boost_X_XX_X\stage\lib python setup.py install --yes USE_AVX_INSTRUCTIONS or python setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA
    7. Now, you can use import dlib without any problem in your python script.
    8. You can also check the current version of dlib with pip show dlib.
    9. Now, install face_recognition with pip install face_recognition.
    10. Enjoy!

    Finally, I need to say thanks to @ageitgey and @davisking for their awesome work.

    opened by masoudr 252
  • How can I make face recognition faster if I have more than 1M known images?

    How can I make face recognition faster if I have more than 1M known images?

    I tried to use your amazing project for face recognition (for example single unknown image) with my big number of known images (1 Million) but its really slow, this slow because its will load all known images (load_image_file -> then face_encodings) in order to compare with ONE unknown image file.

    Any ideas how to speed this process? I was thinking to do face_encodings for all known images then save the 128 as string into apache solr but with no luck as I still need to do compare_faces with all known images:) ... Any suggestions?

    opened by khaledabbad 77
  • What is the expected speed per image?

    What is the expected speed per image?

    First of all- this is awesome! Much better than OpenCV. No false positives so far while OpenCV had many. However it does about 1 image per second on my my Core i7. And I am just using face detection from this python library (no recognition). Is this a normal result? Feels a tad slow.

    opened by Dingo64 53
  • Freeze your script with Pyinstaller

    Freeze your script with Pyinstaller

    Hi, You might want to freeze your script into a standalone executable to run on any system without the need of installing python or face_recognition and maybe you want to create a demo for your application and want to give it to someone else without giving your source code. Here is a simple tutorial to do that. I tested this method with python3.6 on Windows 10, but I think you can get it working on Linux with a similar method.

    1. Make sure you have correctly installed both face_recognition and dlib and you see no error when importing them into your script.
    2. Make sure your script works fine, and all its dependencies are right next to it, and you can run it fine with python yourscript.py.
    3. Install Pyinstallerwith pip: pip install pyinstaller
    4. Create a new directory and move your python script and all dependencies into it. I call it myproject and myscript.py
    5. Copy face_recognition_models and scipy-extra-dll from your python installed directory to your project directory.
    6. Create an empty file called <yourscriptname>.spec like myscript.spec next to your python script.
    7. Use below Pyinstaller spec file sample and edit some parts according to your needs: (I mark it with <> tag)
    # -*- mode: python -*-
    
    block_cipher = None
    
    face_models = [
    ('.\\face_recognition_models\\models\\dlib_face_recognition_resnet_model_v1.dat', './face_recognition_models/models'),
    ('.\\face_recognition_models\\models\\mmod_human_face_detector.dat', './face_recognition_models/models'),
    ('.\\face_recognition_models\\models\\shape_predictor_5_face_landmarks.dat', './face_recognition_models/models'),
    ('.\\face_recognition_models\\models\\shape_predictor_68_face_landmarks.dat', './face_recognition_models/models'),
    ]
    
    a = Analysis(['<your python script name.py>'],
                 pathex=['<path to working directory>'],
                 binaries=face_models,
                 datas=[],
                 hiddenimports=['scipy._lib.messagestream', 'scipy', 'scipy.signal', 'scipy.signal.bsplines', 'scipy.special', 'scipy.special._ufuncs_cxx',
                                'scipy.linalg.cython_blas',
                                'scipy.linalg.cython_lapack',
                                'scipy.integrate',
                                'scipy.integrate.quadrature',
                                'scipy.integrate.odepack',
                                'scipy.integrate._odepack',
                                'scipy.integrate.quadpack',
                                'scipy.integrate._quadpack',
                                'scipy.integrate._ode',
                                'scipy.integrate.vode',
                                'scipy.integrate._dop', 'scipy._lib', 'scipy._build_utils','scipy.__config__',
                                'scipy.integrate.lsoda', 'scipy.cluster', 'scipy.constants','scipy.fftpack','scipy.interpolate','scipy.io','scipy.linalg','scipy.misc','scipy.ndimage','scipy.odr','scipy.optimize','scipy.setup','scipy.sparse','scipy.spatial','scipy.special','scipy.stats','scipy.version'],
    
                 hookspath=[],
                 runtime_hooks=[],
                 excludes=[],
                 win_no_prefer_redirects=False,
                 win_private_assemblies=False,
                 cipher=block_cipher)
    
    a.datas += Tree('./scipy-extra-dll', prefix=None)
    
    pyz = PYZ(a.pure, a.zipped_data,
                 cipher=block_cipher)
    exe = EXE(pyz,
              a.scripts,
              a.binaries,
              a.zipfiles,
              a.datas,
              name='<your python script name>',
              debug=False,
              strip=False,
              upx=True,
              runtime_tmpdir=None,
              console=True )
    
    
    1. Generate your executable with python -m pyinstaller myscript.spec
    2. If you see no error then your executable can be found in dist directory.
    3. Enjoy!

    Thanks to @ageitgey and @davisking for their awesome work.

    opened by masoudr 51
  • Illegal Instruction.

    Illegal Instruction.

    • face_recognition version: 0.1.9
    • Python version: 2.7
    • Operating System: Linux Mint

    Description

    Hey, first of all Thank you so much for this library. Its Amazing. When i run the script line by line, i get an error "Illegal Instruction" at the following line "my_face_encoding = face_recognition.face_encodings(picture_of_me)[0]" The python terminal exits after this. Please let me know if i am doing something wrong.

    What I Did

    I am using Linux Mint and i pip installed face_recognition (got all libraries including dlib installed)

    opened by abala003 29
  • How to install face_recognition?

    How to install face_recognition?

    There is something seriously wrong with this script. I tried 2 methods and both gave me nothing. I am trying on Debian 8 Amd64.

    Method 1 returns so many errors after the last command that it's insane:

    apt-get install libcurl3
    apt-get install cmake
    apt-get install git
    apt-get install python3.4
    apt-get install python3-pip
    apt-get install libboost-all-dev
    mkdir temporarydir
    cd temporarydir
    git clone https://github.com/davisking/dlib.git
    cd dlib
    mkdir build 
    cd build;
    cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=1
    cmake --build .
    cd ..
    python3 setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA
    pip3 install scipy
    pip3 install face_recognition
    

    Method 2 is simpler:

    wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda-2.3.0-Linux-x86_64.sh
    bash Anaconda-2.3.0-Linux-x86_64.sh
    conda create -n py35 python=3.5
    activate py35
    conda config --add channels conda-forge
    conda install numpy
    conda install scipy
    conda install dlib
    pip install face_recognition
    conda install scipy
    

    As you can see I installed scipy twice and yet when I try to run face_recognition I get:

    Traceback (most recent call last):
      File "/usr/local/bin/face_recognition", line 7, in <module>
        from face_recognition.cli import main
      File "/usr/local/lib/python3.4/dist-packages/face_recognition/__init__.py", line 7, in <module>
        from .api import load_image_file, face_locations, face_landmarks, face_encodings, compare_faces, face_distance
      File "/usr/local/lib/python3.4/dist-packages/face_recognition/api.py", line 3, in <module>
        import scipy.misc
    ImportError: No module named 'scipy'
    
    opened by Dingo64 28
  • Problems installing face_recognition

    Problems installing face_recognition

    • face_recognition version: 1.2.3
    • Python version: 3.7.3
    • Operating System: Windows 10.0.17134.706

    Description

    I am simply trying to install face recognition for a project of mine and keep receiving this error.

    What I Did

    C:\Windows\system32>pip install face_recognition Collecting face_recognition Using cached https://files.pythonhosted.org/packages/3f/ed/ad9a28042f373d4633fc8b49109b623597d6f193d3bbbef7780a5ee8eef2/face_recognition-1.2.3-py2.py3-none-any.whl Collecting face-recognition-models>=0.3.0 (from face_recognition) Requirement already satisfied: Click>=6.0 in e:\new folder (2)\lib\site-packages (from face_recognition) (7.0) Collecting dlib>=19.7 (from face_recognition) Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz Requirement already satisfied: Pillow in e:\new folder (2)\lib\site-packages (from face_recognition) (6.0.0) Requirement already satisfied: numpy in e:\new folder (2)\lib\site-packages (from face_recognition) (1.16.2) Building wheels for collected packages: dlib Building wheel for dlib (setup.py) ... error Complete output from command "e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d C:\Users\walki\AppData\Local\Temp\pip-wheel-s06t1j5i --python-tag cp37: running bdist_wheel running build running build_py package init file 'dlib_init_.py' not found (or not a regular file) running build_ext Building extension for Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] Invoking CMake setup: 'cmake C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7 -A x64' -- Building for: NMake Makefiles CMake Error in CMakeLists.txt: Generator

      NMake Makefiles
    
    does not support platform specification, but platform
    
      x64
    
    was specified.
    

    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! See also "C:/Users/walki/AppData/Local/Temp/pip-install-76vhd65m/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log". Traceback (most recent call last): File "", line 1, in File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 261, in 'Topic :: Software Development', File "e:\new folder (2)\lib\site-packages\setuptools_init_.py", line 145, in setup return distutils.core.setup(**attrs) File "e:\new folder (2)\lib\distutils\core.py", line 148, in setup dist.run_commands() File "e:\new folder (2)\lib\distutils\dist.py", line 966, in run_commands self.run_command(cmd) File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "e:\new folder (2)\lib\site-packages\wheel\bdist_wheel.py", line 192, in run self.run_command('build') File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "e:\new folder (2)\lib\distutils\command\build.py", line 135, in run self.run_command(cmd_name) File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 135, in run self.build_extension(ext) File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 172, in build_extension subprocess.check_call(cmake_setup, cwd=build_folder) File "e:\new folder (2)\lib\subprocess.py", line 347, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', 'C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.


    Failed building wheel for dlib Running setup.py clean for dlib Failed to build dlib Installing collected packages: face-recognition-models, dlib, face-recognition Running setup.py install for dlib ... error Complete output from command "e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\walki\AppData\Local\Temp\pip-record-6482f4uw\install-record.txt --single-version-externally-managed --compile: running install running build running build_py package init file 'dlib_init_.py' not found (or not a regular file) running build_ext Building extension for Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] Invoking CMake setup: 'cmake C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7 -A x64' -- Building for: NMake Makefiles CMake Error in CMakeLists.txt: Generator

        NMake Makefiles
    
      does not support platform specification, but platform
    
        x64
    
      was specified.
    
    
    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
    -- Configuring incomplete, errors occurred!
    See also "C:/Users/walki/AppData/Local/Temp/pip-install-76vhd65m/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 261, in <module>
        'Topic :: Software Development',
      File "e:\new folder (2)\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "e:\new folder (2)\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "e:\new folder (2)\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "e:\new folder (2)\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "e:\new folder (2)\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "e:\new folder (2)\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 135, in run
        self.build_extension(ext)
      File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 172, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "e:\new folder (2)\lib\subprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=e:\\new folder (2)\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
    
    ----------------------------------------
    

    Command ""e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\walki\AppData\Local\Temp\pip-record-6482f4uw\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\

    opened by WalkingCaesar09 26
  • Need To Uninstall dlib and face_recognition, getting 'face_recognition' has no attribute 'load_image_file'

    Need To Uninstall dlib and face_recognition, getting 'face_recognition' has no attribute 'load_image_file'

    • face_recognition version: The one on Github as of three days ago
    • Python version: 3.6
    • Operating System: Ubuntu

    Description

    face_recognition was working fine but then I tried to get dlib to use my GPU.
    I uninstalled as much of the two (dlib and face_recognition) as a could, installed dlib so that it would use my GPU, re-installed face_recognition, but I clearly didn't have a clean enough uninstall. Now when I try to use face_recognition I'm getting...
    $ python3 face.py Traceback (most recent call last): File "face.py", line 58, in image = face_recognition.load_image_file(aly) AttributeError: module 'face_recognition' has no attribute 'load_image_file'

    I know the problem is not with my code because, like I said, I worked before and it was using the CPU. The trouble started when I tried to get it to use the GPU. I know I should have done a full uninstallation of dlib and face_recognition but I don't know how. Know face_recognition and dlib documentation or Q&A problems up on the Internet anywhere explain this in a way that I can find/ make use of.

    Could you please help me uninstall these two modules, so I can get dlib re-installed the right way? Thank you.

    opened by MotorCityCobra 25
  • Facerec_from_video_file

    Facerec_from_video_file

    • face_recognition version: latest
    • Python version: 3.7.6
    • Operating System: Ubuntu 18.04

    Description

    Carry out facial recognition from video file, but use all CPU cores and/or GPU. Currently the script only maxes out one CPU core.

    What I Did

    Ran the script using PyCharm it starts processing the video file but only using 1 core of the CPU

    opened by JackAllen2020 21
  • threshold/confidence

    threshold/confidence

    How can the simple known/unknown example be modified to have a different confidence/treshold other then point 6?

    face_recognition ./pictures_of_people_i_know/ ./unknown_pictures/

    opened by jsniff 16
  • Accessing and storing encodings

    Accessing and storing encodings

    Hi all,

    Is it possible to access and store the encodings after processing the images?

    opened by Bettys-sidepiece 0
  • Face recognition first call very slow on Jetpack 4.6

    Face recognition first call very slow on Jetpack 4.6

    Hi - I am trying to use my Nano as much as OOB as possible Its just been re-created using jetpack 4.6

    I have been adapting one of the JetsonHacks ideas to my own code involving facial recognition from video with Face_recognition. I applied the one line code fix to dlib as outlined in https://forums.developer.nvidia.com/t/issues-with-dlib-library/72600/16 https://medium.com/@ageitgey/build-a-hardware-based-face-recognition-system-for-150-with-the-nvidia-jetson-nano-and-python-a25cb8c891fd these relate to dlib 19.16 and 19.17 but it seems to still apply to 19.22 That got face_recognition to use the GPU when model="cnn" was used

    However I am finding the startup time to be horrible the first call to face_recognition.face_locations(imageRGB ,model="cnn" ) takes 22 to 25 seconds. subsequent calls take about 0.3 sec to 0.9 sec for larger images for the 1st call it doesn't matter what size the image is

    If the model is changed to model="hog" then the first call to face_recognition.face_locations, and each subsequent takes about 0.6 sec

    Similar results for the calls to face_recognition.face_encodings Model='cnn' initial 2.69 sec then .04sec again size doesn't seem to affect it too much Model='hog' initial from 5.5 to 10 sec then .04sec

    Over 20 seconds just feels like a timeout issue, probably between face_recognition and dlib, but that just me using 'the force'

    Does anybody have any ideas how to make all these bits play nicely together?

    Python 3.6.9
    dlib.DLIB_USE_CUDA = True
    dlib version = 19.22.0
    dlib compiled = Nov 14 2021 16:36:45
    face_recognition.__version__ = 1.2.3
    cv2.__version__ = 4.1.1
    camera = Raspberry V2
    cuDNN = 8.2.1
    
    

    Thanks JC

    opened by jc508 0
  • Bump pip from 19.2 to 21.1

    Bump pip from 19.2 to 21.1

    Bumps pip from 19.2 to 21.1.

    Changelog

    Sourced from pip's changelog.

    21.1 (2021-04-24)

    Process

    • Start installation scheme migration from distutils to sysconfig. A warning is implemented to detect differences between the two implementations to encourage user reports, so we can avoid breakages before they happen.

    Features

    • Add the ability for the new resolver to process URL constraints. ([#8253](https://github.com/pypa/pip/issues/8253) <https://github.com/pypa/pip/issues/8253>_)
    • Add a feature --use-feature=in-tree-build to build local projects in-place when installing. This is expected to become the default behavior in pip 21.3; see Installing from local packages <https://pip.pypa.io/en/stable/user_guide/#installing-from-local-packages>_ for more information. ([#9091](https://github.com/pypa/pip/issues/9091) <https://github.com/pypa/pip/issues/9091>_)
    • Bring back the "(from versions: ...)" message, that was shown on resolution failures. ([#9139](https://github.com/pypa/pip/issues/9139) <https://github.com/pypa/pip/issues/9139>_)
    • Add support for editable installs for project with only setup.cfg files. ([#9547](https://github.com/pypa/pip/issues/9547) <https://github.com/pypa/pip/issues/9547>_)
    • Improve performance when picking the best file from indexes during pip install. ([#9748](https://github.com/pypa/pip/issues/9748) <https://github.com/pypa/pip/issues/9748>_)
    • Warn instead of erroring out when doing a PEP 517 build in presence of --build-option. Warn when doing a PEP 517 build in presence of --global-option. ([#9774](https://github.com/pypa/pip/issues/9774) <https://github.com/pypa/pip/issues/9774>_)

    Bug Fixes

    • Fixed --target to work with --editable installs. ([#4390](https://github.com/pypa/pip/issues/4390) <https://github.com/pypa/pip/issues/4390>_)
    • Add a warning, discouraging the usage of pip as root, outside a virtual environment. ([#6409](https://github.com/pypa/pip/issues/6409) <https://github.com/pypa/pip/issues/6409>_)
    • Ignore .dist-info directories if the stem is not a valid Python distribution name, so they don't show up in e.g. pip freeze. ([#7269](https://github.com/pypa/pip/issues/7269) <https://github.com/pypa/pip/issues/7269>_)
    • Only query the keyring for URLs that actually trigger error 401. This prevents an unnecessary keyring unlock prompt on every pip install invocation (even with default index URL which is not password protected). ([#8090](https://github.com/pypa/pip/issues/8090) <https://github.com/pypa/pip/issues/8090>_)
    • Prevent packages already-installed alongside with pip to be injected into an isolated build environment during build-time dependency population. ([#8214](https://github.com/pypa/pip/issues/8214) <https://github.com/pypa/pip/issues/8214>_)
    • Fix pip freeze permission denied error in order to display an understandable error message and offer solutions. ([#8418](https://github.com/pypa/pip/issues/8418) <https://github.com/pypa/pip/issues/8418>_)
    • Correctly uninstall script files (from setuptools' scripts argument), when installed with --user. ([#8733](https://github.com/pypa/pip/issues/8733) <https://github.com/pypa/pip/issues/8733>_)
    • New resolver: When a requirement is requested both via a direct URL (req @ URL) and via version specifier with extras (req[extra]), the resolver will now be able to use the URL to correctly resolve the requirement with extras. ([#8785](https://github.com/pypa/pip/issues/8785) <https://github.com/pypa/pip/issues/8785>_)
    • New resolver: Show relevant entries from user-supplied constraint files in the error message to improve debuggability. ([#9300](https://github.com/pypa/pip/issues/9300) <https://github.com/pypa/pip/issues/9300>_)
    • Avoid parsing version to make the version check more robust against lousily debundled downstream distributions. ([#9348](https://github.com/pypa/pip/issues/9348) <https://github.com/pypa/pip/issues/9348>_)
    • --user is no longer suggested incorrectly when pip fails with a permission error in a virtual environment. ([#9409](https://github.com/pypa/pip/issues/9409) <https://github.com/pypa/pip/issues/9409>_)
    • Fix incorrect reporting on Requires-Python conflicts. ([#9541](https://github.com/pypa/pip/issues/9541) <https://github.com/pypa/pip/issues/9541>_)

    ... (truncated)

    Commits
    • 2b2a268 Bump for release
    • ea761a6 Update AUTHORS.txt
    • 2edd3fd Postpone a deprecation to 21.2
    • 3cccfbf Rename mislabeled news fragment
    • 21cd124 Fix NEWS.rst placeholder position
    • e46bdda Merge pull request #9827 from pradyunsg/fix-git-improper-tag-handling
    • 0e4938d :newspaper:
    • ca832b2 Don't split git references on unicode separators
    • 1320bac Merge pull request #9814 from pradyunsg/revamp-ci-apr-2021-v2
    • e9cc23f Skip checks on PRs only
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • face_recognition reports version as 1.3.0 and 1.2.3

    face_recognition reports version as 1.3.0 and 1.2.3

    face_recognition reports version as 1.3.0 and 1.2.3 this occurs on windows 10 and Jetson Nano (jetpack 4.6)

    asking pip it reports 1.3.0

    >pip3 show face_recognition
    Name: face-recognition
    Version: 1.3.0
    Summary: Recognize faces from Python or from the command line
    ...
    
    

    in a python program

    import dlib
    print('dlib.DLIB_USE_CUDA = ' + str(dlib.DLIB_USE_CUDA))
    print('dlib version = ' + dlib.__version__ )
    print('dlib compiled = ' + dlib.__time_compiled__)
    import face_recognition   
    print('face_recognition.__version__ = ' + face_recognition.__version__ )
    

    dlib.DLIB_USE_CUDA = True dlib version = 19.22.0 dlib compiled = Jul 10 2021 14:26:39 face_recognition.version = 1.2.3

    is this consistant? I hope I haven't tangled versions

    opened by jc508 0
  • Face Recognition- How to put the outcomes into separate folder.

    Face Recognition- How to put the outcomes into separate folder.

    I am new to this coding. And I tried to use face recognition and it worked actually. But when I run the command Face_recognition, I only get the results like this: /home/lutfu/FACE/unknown/2018-03-28_15-12-19.jpg,Elon Musk What I want is that the pictures containing the faces should be copied to another folder. I don't want outcomes such as /home/lutfu/FACE/unknown/2018-03-28_15-12-19.jpg, elon I want the pictures in another folder automatically. Could anybody help me? I downloaded Visual studio code. Thanks in advance.

    opened by lutfufn 0
  • The kernel appears to have died. It will restart automatically. (Dead Kernel)

    The kernel appears to have died. It will restart automatically. (Dead Kernel)

    Hello,

    Thanks for this great effort.

    I am trying the below code as it is to perform the following:

    Recognize faces in a video file and write out a new video file (Requires OpenCV to be installed)

    But I am always getting this error:

    The kernel appears to have died. It will restart automatically.

    import face_recognition import cv2

    This is a demo of running face recognition on a video file and saving the results to a new video file.

    PLEASE NOTE: This example requires OpenCV (the cv2 library) to be installed only to read from your webcam.

    OpenCV is not required to use the face_recognition library. It's only required if you want to run this

    specific demo. If you have trouble installing it, try any of the other demos that don't require it instead.

    Open the input movie file

    input_movie = cv2.VideoCapture("blur2_video_moderate_1_Trim2.mp4") length = int(input_movie.get(cv2.CAP_PROP_FRAME_COUNT))

    Create an output movie file (make sure resolution/frame rate matches input video!)

    fourcc = cv2.VideoWriter_fourcc(*'XVID') output_movie = cv2.VideoWriter('output_trim.avi', fourcc, 29.97, (640, 360))

    Load some sample pictures and learn how to recognize them.

    lmm_image = face_recognition.load_image_file("Scarlet.png") lmm_face_encoding = face_recognition.face_encodings(lmm_image)[0]

    al_image = face_recognition.load_image_file("Daniel.png") al_face_encoding = face_recognition.face_encodings(al_image)[0]

    known_faces = [ lmm_face_encoding, al_face_encoding ]

    Initialize some variables

    face_locations = [] face_encodings = [] face_names = [] frame_number = 0

    while True: # Grab a single frame of video ret, frame = input_movie.read() frame_number += 1

    # Quit when the input video file ends
    if not ret:
        break
    
    # Convert the image from BGR color (which OpenCV uses) to RGB color (which face_recognition uses)
    rgb_frame = frame[:, :, ::-1]
    
    # Find all the faces and face encodings in the current frame of video
    face_locations = face_recognition.face_locations(rgb_frame)
    face_encodings = face_recognition.face_encodings(rgb_frame, face_locations)
    
    face_names = []
    for face_encoding in face_encodings:
        # See if the face is a match for the known face(s)
        match = face_recognition.compare_faces(known_faces, face_encoding, tolerance=0.50)
    
        # If you had more than 2 faces, you could make this logic a lot prettier
        # but I kept it simple for the demo
        name = None
        if match[0]:
            name = "Scarlet"
        elif match[1]:
            name = "Daniel"
    
        face_names.append(name)
    
    # Label the results
    for (top, right, bottom, left), name in zip(face_locations, face_names):
        if not name:
            continue
    
        # Draw a box around the face
        cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2)
    
        # Draw a label with a name below the face
        cv2.rectangle(frame, (left, bottom - 25), (right, bottom), (0, 0, 255), cv2.FILLED)
        font = cv2.FONT_HERSHEY_DUPLEX
        cv2.putText(frame, name, (left + 6, bottom - 6), font, 0.5, (255, 255, 255), 1)
    
    # Write the resulting image to the output video file
    print("Writing frame {} / {}".format(frame_number, length))
    output_movie.write(frame)
    

    All done!

    input_movie.release() cv2.destroyAllWindows()

    opened by AhmedEwis 0
  • Confidence of detection

    Confidence of detection

    How to get a confidence of detected faces out of face_locations function?

    opened by mzhadigerov 0
  • folders with multiple images generate incorrect result

    folders with multiple images generate incorrect result

    • face_recognition version: 1.3
    • Python version:3.7
    • Operating System: MacOS 10.15

    Description

    Using the example provided to train multiple images using sklearn/svm. I added the small portion of the faces in the wild folder and observed that any folders containing more than 1 image automatically get chosen as the correct result.

    ie. if I have my test image be joe biden and I have a folder with 1 photo of joe biden and one folder with 2 photos of obama, obama will be identified as the test image face, incorrectly.

    What I Did

    Script not modified from original
    
    opened by cfivek 0
  • When comparing two photos, I get arrays with a different number of elements?

    When comparing two photos, I get arrays with a different number of elements?

    Hello, sorry for bad english, i trying to compare two photos using python module: face_recognition

    1. save the vector to the
    2. extract it from Mysql database
    3. find the euclidean distance by comparing it with another vector

    Error: i get 2D arrays which contain different number of elements(last array)

    Error

    photo1: Error

    photo2: Face

    Please help me for several days I can not solve this problem :) if there is a simpler solution, I will be very glad to see him,

    Code:

    #!/usr/bin/env python3
    
    import cv2
    import json
    import face_recognition
    import mysql.connector as mysql
    
    
    # DB
    conn = mysql.connect(
      host = 'localhost',
      user = 'your_login',
      passwd = 'password'
    )
    
    
    def load(str_data):
        str_data = str_data.replace("[", "").replace("]", "")
        result = []
        for i, line in enumerate(str_data.split("\n")):
            result.append([])
            for element in line.replace("  ", " ").split(" "):
                try:
                    result[i].append(float(element))
                except ValueError:
                    pass
                    
        return result
    
    
    
    
    
    def distance(model, test):
        distance = 0
        for i, line in enumerate(model):
            dist_line = 0
            for j, element in enumerate(line):
                dist_line += (element - test[i][j]) ** 2
            distance += dist_line ** 0.5
        return distance
    
      
    def get_image_hash(image):
        # Open image
        img = face_recognition.load_image_file(image)
    
        # Save as black
        #img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    
        # Get vector
        vector = face_recognition.face_encodings(img)[0]
        
        # We can save only iterable object
        vector = (str(vector),)
        
        return vector
    
    
    cur = conn.cursor(buffered=True)
    cur.execute("SHOW DATABASES")          
    
    
    # Check if db 'test' already exist
    db_found = False
    for db in cur:
        if 'test' in db:
            db_found = True
    
    if not db_found:
        cur.execute("CREATE DATABASE IF NOT EXISTS test;")
        conn.commit()
        
    cur.execute("USE test;")
    cur.execute("""CREATE TABLE IF NOT EXISTS faces(id_face BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT, face_hash TEXT)""")                            
                                             
    # Add face in DB
    new_image = get_image_hash('test.jpg')
    
    
    #print('new_image debug: ', new_image)
    
    cur.execute('''INSERT INTO faces (face_hash) VALUES(%s)''', new_image)
    conn.commit()
    
    # Find added face
    find_me_image = get_image_hash('findme.jpg')
    #print('debug find_me_image: ', find_me_image[0])
    
    # Get data from DB
    cur.execute("SELECT * FROM faces;")
    face_data = cur.fetchall()
    
    
    # Check
    for x in face_data:
      #print('1: ', load(find_me_image[0]))
      #print('2: ', load(x[1]))
    
      # x[1] == row face_hash
      compare_result = distance(load(find_me_image[0]), load(x[1]))
        
    print('Result: ', compare_result)
    cur.close()
    
    opened by razrabotkajava 0
Releases(v1.2.2)
Owner
Adam Geitgey
Adam Geitgey
OpenFace – a state-of-the art tool intended for facial landmark detection, head pose estimation, facial action unit recognition, and eye-gaze estimation.

OpenFace 2.2.0: a facial behavior analysis toolkit Over the past few years, there has been an increased interest in automatic facial behavior analysis

Tadas Baltrusaitis 5.4k Nov 25, 2021
Demonstrates how to divide a DL model into multiple IR model files (division) and introduce a simplest way to implement a custom layer works with OpenVINO IR models.

Demonstration of OpenVINO techniques - Model-division and a simplest-way to support custom layers Description: Model Optimizer in Intel(r) OpenVINO(tm

Yasunori Shimura 11 Nov 28, 2021
Keeping it safe - AI Based COVID-19 Tracker using Deep Learning and facial recognition

Keeping it safe - AI Based COVID-19 Tracker using Deep Learning and facial recognition

Vansh Wassan 15 Jun 17, 2021
Method for facial emotion recognition compitition of Xunfei and Datawhale .

人脸情绪识别挑战赛-第3名-W03KFgNOc-源代码、模型以及说明文档 队名:W03KFgNOc 排名:3 正确率: 0.75564 队员:yyMoming,xkwang,RichardoMu。 比赛链接:人脸情绪识别挑战赛 文章地址:link emotion 该项目分别训练八个模型并生成csv文

null 2 Nov 15, 2021
Spontaneous Facial Micro Expression Recognition using 3D Spatio-Temporal Convolutional Neural Networks

Spontaneous Facial Micro Expression Recognition using 3D Spatio-Temporal Convolutional Neural Networks Abstract Facial expression recognition in video

Bogireddy Sai Prasanna Teja Reddy 78 Nov 1, 2021
A facial recognition doorbell system using a Raspberry Pi

Facial Recognition Doorbell This project expands on the person-detecting doorbell system to allow it to identify faces, and announce names accordingly

rydercalmdown 19 Oct 7, 2021
Relative Uncertainty Learning for Facial Expression Recognition

Relative Uncertainty Learning for Facial Expression Recognition The official implementation of the following paper at NeurIPS2021: Title: Relative Unc

null 5 Nov 25, 2021
Facial detection, landmark tracking and expression transfer library for Windows, Linux and Mac

Welcome to the CSIRO Face Analysis SDK. Documentation for the SDK can be found in doc/documentation.html. All code in this SDK is provided according t

Luiz Carlos Vieira 7 Jul 16, 2020
Py-FEAT: Python Facial Expression Analysis Toolbox

Py-FEAT is a suite for facial expressions (FEX) research written in Python. This package includes tools to detect faces, extract emotional facial expressions (e.g., happiness, sadness, anger), facial muscle movements (e.g., action units), and facial landmarks, from videos and images of faces, as well as methods to preprocess, analyze, and visualize FEX data.

Computational Social Affective Neuroscience Laboratory 76 Nov 23, 2021
Official PyTorch implementation of Retrieve in Style: Unsupervised Facial Feature Transfer and Retrieval.

Retrieve in Style: Unsupervised Facial Feature Transfer and Retrieval PyTorch This is the PyTorch implementation of Retrieve in Style: Unsupervised Fa

null 46 Nov 19, 2021
Facial Action Unit Intensity Estimation via Semantic Correspondence Learning with Dynamic Graph Convolution

FAU Implementation of the paper: Facial Action Unit Intensity Estimation via Semantic Correspondence Learning with Dynamic Graph Convolution. Yingruo

Evelyn 63 Nov 23, 2021
Instant Real-Time Example-Based Style Transfer to Facial Videos

FaceBlit: Instant Real-Time Example-Based Style Transfer to Facial Videos The official implementation of FaceBlit: Instant Real-Time Example-Based Sty

Aneta Texler 99 Dec 1, 2021
Code for Talk-to-Edit (ICCV2021). Paper: Talk-to-Edit: Fine-Grained Facial Editing via Dialog.

Talk-to-Edit (ICCV2021) This repository contains the implementation of the following paper: Talk-to-Edit: Fine-Grained Facial Editing via Dialog Yumin

Yuming Jiang 135 Nov 26, 2021
GANimation: Anatomically-aware Facial Animation from a Single Image (ECCV'18 Oral) [PyTorch]

GANimation: Anatomically-aware Facial Animation from a Single Image [Project] [Paper] Official implementation of GANimation. In this work we introduce

Albert Pumarola 1.7k Nov 26, 2021
FACIAL: Synthesizing Dynamic Talking Face With Implicit Attribute Learning. ICCV, 2021.

FACIAL: Synthesizing Dynamic Talking Face with Implicit Attribute Learning PyTorch implementation for the paper: FACIAL: Synthesizing Dynamic Talking

null 54 Dec 1, 2021
Supplemental Code for "ImpressionNet :A Multi view Approach to Predict Socio Facial Impressions"

Supplemental Code for "ImpressionNet :A Multi view Approach to Predict Socio Facial Impressions" Environment requirement This code is based on Python

Rohan Kumar Gupta 1 Nov 18, 2021
Facial Image Inpainting with Semantic Control

Facial Image Inpainting with Semantic Control In this repo, we provide a model for the controllable facial image inpainting task. This model enables u

Ren Yurui 8 Nov 22, 2021
Selene is a Python library and command line interface for training deep neural networks from biological sequence data such as genomes.

Selene is a Python library and command line interface for training deep neural networks from biological sequence data such as genomes.

Troyanskaya Laboratory 291 Nov 29, 2021
Simple command line tool for text to image generation using OpenAI's CLIP and Siren (Implicit neural representation network)

Deep Daze mist over green hills shattered plates on the grass cosmic love and attention a time traveler in the crowd life during the plague meditative

Phil Wang 3.9k Dec 4, 2021