PHPackages                             costa92/face - 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. [Image &amp; Media](/categories/media)
4. /
5. costa92/face

ActivePackage[Image &amp; Media](/categories/media)

costa92/face
============

face++ 人脸识别功能

5211[1 issues](https://github.com/costa92/face/issues)PHP

Since Dec 19Pushed 9y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

face
====

[](#face)

> 本版本可以用于使用的旷视平台的人工智能开发平台

安装
==

[](#安装)

1.安装包文件

```
  composer require costa92/face
```

\#配置 laravel 应用 1.注册 ServiceProvider:

```
   Costa92\Face\FaceServiceProvider::class,
```

2. 创建配置文件：

```
   php artisan vendor:publish
```

3. 请修改应用根目录下的 `config/face.php` 中对应的项即可；
4. （可选）添加外观到 `config/app.php` 中的 `aliases` 部分:

```
'Face' => Costa92\Face\FaceServiceProvider::class,
```

5. 在 ENV 中配置以下选项：

```
FACE_API_KEY =xxxxxx
FACE_API_SECRET =xxxxx

```

6.使用

1.detect 方法 平台接口地址

```
/**
  * 分析图片是否为人脸图片
  * @param $img_url
  * @param string $parems   smiling,gender,age
  * $param float $type  true:image_url(网络地址)  false:image_file(本地路径)默认是true
  * @return array|bool|mixed
  */

  Face::detect($img_url,'miling,gender,age');

```

2.compare 方法 平台接口地址

```
/**
     *
     * 将两个人脸进行比对，来判断是否为同一个人。支持传两张图片进行比对，或者一张图片与一个已知的face_token比对，也支持两个face_token进行比对。使用图片进行比对时会选取图片中检测到人脸尺寸最大的一个人脸。
     * @param $first_img   值
     * @param $first_type  1:face_token1 ,2:image_url1 3:image_file1
     * @param $second_img  值
     * @param $second_type 1:face_token2 ,2:image_url2 3:image_file2
     * @return array|mixed
     */
     Face::compare($first_img,$first_type,$second_img,$second_type);

```

3.search 方法 平台接口地址

```
/**
     *
     * 在Faceset中找出与目标人脸最相似的一张或多张人脸。支持传入face_token或者直接传入图片进行人脸搜索。使用图片进行比对时会选取图片中检测到人脸尺寸最大的一个人脸。
     * @param $search_img
     * @param $img_type 1:face_token ,2:image_url 3:image_file
     * @param $ident  true:faceset_token,false:outer_id
     * $param $return_result_count int 返回比对置信度最高的n个结果，范围[1,5]。默认值为1
     * @param $ident_type
     */

     Face::search($search_img,$img_type,$ident,$ident_type=true,$return_result_count=1);

```

.....

后面还有接口的，都封装好了，这里就不每一个方法都写了！可以去代码中看，都有详细的文字说明

License
-------

[](#license)

MIT

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8148c7f8ba4894af278e4a028c6efb32f14b4c63dd4749c969245c4b55eb06e3?d=identicon)[costa92](/maintainers/costa92)

---

Top Contributors

[![costa92](https://avatars.githubusercontent.com/u/10903903?v=4)](https://github.com/costa92 "costa92 (1 commits)")

### Embed Badge

![Health badge](/badges/costa92-face/health.svg)

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

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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