PHPackages                             tourze/face-detect-bundle - 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. tourze/face-detect-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

tourze/face-detect-bundle
=========================

基于百度AI的人脸识别和校验模块

0.0.1(5mo ago)00MITPHPCI passing

Since Nov 18Pushed 4mo agoCompare

[ Source](https://github.com/tourze/face-detect-bundle)[ Packagist](https://packagist.org/packages/tourze/face-detect-bundle)[ RSS](/packages/tourze-face-detect-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (34)Versions (2)Used By (0)

Face Detection Bundle
=====================

[](#face-detection-bundle)

[![Build Status](https://camo.githubusercontent.com/b0c6c6845a74cb65a7f0a32bdcfd8fbf80eeb40026c4029af424ab371c94b8bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c642d70617373696e672d627269676874677265656e)](https://github.com/tourze/php-monorepo)[![Code Coverage](https://camo.githubusercontent.com/08f9e2cc3cc2ac54c1a3318cd1fc74d87e564fe653e479f69ca8a42ee4821c98/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d39352532352d627269676874677265656e)](https://github.com/tourze/php-monorepo)[![PHP Version](https://camo.githubusercontent.com/351755b1ea3b8a079461d461cd8142582eb91df14fea214307a660632576b07a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e312532422d626c7565)](https://www.php.net/)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)[![Symfony](https://camo.githubusercontent.com/33a5e824390f438bb5fe07f4315c72ae93f454cb2cc8fa45be6892624c1c06b9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d362e342532422d626c61636b)](https://symfony.com/)

[English](README.md) | [中文](README.zh-CN.md)

A comprehensive face detection and verification module for Symfony applications, supporting face profile management, verification strategies, and integration with various AI services like Baidu AI.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Core Components](#core-components)
- [Configuration](#configuration)
- [Advanced Usage](#advanced-usage)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)

Features
--------

[](#features)

- 🎯 **Face Profile Management** - Complete lifecycle management of face profiles
- 🔐 **Verification Strategies** - Flexible and configurable verification rules
- 📊 **Operation Logging** - Detailed operation tracking and status management
- 🤖 **AI Integration** - Support for Baidu AI and other face detection services
- 📋 **Admin Interface** - EasyAdmin-based management dashboard
- 🧪 **Comprehensive Testing** - 1100+ test cases with &gt;95% coverage

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

[](#installation)

```
composer require tourze/face-detect-bundle
```

Quick Start
-----------

[](#quick-start)

### Step 1: Register the Bundle

[](#step-1-register-the-bundle)

```
// config/bundles.php
return [
    // ...
    Tourze\FaceDetectBundle\FaceDetectBundle::class => ['all' => true],
];
```

### Step 2: Update Database Schema

[](#step-2-update-database-schema)

```
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
```

### Step 3: Configure Services

[](#step-3-configure-services)

The bundle automatically registers all services. You can configure them in your `services.yaml`:

```
# config/services.yaml
services:
    # Custom face detection service implementations
    App\Service\CustomFaceDetectionService:
        # Your implementation
```

Core Components
---------------

[](#core-components)

### Entities

[](#entities)

- **FaceProfile** - Face profile storage with expiration and status management
- **VerificationStrategy** - Configurable verification rules and priorities
- **VerificationRecord** - Detailed verification attempt logging
- **OperationLog** - Business operation tracking
- **StrategyRule** - Fine-grained verification rules

### Enums

[](#enums)

- **FaceProfileStatus** - Active, Expired, Disabled
- **VerificationResult** - Success, Failed, Skipped, Timeout
- **VerificationType** - Required, Optional, Forced
- **OperationStatus** - Pending, Processing, Completed, Failed, Cancelled

### Services

[](#services)

- **AdminMenu** - EasyAdmin menu integration
- Repository classes for all entities with comprehensive query methods

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

[](#configuration)

### Basic Configuration

[](#basic-configuration)

```
# config/packages/face_detect.yaml
face_detect:
    # Configuration will be expanded based on your needs
```

### Verification Strategies

[](#verification-strategies)

Create verification strategies programmatically:

```
use Tourze\FaceDetectBundle\Entity\VerificationStrategy;

$strategy = new VerificationStrategy();
$strategy->setName('high_security')
    ->setBusinessType('payment')
    ->setDescription('High security verification for payments')
    ->setEnabled(true)
    ->setPriority(100)
    ->setConfig([
        'max_attempts' => 3,
        'timeout' => 30,
        'confidence_threshold' => 0.8
    ]);
```

Advanced Usage
--------------

[](#advanced-usage)

### Face Profile Management

[](#face-profile-management)

```
use Tourze\FaceDetectBundle\Entity\FaceProfile;
use Tourze\FaceDetectBundle\Enum\FaceProfileStatus;

// Create a new face profile
$profile = new FaceProfile('user123', 'encrypted_face_features');
$profile->setQualityScore(0.95)
    ->setCollectionMethod('auto')
    ->setStatus(FaceProfileStatus::ACTIVE)
    ->setExpiresAfter(new \DateInterval('P1Y')); // Expires in 1 year
```

### Operation Tracking

[](#operation-tracking)

```
use Tourze\FaceDetectBundle\Entity\OperationLog;
use Tourze\FaceDetectBundle\Enum\OperationStatus;

// Create operation log
$operation = new OperationLog('user123', 'op_12345', 'payment_verification');
$operation->setVerificationRequired(true)
    ->setMinVerificationCount(2)
    ->setBusinessContext(['amount' => 1000, 'currency' => 'USD']);
```

### Verification Records

[](#verification-records)

```
use Tourze\FaceDetectBundle\Entity\VerificationRecord;
use Tourze\FaceDetectBundle\Enum\VerificationResult;

// Log verification attempt
$record = new VerificationRecord(
    'user123',
    $strategy,
    'payment',
    VerificationResult::SUCCESS
);
$record->setConfidenceScore(0.92)
    ->setVerificationTime(1.5)
    ->setClientInfo(['device' => 'iPhone', 'browser' => 'Safari']);
```

Testing
-------

[](#testing)

Run the test suite:

```
# Run all tests
./vendor/bin/phpunit packages/face-detect-bundle/tests

# Run with coverage
./vendor/bin/phpunit packages/face-detect-bundle/tests --coverage-html coverage

# Run specific test category
./vendor/bin/phpunit packages/face-detect-bundle/tests/Unit
./vendor/bin/phpunit packages/face-detect-bundle/tests/Integration
```

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

[](#contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance77

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

172d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e354fdb316da535dfa8ba2e9193a473c403b6bc6fb9170778d1dc50e304c6e9d?d=identicon)[tourze](/maintainers/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (3 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-face-detect-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-face-detect-bundle/health.svg)](https://phpackages.com/packages/tourze-face-detect-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M646](/packages/sylius-sylius)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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