承接 leomarriel/laravel-face-detector 相关项目开发

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

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

leomarriel/laravel-face-detector

Composer 安装命令:

composer create-project leomarriel/laravel-face-detector

包简介

A Face Detector for Laravel

README 文档

README

A Laravel package to handle face detection in an image

Current Features

  • reading a local or remote file
  • external url support
  • multiple ways available output the found face
  • file validation

Installation

composer require leomarriel/laravel-face-detector

Configuration

Laravel without auto-discovery:

If you don't use auto-discovery, add the FaceDetectorServiceProvider to the providers array in config/app.php

'providers' => [
  ...
  Leomarriel\FaceDetector\FaceDetectorServiceProvider::class,
  ...
],

Copy configuration to your project:

php artisan vendor:publish --tag=facedetector-config

By executing above command the package configuration will be published to config/facedetector.php

Config file

There are two configuration options available

config/facedetector.php is an asociative array with the following possible keys:

  • disk (string): the storage disk for file save on command output save().
  • noFoundFaceException (bool): Disable the exception when a face is not found
  • padding (array): Define a padding around the found face

Usage

Direct use, no facades:

You can create a new FaceDetector instance and load a local or remote file

use Leomarriel\FaceDetector\FaceDetector;

$face = new FaceDetector();
$face->loadFile('path/to/image.jpg');
$face->preview();

If you want to use the facade to face detection, add this to your facades in config/app.php:

'aliases' => [
  ...
  'FaceDetector' => Leomarriel\FaceDetector\Facades\FaceDetector::class,
  ...
],

Use the facade to face detection

There are currently two ways to load the file:

From Path

use FaceDetector;

$face = FaceDetector::loadFile('path/to/image.jpg')->preview();

From Url

use FaceDetector;

$face = FaceDetector::loadUrl('https://url/to/image.jpg')->preview();

Output details

Check all available output ways

use FaceDetector;

$face = FaceDetector::loadFile('path/to/image.jpg');
$face->found(); // (bool) Return a boolean whether or not a face was found in the file
$face->face(); // (array) Return an array with the position of the found face
$face->preview(); // Return a preview of the face found with a tag
$face->json(); // Return the found face in json format
$face->stream(); // Return a response with found face cropped in JPG to show in browser
$face->output(); // Return a jpg string file with the found face
$face->save(); // Physically save the face found

Save details

You can save the found face quickly with $face->save() output. The script will create a unique name for your file and store it in the facedetector folder in your storage.

$face->save(); // Physically save the face found on folder "facedetector" in your storage

You can set your preferred storage location:

$face->save('path/to/save'); // Physically save the found face with a random name in a defined path.

Take full control, set the storage path and file name to be saved. Save the file as JPG or PNG, it's your choice.

$face->save('path/to/save', 'new-image.jpg'); // Physically save the found face with a defined path and name.

If the save succeeds, will return the following data:

[
    'filename' => 'Saved file name',
    'size' => 'file size after cropping',
    'path' => 'path to file location relative to the disk storage',
    'url' => 'public url to access the file in browser'
]

☕️ Buy Me a Coffe

I'm happy to be able to contribute to your project, if this package helped you in any way, could you repay me with a coffee? Hugs!

"Buy Me A Coffee"

leomarriel/laravel-face-detector 适用场景与选型建议

leomarriel/laravel-face-detector 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 38 次下载、GitHub Stars 达 3, 最近一次更新时间为 2023 年 09 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「detection」 「laravel」 「detector」 「face」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 leomarriel/laravel-face-detector 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 leomarriel/laravel-face-detector 我们能提供哪些服务?
定制开发 / 二次开发

基于 leomarriel/laravel-face-detector 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 38
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 12
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-01