PHP code example of linghitai / platform-php-sdk
1. Go to this page and download the library: Download linghitai/platform-php-sdk library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
linghitai / platform-php-sdk example snippets
use LinghitAi\PlatformPhpSdk\HandClient;
//$ak,$sk 在AI平台控制台进行申请
//$timeout默认60s可不传,单位为秒
$client = new HandClient($ak, $sk,$timeout);
//提供2种方式上传(1.Base64,2.图片url)
//1.使用图片的$base64编码进行调用,如果使用表单或者其他方式上传图片的,需要获取图片的base64
$bas64 = "data:image\jpg;base64......";
$res = $client->handRecognitionByBase64($bas64);
//2.使用图片地址上传
$url = "https://....";
$res = $client->handRecognitionByUrl($url);
bash
$ composer