Giter VIP home page Giter VIP logo

astrotomic / php-deepface Goto Github PK

View Code? Open in Web Editor NEW
24.0 3.0 1.0 54 KB

A PHP adapter for the python deepface framework.

Home Page: https://github.com/serengil/deepface

License: MIT License

Python 8.43% PHP 91.57%
age-prediction arcface deep-learning deepface deepid emotion-recognition face-analysis face-recognition facenet facial-expression-recognition facial-recognition gender-prediction hacktoberfest machine-learning openface race-classification treeware vgg-face

php-deepface's Introduction

PHP DeepFace: Advanced Face Recognition for PHP

Latest Version MIT License Offset Earth Larabelles

PHP Version Symfony Version

pint Total Downloads Trees Carbon GitHub Sponsors

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

To get started, you'll need to install the deepface 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

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

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

Build Model

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

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

Face Detection

Perform face detection and alignment using this function:

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

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

Find identities in a database by applying verification multiple times:

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

Face Embeddings

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

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

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

Run tests to ensure everything is working as expected:

composer fix

Contributing

We welcome contributions! Please see our CONTRIBUTING guidelines for details. You may also want to review our CODE OF CONDUCT.

Security

If you discover any security-related issues, please follow the steps outlined in our SECURITY guidelines to report them.

Credits

License

PHP DeepFace is released under the MIT License. Please see the License File for more information.

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. Help us make a positive impact! ๐ŸŒณ

php-deepface's People

Contributors

dependabot[bot] avatar gummibeer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

richardfrankza

php-deepface's Issues

Unknown named parameter $left_eye

Thanks for this adapter, I have been trying to give it a go in my project however after setting up the Python environment that is required it gives me an error "Unknown named parameter $left_eye" when I try

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

Stack shows the error is at ../vendor/astrotomic/php-deepface/src/DeepFace.php:184

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.