You need to enable JavaScript to run this app.
导航

同步去重

最近更新时间2024.02.07 11:26:06

首次发布时间2023.04.28 17:08:17

阅读本文,您可以快速了解同步图片去重 PHP SDK 的使用方法。

说明

以下 SDK 示例中仅展示了部分参数,您可以在 veImageX 的接口文档中查看该接口支持的全部参数及取值。

初始化

调用接口前请先完成初始化,具体操作请参考初始化

同步去重

以下内容支持指定服务 ID 以及待去重原图 URL,获取图片去重结果,包含图片评分和分组结果。

具体参数详情和返回字段请参考 GetImageDuplicateDetection。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

<?php
include_once(__DIR__ . '/../../vendor/autoload.php');

use Volc\Service\ImageX;

$client = ImageX::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$args = [
    'ServiceId' => "",
    'Async' => true,
    'Urls' => ["url 1", "url 2"]
];

$response = $client->getImageDuplicateDetection($args);
print_r($response);

if (!is_array($response) || isset($response['TeskId'])) {
    exit();
}

sleep(60);

$response2 = $client->getImageDuplicateDetectionTaskStatus($response);
print_r($response2);