Giter Club home page Giter Club logo

ai's Introduction

Develop documents

开发文档

Feature

  • 统一主流AI平台SDK调用方法;
  • 像查询数据库一样优雅调用API;

Support platform

1.百度AI开放平台

2.腾讯AI开放平台

3.FACE++AI开放平台

SimpleTest

  1. 下载zip包 或者clone本项目

  2. 进入本项目根目录,执行composer install,(不知道composer?点此了解PHP包管理工具composer

  3. 在项目目录tests->config下面添加配置文件ai.php(需要自己到各平台注册获取试用账号),内容如:

    return [
        'baidu' => [
            'app_id' => '***',
            'app_key' => '***',
            'secret_key' => '***',
        ],
        'youtu' => [
             'app_id' => '***',
             'secret_id' => '***',
             'secret_key' => '***',
             'user_id' => ****
        ]
        'face_plus' => [
             'api_key' => '***',
             'api_secret' => '***',
        ],
    ];
    
    
  4. 在命令行下进入根目录,执行命令,比如测试腾讯优图人脸识别: vendor/phpunit/phpunit/phpunit --testdox tests/Youtu/Face/FaceTest.php

Installation

composer require hahaxixi/ai

Usage

$config = [
    'baidu' => [
        'app_id' => '***',
        'app_key' => '***',
        'secret_key' => '***',
    ],
    'youtu' => [
         'app_id' => '***',
         'secret_id' => '***',
         'secret_key' => '***',
         'user_id' => ****
    ]
    'face_plus' => [
         'api_key' => '***',
         'api_secret' => '***',
    ],
];

//百度
$result = Entry::Baidu($config)->face->select('detect')->where(['image' => file_get_contents(__DIR__ . '/file/face_detect.jpeg'), 'id_card_side' => 'front'])->get();
//腾讯优图
$result = Entry::Youtu($config)->face->select('detectface')->where(['url' => 'http://open.youtu.qq.com/app/img/experience/face_img/face_06.jpg', 'mode' => 1])->get();
//face++
$result =  Entry::FacePlus($config)->face->select('detect')->where(['image_file' =>__DIR__ . '/../../file/face_01.jpg' , 'return_attributes' => 'skinstatus'])->get();

License

Apache License Version 2.0 see Apache License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.