Can I use Amazon Rekognition without an S3 bucket?

独自空忆成欢 提交于 2019-12-24 07:29:23

问题


I want to use the Firebase with the Amazon Rekognition is it possible to use?

I read Class for Rekognition for Node.js it has the S3 command in the code.


回答1:


No , you don't need to use s3 if you don't want. Using s3 provides low latency but you can use Rekognition services directly via API calls , the response of the API calls will contain your desired results in json format which you can use as you want.

Further if you use direct API calls , then you have to pass your images in base-64 encoded format while using REkognition API's.

Also you can use AWS SDK's for different programming languages which will make your task easier to use different AWS services easily.

e.g for detecting labels in 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) 

while some rekognition services will require s3 to work.



来源:https://stackoverflow.com/questions/51034435/can-i-use-amazon-rekognition-without-an-s3-bucket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!