Face - Find Similar Faces的示例代码不起作用 [英] sample code for Face - Find Similar Faces does not work

查看:123
本文介绍了Face - Find Similar Faces的示例代码不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://dev.projectoxford.ai/docs/services/54d85c1d5eefd00dc474a0ef/operations/5519015d3d8a4b22aca91579


javascript代码不起作用 


 var params = {
//指定您的订阅密钥
'subscription-key':'asdf',
//根据需要指定可选参数的值
headers:{'Content-Type':" application / json" }
};

var jsonRequestBody = {
faceId:faceId,
faceIds:faceIds
};
var url ='https://api.projectoxford.ai/face/v0/findsimilars?'+ $ .param(params);
$ http.post(url,jsonRequestBody,{headers:{'Content-Type':'application / json'}})


我正在尝试确定捕获的当前faceId是否与PersonX.faceIds中的faceId匹配,因此我从该人那里获得了face id并且它失败了。 


对象{code:" FaceNotFound",message:" Face'0979a5a1-2e98-4db8-85a7-afd5a09c02de'未找到。"}


它看起来像person faceId中的FaceId超过24小时,因此无法进行搜索。 


此时只需使用faceId函数? 



Face - Identification








Ken

解决方案

是的,faceid将在检测后24小时到期。所以如果你使用未找到的faceid,应该再次检测到它。


https://dev.projectoxford.ai/docs/services/54d85c1d5eefd00dc474a0ef/operations/5519015d3d8a4b22aca91579

The javascript code doesn't work 

       var params = {
            // Specify your subscription key
            'subscription-key': 'asdf',
            //Specify values for optional parameters, as needed
            headers: { 'Content-Type': "application/json" }
        };

        var jsonRequestBody = {
            faceId: faceId,
            faceIds: faceIds
        };
       var url = 'https://api.projectoxford.ai/face/v0/findsimilars?' + $.param(params);
        $http.post(url, jsonRequestBody, { headers: { 'Content-Type': 'application/json' } })

I'm trying to determine if the current faceId captured matches the faceIds from a PersonX.faceIds, so I get the array of face ids from that person and it fails. 

Object {code: "FaceNotFound", message: "Face '0979a5a1-2e98-4db8-85a7-afd5a09c02de' is not found."}

It looks like the FaceIds in the person faceId are older than 24 hours and thus are not available for searching. 

At this point just use the faceId function? 

Face - Identification


Ken

解决方案

yes, faceid will expire 24 hours after detection.So if you use faceid that not found, it should be detected again.


这篇关于Face - Find Similar Faces的示例代码不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆