aws-samples / amazon-rekognition-ppe

Detect Personal Protective Equipment using Amazon Rekognition
MIT No Attribution
35 stars 21 forks source link

Using kinesis video streams #42

Closed SunithaE closed 3 years ago

SunithaE commented 3 years ago

Hi,

How different is this architecture if i use Kinesis video stream for the input feed instead of API gateway ? The downstream flow is same as your architecture. But i saw the same object detection using Kinesis video stream (uploading the frames to s3, and passing those frames to rekognition).

I'm very much interested to know how these twp architectures makes a difference. It would be very helpful if you share some insights.

Thanks

matteofigus commented 3 years ago

Hi, thanks for submitting a question.

It is hard to provide advice without knowing more about your use case, but in general you should have many options to integrate KVS to the PPE API.

The API Gateway approach is a flexible design if you want to process an individual image or in general if you plan to plug multiple systems. If you are using KVS, depending on the frequency of your stream, you could process Fragments to extract frames and then call the API Gateway, or you could instead (depending on the sampling rate of your frames) process each fragment directly via a lambda that would just directly call Rekognition for each splitted frame. The second approach may be a bit cheaper in cost, as a single invoked Lambda may be able to process multiple frames giving you better performance and cost optimisation, but you need to keep in mind its limits such as the execution time limit (currently no more than 15 minutes).

Have I answered your question?

SunithaE commented 3 years ago

@matteofigus Yes that answered my question. Thank you very much for the insights. I'm doing the second approach that you mentioned with lambda.