[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2352":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":43,"readmeContent":44,"aiSummary":45,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":46,"discoverSource":47},2352,"deepface","serengil\u002Fdeepface","serengil","A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python","https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=WnUVYQP4h44&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E",null,"Python",22920,3110,182,9,0,2,36,212,19,45,"MIT License",false,"master",true,[27,28,29,5,30,31,32,33,34,35,36,37,38,39,40,41,42],"age-prediction","arcface","deep-learning","deepid","emotion-recognition","face-analysis","face-recognition","facenet","facial-expression-recognition","facial-recognition","gender-prediction","machine-learning","openface","python","race-classification","vgg-face","2026-06-12 02:00:40","# deepface\n\n\u003Cdiv align=\"center\">\n\n[![Downloads](https:\u002F\u002Fstatic.pepy.tech\u002Fpersonalized-badge\u002Fdeepface?period=total&units=international_system&left_color=grey&right_color=blue&left_text=downloads)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fdeepface)\n[![Stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fserengil\u002Fdeepface?color=yellow&style=flat&label=%E2%AD%90%20stars)](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Fstargazers)\n[![Pulls](https:\u002F\u002Fimg.shields.io\u002Fdocker\u002Fpulls\u002Fserengil\u002Fdeepface?logo=docker)](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fserengil\u002Fdeepface)\n[![License](http:\u002F\u002Fimg.shields.io\u002F:license-MIT-green.svg?style=flat)](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Fblob\u002Fmaster\u002FLICENSE)\n[![Tests](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Factions\u002Fworkflows\u002Ftests.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Factions\u002Fworkflows\u002Ftests.yml)\n[![DOI](http:\u002F\u002Fimg.shields.io\u002F:DOI-10.35378\u002Fgujs.1794891-blue.svg?style=flat)](https:\u002F\u002Fdoi.org\u002F10.35378\u002Fgujs.1794891)\n\n[![Blog](https:\u002F\u002Fimg.shields.io\u002F:blog-sefiks.com-blue.svg?style=flat&logo=wordpress)](https:\u002F\u002Fsefiks.com)\n[![YouTube](https:\u002F\u002Fimg.shields.io\u002F:youtube-@sefiks-red.svg?style=flat&logo=youtube)](https:\u002F\u002Fwww.youtube.com\u002F@sefiks?sub_confirmation=1)\n[![Twitter](https:\u002F\u002Fimg.shields.io\u002F:follow-@serengil-blue.svg?style=flat&logo=x)](https:\u002F\u002Ftwitter.com\u002Fintent\u002Fuser?screen_name=serengil)\n\n[![Patreon](https:\u002F\u002Fimg.shields.io\u002F:become-patron-f96854.svg?style=flat&logo=patreon)](https:\u002F\u002Fwww.patreon.com\u002Fserengil?repo=deepface)\n[![GitHub Sponsors](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fsponsors\u002Fserengil?logo=GitHub&color=lightgray)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fserengil)\n[![Buy Me a Coffee](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee)](https:\u002F\u002Fbuymeacoffee.com\u002Fserengil)\n\n\u003C!--\n[![Hacker News](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdynamic\u002Fjson?color=orange&label=Hacker%20News&query=score&url=https%3A%2F%2Fhacker-news.firebaseio.com%2Fv0%2Fitem%2F46608519.json&logo=y-combinator)](https:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=46608519)\n-->\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F4227\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Ftrendshift.io\u002Fapi\u002Fbadge\u002Frepositories\u002F4227\" alt=\"serengil%2Fdeepface | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cbr>\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fdeepface.dev?source=deepface_repo\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FHosted-deepface.dev-00BFFF?style=flat&labelColor=555555\" alt=\"Hosted | deepface.dev\"\u002F>\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fdeepface-icon-labeled.png\" width=\"200\" height=\"240\">\u003C\u002Fp>\n\nDeepFace is a lightweight [face recognition](https:\u002F\u002Fsefiks.com\u002F2018\u002F08\u002F06\u002Fdeep-face-recognition-with-keras\u002F) and facial attribute analysis ([age](https:\u002F\u002Fsefiks.com\u002F2019\u002F02\u002F13\u002Fapparent-age-and-gender-prediction-in-keras\u002F), [gender](https:\u002F\u002Fsefiks.com\u002F2019\u002F02\u002F13\u002Fapparent-age-and-gender-prediction-in-keras\u002F), [emotion](https:\u002F\u002Fsefiks.com\u002F2018\u002F01\u002F01\u002Ffacial-expression-recognition-with-keras\u002F) and [race](https:\u002F\u002Fsefiks.com\u002F2019\u002F11\u002F11\u002Frace-and-ethnicity-prediction-in-keras\u002F)) framework for python. It is a hybrid face recognition framework wrapping **state-of-the-art** models: [`VGG-Face`](https:\u002F\u002Fsefiks.com\u002F2018\u002F08\u002F06\u002Fdeep-face-recognition-with-keras\u002F), [`FaceNet`](https:\u002F\u002Fsefiks.com\u002F2018\u002F09\u002F03\u002Fface-recognition-with-facenet-in-keras\u002F), [`OpenFace`](https:\u002F\u002Fsefiks.com\u002F2019\u002F07\u002F21\u002Fface-recognition-with-openface-in-keras\u002F), [`DeepFace`](https:\u002F\u002Fsefiks.com\u002F2020\u002F02\u002F17\u002Fface-recognition-with-facebook-deepface-in-keras\u002F), [`DeepID`](https:\u002F\u002Fsefiks.com\u002F2020\u002F06\u002F16\u002Fface-recognition-with-deepid-in-keras\u002F), [`ArcFace`](https:\u002F\u002Fsefiks.com\u002F2020\u002F12\u002F14\u002Fdeep-face-recognition-with-arcface-in-keras-and-python\u002F), [`Dlib`](https:\u002F\u002Fsefiks.com\u002F2020\u002F07\u002F11\u002Fface-recognition-with-dlib-in-python\u002F), `SFace`, `GhostFaceNet`, `Buffalo_L`.\n\n[A modern face recognition pipeline](https:\u002F\u002Fsefiks.com\u002F2020\u002F05\u002F01\u002Fa-gentle-introduction-to-face-recognition-in-deep-learning\u002F) consists of 5 common stages: [detect](https:\u002F\u002Fsefiks.com\u002F2020\u002F08\u002F25\u002Fdeep-face-detection-with-opencv-in-python\u002F), [align](https:\u002F\u002Fsefiks.com\u002F2020\u002F02\u002F23\u002Fface-alignment-for-face-recognition-in-python-within-opencv\u002F), [normalize](https:\u002F\u002Fsefiks.com\u002F2020\u002F11\u002F20\u002Ffacial-landmarks-for-face-recognition-with-dlib\u002F), [represent](https:\u002F\u002Fsefiks.com\u002F2018\u002F08\u002F06\u002Fdeep-face-recognition-with-keras\u002F) and [verify](https:\u002F\u002Fsefiks.com\u002F2020\u002F05\u002F22\u002Ffine-tuning-the-threshold-in-face-recognition\u002F). While DeepFace handles all these common stages in the background, you don’t need to acquire in-depth knowledge about all the processes behind it. You can just call its verification, find or analysis function with a single line of code.\n\n[`Experiments`](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Ftree\u002Fmaster\u002Fbenchmarks) show that **human beings have 97.53% accuracy** on facial recognition tasks whereas those models already reached and passed that accuracy level.\n\n## Installation [![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fdeepface.svg)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fdeepface\u002F)\n\nThe easiest way to install deepface is to download it from [`PyPI`](https:\u002F\u002Fpypi.org\u002Fproject\u002Fdeepface\u002F). It's going to install the library itself and its prerequisites as well.\n\n```shell\n$ pip install deepface\n```\n\nAlternatively, you can also install deepface from its source code. Source code may have new features not published in pip release yet.\n\n```shell\n$ git clone https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface.git\n$ cd deepface\n$ pip install -e .\n```\n\nOnce you installed the library, then you will be able to import it and use its functionalities.\n\n```python\nfrom deepface import DeepFace\n```\n\n> 💡 Prefer not to install or manage infrastructure? You can use a managed API via [deepface.dev](https:\u002F\u002Fdeepface.dev?source=deepface_repo).\n\n**Face Verification** - [`Demo`](https:\u002F\u002Fyoutu.be\u002FKRCvkNCOphE)\n\nThis function determines whether two facial images belong to the same person or to different individuals. The function returns a dictionary, where the key of interest is `verified`: True indicates the images are of the same person, while False means they are of different people.\n\n```python\nresult: dict = DeepFace.verify(img1_path = \"img1.jpg\", img2_path = \"img2.jpg\")\n```\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fverify-credit.jpg\" width=\"99%\">\u003C\u002Fp>\n\n**Face recognition** - [`Tutorial`](https:\u002F\u002Fsefiks.com\u002F2026\u002F01\u002F01\u002Fintroducing-brand-new-face-recognition-in-deepface\u002F), [`Demo`](https:\u002F\u002Fyoutu.be\u002FHrjp-EStM_s)\n\n[Face recognition](https:\u002F\u002Fsefiks.com\u002F2020\u002F05\u002F25\u002Flarge-scale-face-recognition-for-deep-learning\u002F) requires applying face verification many times. DeepFace provides an out-of-the-box `find` function that searches for the identity of an input image within a specified database path.\n\n```python\ndfs: List[pd.DataFrame] = DeepFace.find(img_path = \"img1.jpg\", db_path = \"C:\u002Fmy_db\")\n```\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fstock-6-v2.jpg\" width=\"95%\">\u003C\u002Fp>\n\nHere, the `find` function relies on a directory-based face datastore and stores embeddings on disk. Alternatively, DeepFace provides a database-backed [`search`](https:\u002F\u002Fsefiks.com\u002F2026\u002F01\u002F01\u002Fintroducing-brand-new-face-recognition-in-deepface\u002F) functionality where embeddings are explicitly registered and queried. Currently, [postgres](https:\u002F\u002Fsefiks.com\u002F2023\u002F06\u002F22\u002Fvector-similarity-search-in-postgresql\u002F), [mongo](https:\u002F\u002Fsefiks.com\u002F2021\u002F01\u002F22\u002Fdeep-face-recognition-with-mongodb\u002F), [neo4j](https:\u002F\u002Fsefiks.com\u002F2021\u002F04\u002F03\u002Fdeep-face-recognition-with-neo4j\u002F), [pgvector](https:\u002F\u002Fsefiks.com\u002F2024\u002F07\u002F05\u002Fpostgres-as-a-vector-database-billion-scale-vector-similarity-search-with-pgvector\u002F), [pinecone](https:\u002F\u002Fsefiks.com\u002F2021\u002F05\u002F19\u002Flarge-scale-face-recognition-with-pinecone-vector-database\u002F) and weaviate are supported as backend databases.\n\n```python\n# register an image into the database\nDeepFace.register(img = \"img1.jpg\")\n\n# perform exact search\ndfs: List[pd.DataFrame] = DeepFace.search(img = \"target.jpg\")\n```\n\nIf you want to perform [`approximate nearest neighbor`](https:\u002F\u002Fsefiks.com\u002F2023\u002F12\u002F31\u002Fa-step-by-step-approximate-nearest-neighbor-example-in-python-from-scratch\u002F) search instead of exact search to achieve faster results on [large-scale databases](https:\u002F\u002Fwww.youtube.com\u002Fplaylist?list=PLsS_1RYmYQQGSJu_Z3OVhXhGmZ86_zuIm), you can build an index beforehand and explicitly enable ANN search. Here, [Faiss](https:\u002F\u002Fsefiks.com\u002F2020\u002F09\u002F17\u002Flarge-scale-face-recognition-with-facebook-faiss\u002F) is used to index embeddings in postgres and mongo; whereas vector databases such as pgvector, weaviate, pinecone and neo4j handle indexing internally.\n\n```python\n# build index on registered embeddings (for postgres and mongo only)\nDeepFace.build_index()\n\n# perform approximate nearest neighbor search\ndfs: List[pd.DataFrame] = DeepFace.search(img = \"target.jpg\", search_method = \"ann\")\n```\n\n**Facial Attribute Analysis** - [`Demo`](https:\u002F\u002Fyoutu.be\u002FGT2UeN85BdA)\n\nDeepFace also comes with a strong facial attribute analysis module including [`age`](https:\u002F\u002Fsefiks.com\u002F2019\u002F02\u002F13\u002Fapparent-age-and-gender-prediction-in-keras\u002F), [`gender`](https:\u002F\u002Fsefiks.com\u002F2019\u002F02\u002F13\u002Fapparent-age-and-gender-prediction-in-keras\u002F), [`facial expression`](https:\u002F\u002Fsefiks.com\u002F2018\u002F01\u002F01\u002Ffacial-expression-recognition-with-keras\u002F) (including angry, fear, neutral, sad, disgust, happy and surprise) and [`race`](https:\u002F\u002Fsefiks.com\u002F2019\u002F11\u002F11\u002Frace-and-ethnicity-prediction-in-keras\u002F) (including asian, white, middle eastern, indian, latino and black) predictions.\n\n```python\nobjs: List[dict] = DeepFace.analyze(\n  img_path = \"img4.jpg\", actions = ['age', 'gender', 'race', 'emotion']\n)\n```\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fstock-2.jpg\" width=\"95%\">\u003C\u002Fp>\n\nAge model got ± 4.65 MAE; gender model got 97.44% accuracy, 96.29% precision and 95.05% recall as mentioned in its [tutorial](https:\u002F\u002Fsefiks.com\u002F2019\u002F02\u002F13\u002Fapparent-age-and-gender-prediction-in-keras\u002F).\n\n**Real Time Analysis** - [`Demo`](https:\u002F\u002Fyoutu.be\u002F-c9sSJcx6wI), [`React Demo part-i`](https:\u002F\u002Fyoutu.be\u002FIXoah6rhxac), [`React Demo part-ii`](https:\u002F\u002Fyoutu.be\u002F_waBA-cH2D4)\n\nYou can run deepface for real time videos as well. Stream function will access your webcam and apply both face recognition and facial attribute analysis. The function starts to analyze a frame if it can focus a face sequentially 5 frames. Then, it shows results 5 seconds.\n\n```python\nDeepFace.stream(db_path = \"C:\u002Fdatabase\")\n```\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fstock-3.jpg\" width=\"90%\">\u003C\u002Fp>\n\nEven though face recognition is based on one-shot learning, you can use multiple face pictures of a person as well. You should rearrange your directory structure as illustrated below.\n\n```bash\nuser\n├── database\n│   ├── Alice\n│   │   ├── Alice1.jpg\n│   │   ├── Alice2.jpg\n│   ├── Bob\n│   │   ├── Bob.jpg\n```\n\nIf you intend to perform face verification or analysis tasks directly from your browser, [`deepface-react-ui`](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface-react-ui) is a separate repository built using ReactJS depending on deepface api.\n\nHere, you can also find some real time demos for various facial recognition models:\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Frefs\u002Fheads\u002Fmaster\u002Ficon\u002Fdeepface-realtime.jpg\" width=\"90%\">\u003C\u002Fp>\n\n| Task                 | Model    | Demo                                    |\n| ---                  | ---      | ---                                     |\n| Facial Recognition   | DeepFace | [`Video`](https:\u002F\u002Fyoutu.be\u002FYjYIMs5ZOfc) |\n| Facial Recognition   | FaceNet  | [`Video`](https:\u002F\u002Fyoutu.be\u002FvB1I5vWgTQg) |\n| Facial Recognition   | VGG-Face | [`Video`](https:\u002F\u002Fyoutu.be\u002FtSU_lNi0gQQ) |\n| Facial Recognition   | OpenFace | [`Video`](https:\u002F\u002Fyoutu.be\u002F-4z2sL6wzP8) |\n| Age & Gender         | Default  | [`Video`](https:\u002F\u002Fyoutu.be\u002FtFI7vZn3P7E) |\n| Race & Ethnicity     | Default  | [`Video`](https:\u002F\u002Fyoutu.be\u002F-ztiy5eJha8) |\n| Emotion              | Default  | [`Video`](https:\u002F\u002Fyoutu.be\u002FY7DfLvLKScs) |\n| Celebrity Look-Alike | Default  | [`Video`](https:\u002F\u002Fyoutu.be\u002FRMgIKU1H8DY) |\n\n**Embeddings** - [`Tutorial`](https:\u002F\u002Fsefiks.com\u002F2025\u002F06\u002F28\u002Fwhat-are-vector-embeddings-and-why-they-matter-in-ai\u002F), [`Demo`](https:\u002F\u002Fyoutu.be\u002FOYialFo7Qo4)\n\nFace recognition models basically represent facial images as multi-dimensional vectors. Sometimes, you need those embedding vectors directly. DeepFace comes with a dedicated representation function.\n\n```python\nembedding_objs: List[dict] = DeepFace.represent(img_path = \"img.jpg\")\n```\n\nEmbeddings can be [plotted](https:\u002F\u002Fsefiks.com\u002F2020\u002F05\u002F01\u002Fa-gentle-introduction-to-face-recognition-in-deep-learning\u002F) as below. Each slot is corresponding to a dimension value and dimension value is emphasized with colors. Similar to 2D barcodes, vertical dimension stores no information in the illustration.\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fembedding.jpg\" width=\"95%\">\u003C\u002Fp>\n\nIn summary, the distance between vector embeddings of the same person should be smaller than that between embeddings of different people. When reduced to two-dimensional space, the clusters become clearly distinguishable.\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Frefs\u002Fheads\u002Fmaster\u002Ficon\u002Ffacenet-pca.png\" width=\"95%\">\u003C\u002Fp>\n\n**Face recognition models** - [`Demo`](https:\u002F\u002Fyoutu.be\u002FeKOZawGR3y0)\n\nDeepFace is a **hybrid** face recognition package. It currently wraps many **state-of-the-art** face recognition models: [`VGG-Face`](https:\u002F\u002Fsefiks.com\u002F2018\u002F08\u002F06\u002Fdeep-face-recognition-with-keras\u002F) , [`FaceNet`](https:\u002F\u002Fsefiks.com\u002F2018\u002F09\u002F03\u002Fface-recognition-with-facenet-in-keras\u002F), [`OpenFace`](https:\u002F\u002Fsefiks.com\u002F2019\u002F07\u002F21\u002Fface-recognition-with-openface-in-keras\u002F), [`DeepFace`](https:\u002F\u002Fsefiks.com\u002F2020\u002F02\u002F17\u002Fface-recognition-with-facebook-deepface-in-keras\u002F), [`DeepID`](https:\u002F\u002Fsefiks.com\u002F2020\u002F06\u002F16\u002Fface-recognition-with-deepid-in-keras\u002F), [`ArcFace`](https:\u002F\u002Fsefiks.com\u002F2020\u002F12\u002F14\u002Fdeep-face-recognition-with-arcface-in-keras-and-python\u002F), [`Dlib`](https:\u002F\u002Fsefiks.com\u002F2020\u002F07\u002F11\u002Fface-recognition-with-dlib-in-python\u002F), `SFace`, `GhostFaceNet` and `Buffalo_L`. The default configuration uses VGG-Face model.\n\n```python\nmodels = [\n    \"VGG-Face\", \"Facenet\", \"Facenet512\", \"OpenFace\", \"DeepFace\",\n    \"DeepID\", \"ArcFace\", \"Dlib\", \"SFace\", \"GhostFaceNet\",\n    \"Buffalo_L\",\n]\n\nresult = DeepFace.verify(\n  img1_path = \"img1.jpg\", img2_path = \"img2.jpg\", model_name = models[0]\n)\n\ndfs = DeepFace.find(\n  img_path = \"img1.jpg\", db_path = \"C:\u002Fmy_db\", model_name = models[1]\n)\n\nembeddings = DeepFace.represent(\n  img_path = \"img.jpg\", model_name = models[2]\n)\n```\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fmodel-portfolio-20240316.jpg\" width=\"95%\">\u003C\u002Fp>\n\nFaceNet, VGG-Face, ArcFace and Dlib are overperforming ones based on experiments - see [`BENCHMARKS`](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Ftree\u002Fmaster\u002Fbenchmarks) for more details. You can find the measured scores of various models in DeepFace and the reported scores from their original studies in the following table.\n\n| Model          | Measured Score | Declared Score     |\n| -------------- | -------------- | ------------------ |\n| Facenet512     | 98.4%          | 99.6%              |\n| Human-beings   | 97.5%          | 97.5%              |\n| Facenet        | 97.4%          | 99.2%              |\n| Dlib           | 96.8%          | 99.3 %             |\n| VGG-Face       | 96.7%          | 98.9%              |\n| ArcFace        | 96.7%          | 99.5%              |\n| GhostFaceNet   | 93.3%          | 99.7%              |\n| SFace          | 93.0%          | 99.5%              |\n| OpenFace       | 78.7%          | 92.9%              |\n| DeepFace       | 69.0%          | 97.3%              |\n| DeepID         | 66.5%          | 97.4%              |\n\nConducting experiments with those models within DeepFace may reveal disparities compared to the original studies, owing to the adoption of distinct detection or normalization techniques. Furthermore, some models have been released solely with their backbones, lacking pre-trained weights. Thus, we are utilizing their re-implementations instead of the original pre-trained weights.\n\n**Face Detection and Alignment** - [`Demo`](https:\u002F\u002Fyoutu.be\u002FGZ2p2hj2H5k)\n\nFace detection and alignment are important early stages of a modern face recognition pipeline. [Experiments](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Ftree\u002Fmaster\u002Fbenchmarks) show that detection increases the face recognition accuracy up to 42%, while alignment increases it up to 6%. [`OpenCV`](https:\u002F\u002Fsefiks.com\u002F2020\u002F02\u002F23\u002Fface-alignment-for-face-recognition-in-python-within-opencv\u002F), [`Ssd`](https:\u002F\u002Fsefiks.com\u002F2020\u002F08\u002F25\u002Fdeep-face-detection-with-opencv-in-python\u002F), [`Dlib`](https:\u002F\u002Fsefiks.com\u002F2020\u002F07\u002F11\u002Fface-recognition-with-dlib-in-python\u002F),  [`MtCnn`](https:\u002F\u002Fsefiks.com\u002F2020\u002F09\u002F09\u002Fdeep-face-detection-with-mtcnn-in-python\u002F), `Faster MtCnn`, [`RetinaFace`](https:\u002F\u002Fsefiks.com\u002F2021\u002F04\u002F27\u002Fdeep-face-detection-with-retinaface-in-python\u002F), [`MediaPipe`](https:\u002F\u002Fsefiks.com\u002F2022\u002F01\u002F14\u002Fdeep-face-detection-with-mediapipe\u002F), `Yolo`, `YuNet` and `CenterFace` detectors are wrapped in deepface.\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fdetector-portfolio-v6.jpg\" width=\"95%\">\u003C\u002Fp>\n\nAll deepface functions accept optional detector backend and align input arguments. You can switch among those detectors and alignment modes with these arguments. OpenCV is the default detector and alignment is on by default.\n\n```python\nbackends = [\n    'opencv', 'ssd', 'dlib', 'mtcnn', 'fastmtcnn',\n    'retinaface', 'mediapipe', 'yolov8n', 'yolov8m', \n    'yolov8l', 'yolov11n', 'yolov11s', 'yolov11m',\n    'yolov11l', 'yolov12n', 'yolov12s', 'yolov12m',\n    'yolov12l', 'yunet', 'centerface',\n]\ndetector = backends[3]\nalign = True\n\nobj = DeepFace.verify(\n  img1_path = \"img1.jpg\", img2_path = \"img2.jpg\", detector_backend = detector, align = align\n)\n\ndfs = DeepFace.find(\n  img_path = \"img.jpg\", db_path = \"my_db\", detector_backend = detector, align = align\n)\n\nembedding_objs = DeepFace.represent(\n  img_path = \"img.jpg\", detector_backend = detector, align = align\n)\n\ndemographies = DeepFace.analyze(\n  img_path = \"img4.jpg\", detector_backend = detector, align = align\n)\n\nface_objs = DeepFace.extract_faces(\n  img_path = \"img.jpg\", detector_backend = detector, align = align\n)\n```\n\nFace recognition models are actually CNN models and they expect standard sized inputs. So, resizing is required before representation. To avoid deformation, deepface adds black padding pixels according to the target size argument after detection and alignment.\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fdetector-outputs-20240414.jpg\" width=\"90%\">\u003C\u002Fp>\n\n[RetinaFace](https:\u002F\u002Fsefiks.com\u002F2021\u002F04\u002F27\u002Fdeep-face-detection-with-retinaface-in-python\u002F) and [MtCnn](https:\u002F\u002Fsefiks.com\u002F2020\u002F09\u002F09\u002Fdeep-face-detection-with-mtcnn-in-python\u002F) seem to overperform in detection and alignment stages but they are much slower. If the speed of your pipeline is more important, then you should use opencv or ssd. On the other hand, if you consider the accuracy, then you should use retinaface or mtcnn.\n\nThe performance of RetinaFace is very satisfactory even in the crowd as seen in the following illustration. Besides, it comes with an incredible facial landmark detection performance. Highlighted red points show some facial landmarks such as eyes, nose and mouth. That's why, alignment score of RetinaFace is high as well.\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fretinaface-results.jpeg\" width=\"90%\">\n\u003Cbr>\u003Cem>The Yellow Angels - Fenerbahce Women's Volleyball Team\u003C\u002Fem>\n\u003C\u002Fp>\n\nYou can find out more about RetinaFace on this [repo](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fretinaface).\n\n**Face Anti Spoofing** - [`Demo`](https:\u002F\u002Fyoutu.be\u002FUiK1aIjOBlQ)\n\nDeepFace also includes an anti-spoofing analysis module to understand given image is real or fake. To activate this feature, set the `anti_spoofing` argument to True in any DeepFace tasks.\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fface-anti-spoofing.jpg\" width=\"40%\">\u003C\u002Fp>\n\n```python\n# anti spoofing test in face detection\nface_objs = DeepFace.extract_faces(img_path=\"dataset\u002Fimg1.jpg\", anti_spoofing = True)\nassert all(face_obj[\"is_real\"] is True for face_obj in face_objs)\n\n# anti spoofing test in real time analysis\nDeepFace.stream(db_path = \"C:\u002Fdatabase\", anti_spoofing = True)\n```\n\n**Similarity** - [`Demo`](https:\u002F\u002Fyoutu.be\u002F1EPoS69fHOc)\n\nFace recognition models are regular [convolutional neural networks](https:\u002F\u002Fsefiks.com\u002F2018\u002F03\u002F23\u002Fconvolutional-autoencoder-clustering-images-with-neural-networks\u002F) and they are responsible to represent faces as vectors. We expect that a face pair of same person should be [more similar](https:\u002F\u002Fsefiks.com\u002F2020\u002F05\u002F22\u002Ffine-tuning-the-threshold-in-face-recognition\u002F) than a face pair of different persons.\n\nSimilarity could be calculated by different metrics such as [Cosine Similarity](https:\u002F\u002Fsefiks.com\u002F2018\u002F08\u002F13\u002Fcosine-similarity-in-machine-learning\u002F), Angular Distance, Euclidean Distance or L2 normalized Euclidean. The default configuration uses cosine similarity. According to [experiments](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Ftree\u002Fmaster\u002Fbenchmarks), no distance metric is overperforming than other.\n\n```python\nmetrics = [\"cosine\", \"euclidean\", \"euclidean_l2\", \"angular\"]\n\nresult = DeepFace.verify(\n  img1_path = \"img1.jpg\", img2_path = \"img2.jpg\", distance_metric = metrics[1]\n)\n\ndfs = DeepFace.find(\n  img_path = \"img1.jpg\", db_path = \"C:\u002Fmy_db\", distance_metric = metrics[2]\n)\n```\n\n**API** - [`Demo`](https:\u002F\u002Fyoutu.be\u002FHeKCQ6U9XmI), [`Docker Demo`](https:\u002F\u002Fyoutu.be\u002F9Tk9lRQareA)\n\nDeepFace serves an API as well - see [`api folder`](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Ftree\u002Fmaster\u002Fdeepface\u002Fapi\u002Fsrc) for more details. You can clone deepface source code and run the api with the following command. It will use gunicorn server to get a rest service up. In this way, you can call deepface from an external system such as mobile app or web.\n\n```shell\ncd scripts && .\u002Fservice.sh\n```\n\nAlternatively, you can run the dockerized service.\n\n```shell\ncd scripts && .\u002Fdockerize.sh\n```\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fdeepface-api.jpg\" width=\"90%\">\u003C\u002Fp>\n\nFace verification, facial attribute analysis, vector representation and register & search functions are covered in the API. The API accepts images as file uploads (via form data), or as exact image paths, URLs, or base64-encoded strings (via either JSON or form data).\n\n```shell\n$ curl -X POST http:\u002F\u002Flocalhost:5005\u002Frepresent \\\n   -d '{\"model_name\":\"Facenet\", \"img\":\"img1.jpg\"}'\n\n$ curl -X POST http:\u002F\u002Flocalhost:5005\u002Fverify \\\n   -d '{\"img1\":\"img1.jpg\", \"img2\":\"img3.jpg\"}'\n\n$ curl -X POST http:\u002F\u002Flocalhost:5005\u002Fanalyze \\\n   -d '{\"img\": \"img2.jpg\", \"actions\": [\"age\", \"gender\"]}'\n\n$ curl -X POST http:\u002F\u002Flocalhost:5005\u002Fregister \\\n   -d '{\"model_name\":\"Facenet\", \"img\":\"img18.jpg\"}'\n\n$ curl -X POST http:\u002F\u002Flocalhost:5005\u002Fsearch \\\n   -d '{\"img\":\"img1.jpg\", \"model_name\":\"Facenet\"}'\n```\n\n[`Here`](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Ftree\u002Fmaster\u002Fdeepface\u002Fapi\u002Fpostman), you can find a postman project to find out how these methods should be called.\n\n**Hosted DeepFace** [![deepface.dev](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F-deepface.dev-00BFFF?style=flat&labelColor=0A0A0A&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iMjU2IiBoZWlnaHQ9IjI1NiIgdmlld0JveD0iMCAwIDI1NiAyNTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI%2BCiAgPHRpdGxlPmRlZXBmYWNlLmRldiBsb2dvPC90aXRsZT4KICA8cmVjdCB3aWR0aD0iMjU2IiBoZWlnaHQ9IjI1NiIgcng9IjI0IiBmaWxsPSIjMEEwQTBBIi8%2BCgogIDxkZWZzPgogICAgPGZpbHRlciBpZD0ibmVvbi1nbG93IiB4PSItNTAlIiB5PSItNTAlIiB3aWR0aD0iMjAwJSIgaGVpZ2h0PSIyMDAlIj4KICAgICAgPGZlR2F1c3NpYW5CbHVyIGluPSJTb3VyY2VHcmFwaGljIiBzdGREZXZpYXRpb249IjQiIHJlc3VsdD0iYmx1ciIgLz4KICAgICAgPGZlTWVyZ2U%2BCiAgICAgICAgPGZlTWVyZ2VOb2RlIGluPSJibHVyIiAvPgogICAgICAgIDxmZU1lcmdlTm9kZSBpbj0iU291cmNlR3JhcGhpYyIgLz4KICAgICAgPC9mZU1lcmdlPgogICAgPC9maWx0ZXI%2BCiAgPC9kZWZzPgoKICA8dGV4dCB4PSI1MCUiIHk9IjUwJSIKICAgICAgICBkb21pbmFudC1iYXNlbGluZT0ibWlkZGxlIgogICAgICAgIHRleHQtYW5jaG9yPSJtaWRkbGUiCiAgICAgICAgZmlsbD0iIzAwQkZGRiIKICAgICAgICBmb250LXNpemU9IjExMCIKICAgICAgICBmb250LXdlaWdodD0iNTAwIgogICAgICAgIGZvbnQtZmFtaWx5PSInRmlyYSBDb2RlJywgJ1JvYm90byBNb25vJywgdWktbW9ub3NwYWNlLCBTRk1vbm8tUmVndWxhciwgTWVubG8sIE1vbmFjbywgQ29uc29sYXMsICdMaWJlcmF0aW9uIE1vbm8nLCAnQ291cmllciBOZXcnLCBtb25vc3BhY2UiCiAgICAgICAgZmlsdGVyPSJ1cmwoI25lb24tZ2xvdykiPgogICAge2RmfQogIDwvdGV4dD4KPC9zdmc%2BCg%3D%3D)](https:\u002F\u002Fdeepface.dev?source=deepface_repo)\n\nDon’t want to host and scale DeepFace yourself? [`deepface.dev`](https:\u002F\u002Fdeepface.dev?source=deepface_repo)\nprovides a managed API built on top of DeepFace.\n\n- One API for verification, embeddings, and vector comparison\n- Docs and machine-readable agent docs: [`docs.deepface.dev`](https:\u002F\u002Fdocs.deepface.dev?source=deepface_repo)\n- MCP endpoint: `https:\u002F\u002Fdeepface.dev\u002Fmcp` using a dedicated MCP key\n- Usage-based pricing that scales from testing to production\n\n**Encrypt Embeddings** - [`Demo with PHE`](https:\u002F\u002Fyoutu.be\u002F8VCu39jFZ7k), [`Tutorial for PHE`](https:\u002F\u002Fsefiks.com\u002F2025\u002F03\u002F04\u002Fvector-similarity-search-with-partially-homomorphic-encryption-in-python\u002F), [`Demo with FHE`](https:\u002F\u002Fyoutu.be\u002Fnjjw0PEhH00), [`Tutorial for FHE`](https:\u002F\u002Fsefiks.com\u002F2021\u002F12\u002F01\u002Fhomomorphic-facial-recognition-with-tenseal\u002F)\n\nVector embeddings, though not reversible, carry sensitive information like fingerprints, making their security crucial. Encrypting them prevents adversarial misuse. Traditional encryption (e.g., AES) is secure but unsuitable for cloud-based distance calculations.\n\n[Homomorphic encryption](https:\u002F\u002Fyoutu.be\u002F3ejI0zNPMEQ) allows computations on encrypted data without revealing content—ideal for secure cloud processing. For example, the cloud can compute encrypted similarity without knowing the data, while only the key holder can decrypt the result. See the  [`LightPHE`](https:\u002F\u002Fgithub.com\u002Fserengil\u002FLightPHE) library for partially homomorphic encryption.\n\n```python\nfrom lightphe import LightPHE\n\n# build an additively homomorphic cryptosystem (e.g. Paillier) on-prem\ncs = LightPHE(algorithm_name = \"Paillier\", precision = 19)\n\n# define encrypted and plain vectors\nencrypted_alpha = DeepFace.represent(\"source.jpg\", cryptosystem=cs)[0][\"encrypted_embedding\"]\nbeta = DeepFace.represent(\"target.jpg\")[0][\"embedding\"]\n\n# dot product of encrypted & plain embedding in cloud - private key not required\nencrypted_cosine_similarity = encrypted_alpha @ beta\n\n# decrypt similarity on-prem - private key required\ncalculated_similarity = cs.decrypt(encrypted_cosine_similarity)[0]\n\n# verification\nprint(\"same person\" if calculated_similarity >= 1 - threshold else \"different persons\")\n```\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Frefs\u002Fheads\u002Fmaster\u002Ficon\u002Fencrypt-embeddings.jpg\" width=\"60%\">\u003C\u002Fp>\n\nFor stronger privacy, fully homomorphic encryption enables dot product computations between encrypted embeddings, but it's far more computationally intensive. Explore [`CipherFace`](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fcipherface) for FHE-based approaches.\n\n### Extended Applications\n\nDeepFace can also be used for fun and insightful applications such as\n\n**Find Your Celebrity Look-Alike** - [`Demo`](https:\u002F\u002Fyoutu.be\u002FjaxkEn-Kieo), [`Real-Time Demo`](https:\u002F\u002Fyoutu.be\u002FRMgIKU1H8DY), [`Tutorial`](https:\u002F\u002Fsefiks.com\u002F2019\u002F05\u002F05\u002Fcelebrity-look-alike-face-recognition-with-deep-learning-in-keras\u002F)\n\nDeepFace can analyze your facial features and match them with celebrities, letting you discover which famous personality you resemble the most.\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fcelebrity-look-alike.jpg\" width=\"55%\">\u003C\u002Fp>\n\n**Find Which Parent a Child Look More** - [`Demo`](https:\u002F\u002Fyoutu.be\u002Fnza4tmi9vhE), [`Tutorial`](https:\u002F\u002Fsefiks.com\u002F2022\u002F12\u002F22\u002Fdecide-whom-your-child-looks-like-with-facial-recognition-mommy-or-daddy\u002F)\n\nDeepFace can also be used to compare a child's face to their parents' or relatives' faces to determine which one the child resembles more.\n\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fparental-look-alike-scaled.jpg\" width=\"90%\">\u003C\u002Fp>\n\n## Contribution\n\nPull requests are more than welcome! If you are planning to contribute a large patch, please create an issue first to get any upfront questions or design decisions out of the way first.\n\nBefore creating a PR, you should run the unit tests and linting locally by running `make test && make lint` command. Once a PR sent, GitHub test workflow will be run automatically and unit test and linting jobs will be available in [GitHub actions](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Factions) before approval.\n\n## Support\n\nThere are many ways to support a project - starring⭐️ the GitHub repo is just one 🙏 It really helps the project get discovered by more people.\n\nIf you do like this work, then you can support it financially on [Patreon](https:\u002F\u002Fwww.patreon.com\u002Fserengil?repo=deepface), [GitHub Sponsors](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fserengil) or [Buy Me a Coffee](https:\u002F\u002Fbuymeacoffee.com\u002Fserengil).\n\n\u003Ca href=\"https:\u002F\u002Fwww.patreon.com\u002Fserengil?repo=deepface\">\n\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fserengil\u002Fdeepface\u002Fmaster\u002Ficon\u002Fpatreon.png\" width=\"30%\">\n\u003C\u002Fa>\n\n## Citation\n\nPlease cite deepface in your publications if it helps your research.\n\n\u003Cdetails open>\n  \u003Csummary>S. I. Serengil and A. Ozpinar, \u003Cb>Boosted LightFace: A Hybrid DNN and GBM Model for Boosted Facial Recognition\u003C\u002Fb>, \u003Ci>Gazi University Journal of Science\u003C\u002Fi>, vol. 39, no. 1, pp. 452-466, 2026.\u003C\u002Fsummary>\n\n  ```BibTeX\n  @article{serengil2026boosted,\n    title     =  {Boosted LightFace: A Hybrid DNN and GBM Model for Boosted Facial Recognition},\n    author    =  {Serengil, Sefik Ilkin and Ozpinar, Alper},\n    journal   =  {Gazi University Journal of Science},\n    volume    =  {39},\n    number    =  {1},\n    pages     =  {452-466},\n    year      =  {2026},\n    doi       =  {10.35378\u002Fgujs.1794891},\n    url       =  {https:\u002F\u002Fdergipark.org.tr\u002Fen\u002Fpub\u002Fgujs\u002Farticle\u002F1794891},\n    publisher =  {Gazi University}\n  }\n  ```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n  \u003Csummary>S. Serengil and A. Ozpinar, \u003Cb>\"A Benchmark of Facial Recognition Pipelines and Co-Usability Performances of Modules\"\u003C\u002Fb>, \u003Ci>Journal of Information Technologies\u003C\u002Fi>, vol. 17, no. 2, pp. 95-107, 2024.\u003C\u002Fsummary>\n  \n  ```BibTeX\n  @article{serengil2024lightface,\n    title     = {A Benchmark of Facial Recognition Pipelines and Co-Usability Performances of Modules},\n    author    = {Serengil, Sefik and Ozpinar, Alper},\n    journal   = {Journal of Information Technologies},\n    volume    = {17},\n    number    = {2},\n    pages     = {95-107},\n    year      = {2024},\n    doi       = {10.17671\u002Fgazibtd.1399077},\n    url       = {https:\u002F\u002Fdergipark.org.tr\u002Fen\u002Fpub\u002Fgazibtd\u002Fissue\u002F84331\u002F1399077},\n    publisher = {Gazi University}\n  }\n  ```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n  \u003Csummary>S. I. Serengil and A. Ozpinar, \u003Cb>\"HyperExtended LightFace: A Facial Attribute Analysis Framework\"\u003C\u002Fb>, \u003Ci>2021 International Conference on Engineering and Emerging Technologies (ICEET)\u003C\u002Fi>, 2021, pp. 1-4.\u003C\u002Fsummary>\n  \n  ```BibTeX\n  @inproceedings{serengil2021lightface,\n    title        = {HyperExtended LightFace: A Facial Attribute Analysis Framework},\n    author       = {Serengil, Sefik Ilkin and Ozpinar, Alper},\n    booktitle    = {2021 International Conference on Engineering and Emerging Technologies (ICEET)},\n    pages        = {1-4},\n    year         = {2021},\n    doi          = {10.1109\u002FICEET53442.2021.9659697},\n    url          = {https:\u002F\u002Fieeexplore.ieee.org\u002Fdocument\u002F9659697},\n    organization = {IEEE}\n  }\n  ```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n  \u003Csummary>S. I. Serengil and A. Ozpinar, \u003Cb>\"LightFace: A Hybrid Deep Face Recognition Framework\"\u003C\u002Fb>, \u003Ci>2020 Innovations in Intelligent Systems and Applications Conference (ASYU)\u003C\u002Fi>, 2020, pp. 23-27.\u003C\u002Fsummary>\n  \n  ```BibTeX\n  @inproceedings{serengil2020lightface,\n    title        = {LightFace: A Hybrid Deep Face Recognition Framework},\n    author       = {Serengil, Sefik Ilkin and Ozpinar, Alper},\n    booktitle    = {2020 Innovations in Intelligent Systems and Applications Conference (ASYU)},\n    pages        = {23-27},\n    year         = {2020},\n    doi          = {10.1109\u002FASYU50717.2020.9259802},\n    url          = {https:\u002F\u002Fieeexplore.ieee.org\u002Fdocument\u002F9259802},\n    organization = {IEEE}\n  }\n  ```\n\u003C\u002Fdetails>\n\nAlso, if you use deepface in your GitHub projects, please add `deepface` in the `requirements.txt`.\n\n## Licence\n\nDeepFace is licensed under the MIT License - see [`LICENSE`](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fdeepface\u002Fblob\u002Fmaster\u002FLICENSE) for more details.\n\nDeepFace wraps some external face recognition models: [VGG-Face](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fsoftware\u002Fvgg_face\u002F), [Facenet](https:\u002F\u002Fgithub.com\u002Fdavidsandberg\u002Ffacenet\u002Fblob\u002Fmaster\u002FLICENSE.md) (both 128d and 512d), [OpenFace](https:\u002F\u002Fgithub.com\u002Fiwantooxxoox\u002FKeras-OpenFace\u002Fblob\u002Fmaster\u002FLICENSE), [DeepFace](https:\u002F\u002Fgithub.com\u002Fswghosh\u002FDeepFace), [DeepID](https:\u002F\u002Fgithub.com\u002FRuoyiran\u002FDeepID\u002Fblob\u002Fmaster\u002FLICENSE.md), [ArcFace](https:\u002F\u002Fgithub.com\u002Fleondgarse\u002FKeras_insightface\u002Fblob\u002Fmaster\u002FLICENSE), [Dlib](https:\u002F\u002Fgithub.com\u002Fdavisking\u002Fdlib\u002Fblob\u002Fmaster\u002Fdlib\u002FLICENSE.txt), [SFace](https:\u002F\u002Fgithub.com\u002Fopencv\u002Fopencv_zoo\u002Fblob\u002Fmaster\u002Fmodels\u002Fface_recognition_sface\u002FLICENSE), [GhostFaceNet](https:\u002F\u002Fgithub.com\u002FHamadYA\u002FGhostFaceNets\u002Fblob\u002Fmain\u002FLICENSE) and\n[Buffalo_L](https:\u002F\u002Fgithub.com\u002Fdeepinsight\u002Finsightface\u002Fblob\u002Fmaster\u002FREADME.md). Besides, age, gender and race \u002F ethnicity models were trained on the backbone of VGG-Face with transfer learning. Similarly, DeepFace wraps many face detectors: [OpenCv](https:\u002F\u002Fgithub.com\u002Fopencv\u002Fopencv\u002Fblob\u002F4.x\u002FLICENSE), [Ssd](https:\u002F\u002Fgithub.com\u002Fopencv\u002Fopencv\u002Fblob\u002Fmaster\u002FLICENSE), [Dlib](https:\u002F\u002Fgithub.com\u002Fdavisking\u002Fdlib\u002Fblob\u002Fmaster\u002FLICENSE.txt), [MtCnn](https:\u002F\u002Fgithub.com\u002Fipazc\u002Fmtcnn\u002Fblob\u002Fmaster\u002FLICENSE), [Fast MtCnn](https:\u002F\u002Fgithub.com\u002Ftimesler\u002Ffacenet-pytorch\u002Fblob\u002Fmaster\u002FLICENSE.md), [RetinaFace](https:\u002F\u002Fgithub.com\u002Fserengil\u002Fretinaface\u002Fblob\u002Fmaster\u002FLICENSE), [MediaPipe](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmediapipe\u002Fblob\u002Fmaster\u002FLICENSE), [YuNet](https:\u002F\u002Fgithub.com\u002FShiqiYu\u002Flibfacedetection\u002Fblob\u002Fmaster\u002FLICENSE), [Yolo](https:\u002F\u002Fgithub.com\u002Fultralytics\u002Fultralytics\u002Fblob\u002Fmain\u002FLICENSE) and [CenterFace](https:\u002F\u002Fgithub.com\u002FStar-Clouds\u002FCenterFace\u002Fblob\u002Fmaster\u002FLICENSE). Finally, DeepFace is optionally using [face anti spoofing](https:\u002F\u002Fgithub.com\u002Fminivision-ai\u002FSilent-Face-Anti-Spoofing\u002Fblob\u002Fmaster\u002FLICENSE) to determine the given images are real or fake. License types will be inherited when you intend to utilize those models. Please check the license types of those models for production purposes.\n\nDeepFace [logo](https:\u002F\u002Fthenounproject.com\u002Fterm\u002Fface-recognition\u002F2965879\u002F) is created by [Adrien Coquet](https:\u002F\u002Fthenounproject.com\u002Fcoquet_adrien\u002F) and it is licensed under [Creative Commons: By Attribution 3.0 License](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F3.0\u002F).\n","DeepFace 是一个轻量级的面部识别和面部属性分析库，支持年龄、性别、情绪和种族的预测。它基于Python开发，集成了多种深度学习模型如VGG-Face、Facenet等，能够提供高精度的人脸识别与分析功能。项目具备易于集成的特点，并且支持多种预训练模型的选择，适用于需要进行人脸验证、识别以及属性分析的应用场景，比如安防监控、用户身份认证、市场调研等领域。此外，DeepFace还提供了详细的文档和示例代码，便于开发者快速上手使用。","2026-06-11 02:49:36","top_language"]