【问题标题】:Can I use Amazon Rekognition without an S3 bucket?我可以在没有 S3 存储桶的情况下使用 Amazon Rekognition 吗?
【发布时间】:2018-06-26 14:25:54
【问题描述】:

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

我阅读了适用于 Node.js 的 Rekognition 类,它的代码中有 S3 命令。

【问题讨论】:

  • 您希望使用什么 Rekognition 功能?它有一些使用 S3 的功能和一些不需要它的功能。

标签: amazon-web-services amazon-s3 amazon-rekognition


【解决方案1】:

不,如果你不想,你不需要使用 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) 

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-12
    • 2018-12-04
    • 2016-01-14
    • 1970-01-01
    • 2023-04-10
    相关资源
    最近更新 更多