face 是基于微软小冰接口的颜值检测工具
PS:其中某些接口还有一些参数,能够定位某些tag的位置,但因过于复杂这里没有实现
composer require hanson/face
<?php
$face = new \Hanson\Face\Foundation\Face();
$result = $face->score->get('https://ws2.sinaimg.cn/large/685b97a1gy1fehkmbi6hvj20u00u07ab.jpg');
/**
[
'score' => 6.8,
'text' => '哥们颜值才6.8分,一下让整体颜值从7.3跌到7.1ORZ',
'url' => 'https://mediaplatform.trafficmanager.cn/image/fetchimage?key='
];
**/
<?php
$face = new \Hanson\Face\Foundation\Face();
// 获取颜值实例
$score = $face->score;
// 获取受欢迎实例
$popular = $face->popular;
// 获取关系实例
$relation = $face->relation;
// 获取请客实例
$bill = $face->bill;
// 获取时尚穿衣实例
$clothing = $face->clothing;
// 所有实例均有一个方法 get
$result = $bill->get($url);