我可以在没有 S3 存储桶的情况下使用 Amazon Rekognition 吗?

Tha*_*thi 2 amazon-s3 amazon-web-services amazon-rekognition

我想将 Firebase 与 Amazon Rekognition 一起使用是否可以使用?

我读了 Class for Rekognition for Node.js 它在代码中有 S3 命令。

Mau*_*rma 5

不,如果你不想,你不需要使用s3。使用 s3 提供了低延迟,但您可以直接通过 API 调用使用Rekognition服务,API 调用的响应将包含您想要的json格式的结果,您可以根据需要使用。

此外,如果您使用直接 API 调用,则必须在使用 REkognition API 时以base-64 编码格式传递图像。

此外,您还可以将 AWS 开发工具包用于不同的编程语言,这将使您的任务更轻松地使用不同的 AWS 服务。

例如用于检测 python 中的标签:

import boto3
from PIL import Image
import io
local='images/4.jpeg'
client = boto3.client('rekognition')
image = Image.open(local)

stream = io.BytesIO()
image.save(stream,format="JPEG")
image_binary = stream.getvalue()

response = client.detect_labels(
    Image={'Bytes':image_binary}
    )


print(response) 
Run Code Online (Sandbox Code Playgroud)

而一些 rekognition 服务需要 s3 才能工作。