Download the PHP package aoding9/laravel-baidu-aip without Composer

On this page you can find all versions of the php package aoding9/laravel-baidu-aip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-baidu-aip

简介

最近做员工人脸打卡系统,自己封装了一下百度人脸识别SDK,方便以后重复利用。

暂时只封装了一部分接口,具体有哪些方法,看继承自官方sdk的Aoding9\BaiduAip\AipFace这个类,每个方法都有中文注释

为了避免覆写sdk,封装的方法名以Api结尾,用法与百度的官方文档相同,点进sdk也有中文注释,其余未封装的方法,直接按官方文档即可调用。

基于原有api,简化了传参和异常处理,例如matchFacesByUrl是对match的封装,参数从4个减少到2个。

人脸比对示例:

百度人脸识别SDK的简单封装

百度人脸识别SDK的简单封装

安装

composer require aoding9/laravel-baidu-aip

安装失败可能是用了国内镜像,切换为官方源

composer config repo.packagist composer https://packagist.org

因为官方源下载慢,国内镜像又有各种问题可能导致安装失败,可以把以下代码添加到composer.json,直接从github安装

配置

在.env中添加如下配置项

配置项一般无需修改,如需自定义,使用php artisan vendor:publish --provider="Aoding9\BaiduAip\BaiduAipServiceProvider"发布baiduAip.php到config目录

关于BAIDU_AIP_GROUP_ID:默认用户组id,如果调用相关接口时不传用户组id,会以此作为默认值

使用

首先从容器中获取服务,然后获取aipFace实例,然后使用实例中的方法

1、两张人脸图片比对相似度matchFacesByUrl|matchApi

2、在用户组中搜索人脸对应的用户,例如人脸打卡,拍照后判断是哪个用户打的卡searchApi

3、用户组管理groupAddApi|groupDeleteApi|getGroupListApi|getGroupUsersApi|getUserApi

4、结合模型观察者,管理用户资料addUserApi|updateUserApi|deleteUserApi


All versions of laravel-baidu-aip with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ~5.5|~6.0|~7.0|~8.0|~9.0
php Version >=7.1.0
baidu/aip-sdk Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aoding9/laravel-baidu-aip contains the following files

Loading the files please wait ....