// base64 code调用
$code = 'image base64 code';
$ai->face()->base64($code)->detect();
// 图片url
$url = 'http://domain.com/some.jpg';
$ai->face()->url($url)->detect();
// 本地文件路径
$path = 'path/to/some.jpg';
$ai->face()->path($path )->detect();
$code = 'image base64 code';
$res = $ai->face()->base64($base64Code)->detect(['mode' => 0]);
if($res-success()){
var_dump($res->toArray());
}
$url = 'http://domain.com/some.jpg';
$res = $ai->face()->url($url)->multiDetect();
if($res-success()){
var_dump($res->toArray());
}
$sourceImgCode = 'source base64 code';
$destImgCode = 'dest base64 code';
$res = $ai->face()->crosssAge([
'source_image' => $sourceImgCode,
'target_image' => $destImgCode
]);
if($res-success()){
var_dump($res->toArray());
}
$path = 'path/to/some.jpg';
$res = $ai->face()->path($path)->shape();
if($res-success()){
var_dump($res->toArray());
}
$sourceImgCode = 'source base64 code';
$destImgCode = 'dest base64 code';
$res = $ai->face()->compare([
'source_image' => $sourceImgCode,
'target_image' => $destImgCode
]);
if($res-success()){
var_dump($res->toArray());
}
$path = 'path/to/some.jpg';
$res = $ai->face()->path($path)->verify([
'person_id' => 'person0'
]);
if($res-success()){
var_dump($res->toArray());
}