{ "info": { "author": "Adrian Bulat", "author_email": "adrian.bulat@nottingham.ac.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# Face Recognition\n\nDetect facial landmarks from Python using the world's most accurate face alignment network, capable of detecting points in both 2D and 3D coordinates.\n\nBuild using [FAN](https://www.adrianbulat.com)'s state-of-the-art deep learning based face alignment method. \n\n

\n\n**Note:** The lua version is available [here](https://github.com/1adrianb/2D-and-3D-face-alignment).\n\nFor numerical evaluations it is highly recommended to use the lua version which uses indentical models with the ones evaluated in the paper. More models will be added soon.\n\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Build Status](https://travis-ci.com/1adrianb/face-alignment.svg?branch=master)](https://travis-ci.com/1adrianb/face-alignment) [![Anaconda-Server Badge](https://anaconda.org/1adrianb/face_alignment/badges/version.svg)](https://anaconda.org/1adrianb/face_alignment)\n\n## Features\n\n#### Detect 2D facial landmarks in pictures\n\n

\n\n

\n\n```python\nimport face_alignment\nfrom skimage import io\n\nfa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, flip_input=False)\n\ninput = io.imread('../test/assets/aflw-test.jpg')\npreds = fa.get_landmarks(input)\n```\n\n#### Detect 3D facial landmarks in pictures\n\n

\n\n

\n\n```python\nimport face_alignment\nfrom skimage import io\n\nfa = face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, flip_input=False)\n\ninput = io.imread('../test/assets/aflw-test.jpg')\npreds = fa.get_landmarks(input)\n```\n\n#### Process an entire directory in one go\n\n```python\nimport face_alignment\nfrom skimage import io\n\nfa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, flip_input=False)\n\npreds = fa.get_landmarks_from_directory('../test/assets/')\n```\n\n#### Detect the landmarks using a specific face detector.\n\nBy default the package will use the SFD face detector. However the users can alternatively use dlib or pre-existing ground truth bounding boxes.\n\n```python\nimport face_alignment\n\n# sfd for SFD, dlib for Dlib and folder for existing bounding boxes.\nfa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, face_detector='sfd')\n```\n\n#### Running on CPU/GPU\nIn order to specify the device (GPU or CPU) on which the code will run one can explicitly pass the device flag:\n\n```python\nimport face_alignment\n\n# cuda for CUDA\nfa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, device='cpu')\n```\n\nPlease also see the ``examples`` folder\n\n## Installation\n\n### Requirements\n\n* Python 3.5+ or Python 2.7 (it may work with other versions too)\n* Linux, Windows or macOS\n* pytorch (>=0.4)\n\nWhile not required, for optimal performance(especially for the detector) it is **highly** recommended to run the code using a CUDA enabled GPU.\n\n### Binaries\n\n```bash\nconda install -c 1adrianb face_alignment\n```\n\n### From source\n\n Install pytorch and pytorch dependencies. Instructions taken from [pytorch readme](https://github.com/pytorch/pytorch). For a more updated version check the framework github page.\n\n On Linux\n```bash\nexport CMAKE_PREFIX_PATH=\"$(dirname $(which conda))/../\" # [anaconda root directory]\n\n# Install basic dependencies\nconda install numpy pyyaml mkl setuptools cmake gcc cffi\n\n# Add LAPACK support for the GPU\nconda install -c soumith magma-cuda80 # or magma-cuda75 if CUDA 7.5\n```\n\nOn OSX\n```bash\nexport CMAKE_PREFIX_PATH=[anaconda root directory]\nconda install numpy pyyaml setuptools cmake cffi\n```\n#### Get the PyTorch source\n```bash\ngit clone --recursive https://github.com/pytorch/pytorch\n```\n\n#### Install PyTorch\nOn Linux\n```bash\npython setup.py install\n```\n\nOn OSX\n```bash\nMACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install\n```\n\n\n#### Get the Face Alignment source code\n```bash\ngit clone https://github.com/1adrianb/face-alignment\n```\n#### Install the Face Alignment lib\n```bash\npip install -r requirements.txt\npython setup.py install\n```\n\n### Docker image\n\nA Dockerfile is provided to build images with cuda support and cudnn v5. For more instructions about running and building a docker image check the orginal Docker documentation.\n```\ndocker build -t face-alignment .\n```\n\n## How does it work?\n\nWhile here the work is presented as a black-box, if you want to know more about the intrisecs of the method please check the original paper either on arxiv or my [webpage](https://www.adrianbulat.com).\n\n## Contributions\n\nAll contributions are welcomed. If you encounter any issue (including examples of images where it fails) feel free to open an issue.\n\n## Citation\n\n```\n@inproceedings{bulat2017far,\n title={How far are we from solving the 2D \\& 3D Face Alignment problem? (and a dataset of 230,000 3D facial landmarks)},\n author={Bulat, Adrian and Tzimiropoulos, Georgios},\n booktitle={International Conference on Computer Vision},\n year={2017}\n}\n```\n\nFor citing dlib, pytorch or any other packages used here please check the original page of their respective authors.\n\n## Acknowledgements\n\n* To the [pytorch](http://pytorch.org/) team for providing such an awesome deeplearning framework\n* To [my supervisor](http://www.cs.nott.ac.uk/~pszyt/) for his patience and suggestions.\n* To all other python developers that made available the rest of the packages used in this repository.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/1adrianb/face-alignment", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "face-alignment", "package_url": "https://pypi.org/project/face-alignment/", "platform": "", "project_url": "https://pypi.org/project/face-alignment/", "project_urls": { "Homepage": "https://github.com/1adrianb/face-alignment" }, "release_url": "https://pypi.org/project/face-alignment/1.0.0/", "requires_dist": [ "torch", "numpy", "scipy (>=0.17)", "scikit-image", "opencv-python", "tqdm", "enum34; python_version < \"3.4\"" ], "requires_python": "", "summary": "Detector 2D or 3D face landmarks from Python", "version": "1.0.0" }, "last_serial": 4617116, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "1df059091ab570736584c3f49855fe9a", "sha256": "1300d8e701f73691435024e86089151b1e5f6e1070c5d80fad7e0aca12b6a88e" }, "downloads": -1, "filename": "face_alignment-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1df059091ab570736584c3f49855fe9a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 22034, "upload_time": "2018-10-12T10:55:53", "url": "https://files.pythonhosted.org/packages/20/86/26baa3888c254c9ce284702a1041cf9a533ad91c873b06f74d3cfa23aff7/face_alignment-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4e2ff1c1390660f4d97d19b074a57e71", "sha256": "dd5dfc4b3d4063ad4d151edd3e18dce67ea655134b2474b94faff5a62485a029" }, "downloads": -1, "filename": "face_alignment-1.0.0-py3.6.egg", "has_sig": false, "md5_digest": "4e2ff1c1390660f4d97d19b074a57e71", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 47171, "upload_time": "2018-12-19T15:17:40", "url": "https://files.pythonhosted.org/packages/1f/f1/3b1b6a38c4dbefa811d501f4fbabb05d2b3f88f8ad3c373912f278befc3d/face_alignment-1.0.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "9729621394fa609a2b0b17d4b237d098", "sha256": "558c2b688c6ab40580da2e55f7d17911acd787aa6af3fafe5f94549a9600e02e" }, "downloads": -1, "filename": "face_alignment-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9729621394fa609a2b0b17d4b237d098", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20729, "upload_time": "2018-10-12T10:55:58", "url": "https://files.pythonhosted.org/packages/da/38/d429ca0f398195d7f81090db8d7aefb4257a1cbb79405ebf7013958d62b6/face_alignment-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1df059091ab570736584c3f49855fe9a", "sha256": "1300d8e701f73691435024e86089151b1e5f6e1070c5d80fad7e0aca12b6a88e" }, "downloads": -1, "filename": "face_alignment-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1df059091ab570736584c3f49855fe9a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 22034, "upload_time": "2018-10-12T10:55:53", "url": "https://files.pythonhosted.org/packages/20/86/26baa3888c254c9ce284702a1041cf9a533ad91c873b06f74d3cfa23aff7/face_alignment-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4e2ff1c1390660f4d97d19b074a57e71", "sha256": "dd5dfc4b3d4063ad4d151edd3e18dce67ea655134b2474b94faff5a62485a029" }, "downloads": -1, "filename": "face_alignment-1.0.0-py3.6.egg", "has_sig": false, "md5_digest": "4e2ff1c1390660f4d97d19b074a57e71", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 47171, "upload_time": "2018-12-19T15:17:40", "url": "https://files.pythonhosted.org/packages/1f/f1/3b1b6a38c4dbefa811d501f4fbabb05d2b3f88f8ad3c373912f278befc3d/face_alignment-1.0.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "9729621394fa609a2b0b17d4b237d098", "sha256": "558c2b688c6ab40580da2e55f7d17911acd787aa6af3fafe5f94549a9600e02e" }, "downloads": -1, "filename": "face_alignment-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9729621394fa609a2b0b17d4b237d098", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20729, "upload_time": "2018-10-12T10:55:58", "url": "https://files.pythonhosted.org/packages/da/38/d429ca0f398195d7f81090db8d7aefb4257a1cbb79405ebf7013958d62b6/face_alignment-1.0.0.tar.gz" } ] }