Giter Club home page Giter Club logo

ai's Introduction

优雅的AI客户端调用

官方的sdk用起来的感觉实在是太忧伤了,换一种更好的调用方式吧

特点

  • 优雅的调用方式
  • 仅支持php 7.0以上版本
  • 参数兼容原生接口
  • 隐藏了开发者不需要关注的细节
  • 高度抽象的类
  • 符合psr4标准 方便集成到各种项目中

支持的平台

  • 百度AI平台
  • 腾讯AI平台

安装

composer require  "crisen/ai":"^1.0.0"

laravel框架,请点击这里

使用示例

use Crisen\AI\AI;

...

//百度ai
$baiduConfig = [
     'app_id' => 'your appid',
     'api_key' => 'your api key',
     'secret_key' => 'your secret key'
];
$ai = AI::baidu($baiduConfig);
//腾讯ai
$tencentConfig = [
     'app_id' => 'your appid',
     'app_key' => 'your secret id',
];
$ai = AI::tencent($tencentConfig);

// 图片检索
$url = 'http://aip.bdstatic.com/portal/dist/1543924308745/ai_images/logo.png';
$res = 	$ai->face()->url($url)->detect();
if($res->success()){
    var_dump($res->toArray())
}else{
    var_dump($res->getErrMsg());
}

文档

详细文档

LICENSE

MIT

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.