当前位置:   article > 正文

测试百度AI色情检测接口_百度鉴黄api

百度鉴黄api

1.注册百度AI开放平台,获取 APPID AK SK

2.下载相应的sdk

3.编辑代码

require_once 'AipImageCensor.php';

// 你的 APPID AK SK
const APP_ID = '';
const API_KEY = '';
const SECRET_KEY = '';

$client = new AipImageCensor(APP_ID, API_KEY, SECRET_KEY);
$result = $client->antiPornGif(file_get_contents('1.gif'));
print_r($result);

请求获取
Array
(
    [result_num] => 3
    [log_id] => 4910311668856503150
    [confidence_coefficient] => 确定
    [result] => Array
        (
            [0] => Array
                (
                    [class_name] => 色情
                    [probability] => 0.007471
                )

            [1] => Array
                (
                    [class_name] => 性感
                    [probability] => 0.99126
                )

            [2] => Array
                (
                    [class_name] => 正常
                    [probability] => 0.001269
                )

        )

    [porn_probability] => 0.007471
    [frame_count] => 10
    [conclusion] => 性感
)




声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/595767
推荐阅读
相关标签
  

闽ICP备14008679号