如何将base64图像发送到卷发的Azure face-api?

发布于 2025-01-29 17:20:13 字数 430 浏览 6 评论 0原文

正如我的问题提到的那样,我如何需要更改此语句以将base64中的图像发送到Azure?

curl -H "Ocp-Apim-Subscription-Key: ***hidden***" "https://***hidden***.cognitiveservices.azure.com/face/v1.0/detect?detectionModel=detection_03&returnFaceId=true&returnFaceLandmarks=false" 
-H "Content-Type: application/json" --data-ascii "{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/c/c3/RH_Louise_Lillian_Gish.jpg\"}"

谢谢你!

as my question mention it, how do i need to change this statement to send an image in base64 to Azure?

curl -H "Ocp-Apim-Subscription-Key: ***hidden***" "https://***hidden***.cognitiveservices.azure.com/face/v1.0/detect?detectionModel=detection_03&returnFaceId=true&returnFaceLandmarks=false" 
-H "Content-Type: application/json" --data-ascii "{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/c/c3/RH_Louise_Lillian_Gish.jpg\"}"

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

挽手叙旧 2025-02-05 17:20:13

我如何需要更改此语句以将base64中的图像发送到Azure?

根据此

另外,您可以尝试按照 muru

'{"image" : "'"$( base64 ~/Pictures/1.jpg)"'"}

更新的答案:

按照使用face客户端库

curl -v -X POST "https://westus.api.cognitive.microsoft.com/face/v1.0/detect?returnFaceId=true&returnFaceLandmarks=false&returnFaceAttributes={string}&recognitionModel=recognition_04&returnRecognitionModel=false&detectionModel=detection_03&faceIdTimeToLive=86400" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: {subscription key}" --data-ascii "{\"url\":\"https://csdx.blob.core.windows.net/resources/Face/Images/identification1.jpg\"}"

您可以参考类似问题:无法将/请求base64与python face api需要支持base64字符串或本地文件URL或本机文件URL而不是图像URL

how do i need to change this statement to send an image in base64 to Azure?

As per this documentation, your curl command seems fine.

Alternatively, you can try as suggested by muru:

'{"image" : "'"$( base64 ~/Pictures/1.jpg)"'"}

Updated answer:

As per Use the Face client library:

curl -v -X POST "https://westus.api.cognitive.microsoft.com/face/v1.0/detect?returnFaceId=true&returnFaceLandmarks=false&returnFaceAttributes={string}&recognitionModel=recognition_04&returnRecognitionModel=false&detectionModel=detection_03&faceIdTimeToLive=86400" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: {subscription key}" --data-ascii "{\"url\":\"https://csdx.blob.core.windows.net/resources/Face/Images/identification1.jpg\"}"

You can refer to similar issues: can't send/request base64 to azure face api with python and Face API need support for base64 string or Local File URL or Native File URL instead of Image URL

尸血腥色 2025-02-05 17:20:13

curl -x帖子“ https:// .cognitiveservices.azure.com/face/face/v1.0/检测“ -h” content -type:application/application/octet -stream“ -h” ocp -apim-subscription-key:27E993 ********* 6AAA2464“ -data-binary @'/home/home/rafael/downloads/person.jpg

'有效的解决方案。据我所知,该文档似乎已经过时了。

curl -X POST "https://.cognitiveservices.azure.com/face/v1.0/detect" -H "Content-Type: application/octet-stream" -H "Ocp-Apim-Subscription-Key: 27e993*********6aaa2464" --data-binary @'/home/rafael/Downloads/person.jpg'

is the solution that works. As far as I can tell, the documentation seems outdated.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文