face
Version 1.1 Release
مكتبة PHP مصممة للخدمات المعرفية لشركة Microsoft.
الخدمات المعرفية: واجهة برمجة تطبيقات الوجه
يرجى الاشتراك في مفتاح API لصفحة API للخدمات المعرفية من Microsoft.
افتح ملف composer.json الخاص بك وأضف ما يلي إلى مفتاح require :
"ridvanbaluyos/face": "v1.1"
بعد إضافة المفتاح ، قم بتشغيل تحديث الملحن من سطر الأوامر لتثبيت الحزمة
composer installأو
composer update أضف مفتاح الاشتراك الخاص بك في ملف src/Ridvanbaluyos/Face/config.json
{
"url" : " https://westus.api.cognitive.microsoft.com/face/v1.0/detect " ,
"subscriptionKey" : " zWwPD7BGWYEArX6u6QxvS25TTsNge2Qw "
}
<?php
// namespace and autoloaders
use Ridvanbaluyos Face FaceDetection as FaceDetection ;
require_once __DIR__ . ' /vendor/autoload.php ' ;
// let's use Justin Bieber's photo
$ image = array (
' url ' => ' http://img2.timeinc.net/people/i/2014/database/140831/justin-bieber-300.jpg ' ,
);
// instantiate face detection object
$ face = new FaceDetection ( $ image );
?> $ face -> getFaces (); $ face -> analyzeFaceLandmarks ()-> getFaces (); $ face -> analyzeFaceAttributes ()-> getFaces (); $ face -> analyzeFaceLandmarks ()-> analyzeFaceAttributes ()-> getFaces (); $ face -> analyzeAll ()-> getFaces ();