承接 sensimedia/facial 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sensimedia/facial

最新稳定版本:0.6.4

Composer 安装命令:

composer require sensimedia/facial

包简介

PHP class to detect one face in images. A pure PHP port of an existing JS code from Karthik Tharavad.

README 文档

README

This class can detect one face in images ATM.

This is a pure PHP port of existing JS code from Karthik Tharavaad.

Since the package was abandoned by the original author, I forked it and upgraded it to be compatible with PHP 8.2.

Requirements

PHP8.2 or higher with GD

License

GNU GPL v2 (See LICENSE.txt)

Installation

Composer (recommended):

$ composer require sensimedia/facial

Usage

<?php

use Sensi\Facial\Detector;

$detector = new Detector;
$detectable = $detector->fromFile('/path/to/file');
var_dump($detectable->hasFace()); // true or false
if ($detectable->hasFace()) {
    $resource = $detectable->getFace();
} else {
    $resource = $detectable->getSource();
}
// Outputs either the face, or the original image if no face was found.
imagejpeg($resource);

Additionally, you may also use the fromResource (directly with a GdImage object) or the fromString (e.g. if your image data is stored in a database) methods to initialize a detector.

NOTE: the fromXXX methods immediately trigger the facial recognition, which - depending on the size of the image and how much of it actually contains a face - could be relatively slow (as in, up to a number of seconds). So please don't call these "on the fly"; at the very least, cache the results, but better still move it to a background process if possible.

统计信息

  • 总下载量: 7.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 250
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2020-02-18