ai
  • 简介
  • 百度AI
    • 人脸识别
      • 人脸库管理
      • 人脸检测
      • 人脸搜索
      • 人脸对比
      • 身份验证
    • OCR文字识别
    • 图像识别
    • 人体分析
    • nlp自然语言
  • 腾讯AI
    • OCR文字识别
    • 人脸识别
      • 人脸库管理
    • 图片特效
    • 图片识别
    • 敏感信息审核
    • 智能闲聊
    • 机器翻译
    • 基础文本分析
    • 语义解析
    • 语音识别
    • 语音合成
Powered by GitBook
On this page

Was this helpful?

  1. 百度AI
  2. 人脸识别

人脸检测

Previous人脸库管理Next人脸搜索

Last updated 6 years ago

Was this helpful?

$ai = AI::baidu($config);

// 使用base64编码图片进行检索
$code = "image base64 code";
$res = $ai->face()->base64($code)->detect()

// 使用url图片地址
$url = "http://domain/someimg.jpg";
$res = $ai->face()->url($url)->detect();

// 使用 本地文件路径
$path = 'path/to/file.jpg';
$res = $ai->face()->path($url)->detect();

// 兼容官方原生参数
$params = [
    'face_field' => 'age,beauty,expression,face_shape',
     'max_face_num' => 1,
     'face_type' => 'LIVE'
];
$url = "http://domain/someimg.jpg";
$res = $ai->face()->url($url)->detect($params);

var_dump($res);
官方详细参数