识别:空结果

时间:2018-11-12 20:11:53

标签: amazon-web-services amazon-rekognition

嘿堆高车。

我正在尝试通过AWS PHP SDK使用Rekognition。我可以,但是有问题。经过很长一段时间试图找出问题所在,但我仍然没有弄清楚。我正在如下请求;

    $returnData = new \stdClass();

    $this->rekognition = new RekognitionClient([
        'version' => 'latest',
        'region' => 'eu-west-1',
        'credentials' => [
            'key' => 'XXXX',
            'secret' => 'XXXX'
        ]
    ]);

    try {
        $this->basePrint = $basePrint;
        $this->newPrint = $newPrint;

        $faceAnalysis = $this->rekognition->compareFaces([
            'SourceImage' => [
                'Bytes' => base64_decode($this->basePrint),
            ],
            'TargetImage' => [
                'Bytes' => base64_decode($this->newPrint),
            ],
            'Attributes' => ['all']
        ]);

        $returnData->state = "success";
        $returnData->matchResult = $faceAnalysis;


    } catch (RekognitionException $e){

        $returnData->state = "error";
        $returnData->AwsErrorCode = $e->getAwsErrorCode();
        $returnData->AwsErrorMessage = $e->getAwsErrorMessage();
        $returnData->OriginalPrint = $this->basePrint;
        $returnData->NewPrint = $this->newPrint;


    }

return $returnData;

很好。不抛出任何异常。但是,$faceAnalysis的结果为空。它为空。没有引发任何错误。我在文档中进行了查找,但找不到任何可导致此行为的内容。

我做错什么了吗?或者我错过了什么?

0 个答案:

没有答案