PHPackages                             astrotomic/php-deepface - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. astrotomic/php-deepface

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

astrotomic/php-deepface
=======================

A PHP adapter for the python deepface framework.

0.5.0(3d ago)5410.1k↓42.2%13[2 issues](https://github.com/Astrotomic/php-deepface/issues)[1 PRs](https://github.com/Astrotomic/php-deepface/pulls)1MITPHPPHP ^8.1CI passing

Since Oct 10Pushed 3d ago3 watchersCompare

[ Source](https://github.com/Astrotomic/php-deepface)[ Packagist](https://packagist.org/packages/astrotomic/php-deepface)[ Docs](https://github.com/Gummibeer/php-deepface)[ Fund](https://forest.astrotomic.info)[ GitHub Sponsors](https://github.com/Gummibeer)[ RSS](/packages/astrotomic-php-deepface/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (7)Dependencies (6)Versions (13)Used By (1)

PHP DeepFace: Advanced Face Recognition for PHP
===============================================

[](#php-deepface-advanced-face-recognition-for-php)

[![Latest Version](https://camo.githubusercontent.com/601f863e7ec6ccdccb85195cb6f0af8adc36dbf186d86e0e7e8ca379211c34db/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617374726f746f6d69632f7068702d64656570666163652e7376673f6c6162656c3d52656c65617365267374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/astrotomic/php-deepface)[![MIT License](https://camo.githubusercontent.com/dc3e3b181ba16c1ae51a4ec1bdd068d8276e99268633f500684770799fccb3b7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f417374726f746f6d69632f7068702d64656570666163652e7376673f6c6162656c3d4c6963656e736526636f6c6f723d626c7565267374796c653d666f722d7468652d6261646765)](https://github.com/Astrotomic/php-deepface/blob/master/LICENSE)[![Offset Earth](https://camo.githubusercontent.com/d204555ebe1fb0ae82d10c97b4f4ffc2dfdd2ba1489f98be7f7e8708333a0466/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d677265656e3f7374796c653d666f722d7468652d6261646765)](https://plant.treeware.earth/Astrotomic/php-deepface)[![Larabelles](https://camo.githubusercontent.com/a2c8d5126ddd8c5ddc627176d1d2e0568f8399b50038e71fd7f774c3e24dbe4b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726162656c6c65732d2546302539462541362538342d6c6967687470696e6b3f7374796c653d666f722d7468652d6261646765)](https://www.larabelles.com/)

[![PHP Version](https://camo.githubusercontent.com/b4c7f362dd9c1ed812e6d623cf6f188bf1325ab1cf876fda21754d866dd7e9e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f617374726f746f6d69632f7068702d64656570666163652f7068703f7374796c653d666c61742d737175617265266c6162656c3d504850)](https://packagist.org/packages/astrotomic/php-deepface)[![Symfony Version](https://camo.githubusercontent.com/c656aa300e852a0041e6b53ade2e2cff3cc75c7806b32db12a008cde8b721bb7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f617374726f746f6d69632f7068702d64656570666163652f73796d666f6e792f70726f636573733f7374796c653d666c61742d737175617265266c6162656c3d53796d666f6e79)](https://packagist.org/packages/astrotomic/php-deepface)

[![pint](https://camo.githubusercontent.com/c8bc7412be68f706bc4ad03916f7a19ec2d4fab60739203604dd1cdb61d365fe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f417374726f746f6d69632f7068702d64656570666163652f70696e742e796d6c3f7374796c653d666c61742d737175617265266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465266c6162656c3d4353)](https://github.com/Astrotomic/php-deepface/actions/workflows/pint.yml)[![Total Downloads](https://camo.githubusercontent.com/466036f3535bebd7acee49a019c0e1d422fdcabd49ffbb1d3c3692d284c7533f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617374726f746f6d69632f7068702d64656570666163652e7376673f6c6162656c3d446f776e6c6f616473267374796c653d666c61742d737175617265)](https://packagist.org/packages/astrotomic/php-deepface)[![Trees](https://camo.githubusercontent.com/30a687052ae52569e61599df293106358841d23b10a0572e1a09a1ac7cbf29c1/68747470733a2f2f696d672e736869656c64732e696f2f65636f6c6f67692f74726565732f617374726f746f6d69633f7374796c653d666c61742d737175617265)](https://forest.astrotomic.info)[![Carbon](https://camo.githubusercontent.com/d5b19c9ce2c29985e110c72aa3527f133716764c385994714774e253267e03bf/68747470733a2f2f696d672e736869656c64732e696f2f65636f6c6f67692f636172626f6e2f617374726f746f6d69633f7374796c653d666c61742d737175617265)](https://forest.astrotomic.info)[![GitHub Sponsors](https://camo.githubusercontent.com/5a4df6236c7c62b05deec57f4b5852037951cc9c034b32fc7cf9e573a86b5bf9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73706f6e736f72732f67756d6d69626565723f7374796c653d666c61742d737175617265)](https://github.com/sponsors/Gummibeer)

Welcome to PHP DeepFace, a powerful face recognition and facial attribute analysis package for PHP. With PHP DeepFace, you can effortlessly integrate cutting-edge deep learning models into your PHP applications for a wide range of face-related tasks. Here's how you can get started:

Installation
------------

[](#installation)

To get started, you'll need to install the [deepface](https://github.com/serengil/deepface/tree/master#installation--) Python framework. You can do this using pip:

```
pip install deepface
```

Once you've installed deepface, you can then install the PHP adapter via Composer:

```
composer require astrotomic/php-deepface
```

Configuration
-------------

[](#configuration)

Configuring PHP DeepFace is a breeze. Simply instantiate the `Astrotomic\DeepFace\DeepFace` class, and it will automatically detect your local Python executable:

```
$deepface = new \Astrotomic\DeepFace\DeepFace();
```

If you have a specific Python version you'd like to use, you can provide the path to the Python executable as an argument:

```
$deepface = new \Astrotomic\DeepFace\DeepFace(
    python: '/usr/bin/python3',
);
```

Usage
-----

[](#usage)

PHP DeepFace provides a wide range of functionalities for face recognition and facial attribute analysis. Here are some key features:

### Build Model

[](#build-model)

You can build a deepface face recognition or facial attribute model with ease:

```
$deepface->buildModel(\Astrotomic\DeepFace\Enums\FaceRecognitionModel::VGGFACE);
```

### Face Detection

[](#face-detection)

Perform face detection and alignment using this function:

```
$deepface->extractFaces(
  img_path: '~/test.png',
);
```

### Face Verification

[](#face-verification)

Verify whether two images belong to the same person or different persons. This function calculates the similarity between facial image vectors:

```
$deepface->verify(
  img1_path: '~/test.png',
  img2_path: '~/id.jpg',
);
```

### Face Recognition

[](#face-recognition)

Find identities in a database by applying verification multiple times:

```
$deepface->find(
  img_path: '~/test.png',
  db_path: '~/db',
);
```

### Face Embeddings

[](#face-embeddings)

Generate vector embeddings for facial images using convolutional neural networks models:

```
$deepface->represent(
  img_path: '~/test.png',
);
```

### Facial Attribute Analysis

[](#facial-attribute-analysis)

Analyze facial attributes including age, gender, emotion, and race. This function builds convolutional neural network models to classify these attributes:

```
$deepface->analyze(
  img_path: '~/test.png',
);
```

Testing
-------

[](#testing)

Run tests to ensure everything is working as expected:

```
composer fix
```

Contributing
------------

[](#contributing)

We welcome contributions! Please see our [CONTRIBUTING](https://github.com/Astrotomic/.github/blob/master/CONTRIBUTING.md) guidelines for details. You may also want to review our [CODE OF CONDUCT](https://github.com/Astrotomic/.github/blob/master/CODE_OF_CONDUCT.md).

### Security

[](#security)

If you discover any security-related issues, please follow the steps outlined in our [SECURITY](https://github.com/Astrotomic/.github/blob/master/SECURITY.md) guidelines to report them.

Credits
-------

[](#credits)

- [Tom Herrmann](https://github.com/Gummibeer)
- [Sefik Ilkin Serengil](https://github.com/serengil), the creator of [deepface](https://github.com/serengil/deepface)
- [All Contributors](../../contributors)

License
-------

[](#license)

PHP DeepFace is released under the MIT License. Please see the [License File](LICENSE.md) for more information.

Treeware
--------

[](#treeware)

You're free to use this package, but if it makes it to your production environment, we kindly request that you contribute to a greener world by planting a tree. Trees play a vital role in combating climate change and preserving our environment. You can buy trees at [offset.earth/treeware](https://plant.treeware.earth/Astrotomic/php-deepface). Help us make a positive impact! 🌳

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance98

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~165 days

Recently: every ~184 days

Total

7

Last Release

3d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6187884?v=4)[Tom Herrmann](/maintainers/Gummibeer)[@Gummibeer](https://github.com/Gummibeer)

---

Top Contributors

[![Gummibeer](https://avatars.githubusercontent.com/u/6187884?v=4)](https://github.com/Gummibeer "Gummibeer (51 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![pablo-gbr](https://avatars.githubusercontent.com/u/45113563?v=4)](https://github.com/pablo-gbr "pablo-gbr (4 commits)")[![AdaiasMagdiel](https://avatars.githubusercontent.com/u/22068596?v=4)](https://github.com/AdaiasMagdiel "AdaiasMagdiel (1 commits)")[![richardfrankza](https://avatars.githubusercontent.com/u/17523844?v=4)](https://github.com/richardfrankza "richardfrankza (1 commits)")

---

Tags

age-predictionarcfacedeep-learningdeepfacedeepidemotion-recognitionface-analysisface-recognitionfacenetfacial-expression-recognitionfacial-recognitiongender-predictionhacktoberfestmachine-learningopenfacerace-classificationtreewarevgg-faceFacial Recognitionface-recognitionopenfacefacenetface-analysisfacial-expression-recognitionemotion-recognitionage-predictiongender-predictiondeepidvgg-facedeepfacearcfacerace-classification

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/astrotomic-php-deepface/health.svg)

```
[![Health](https://phpackages.com/badges/astrotomic-php-deepface/health.svg)](https://phpackages.com/packages/astrotomic-php-deepface)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.2k](/packages/friendsofphp-php-cs-fixer)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[phpactor/phpactor

PHP refactoring and intellisense tool for text editors

1.9k17.1k1](/packages/phpactor-phpactor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
