Streaming Video, Face Detection, Sample Python Code

0

Hi,

Thank you for your time to read my question.

I want to use Video Streaming (from Webcam) to detect face and other attributes like (Emotion, Landmarks, Pose, Smile, EyeOpen, MouthOpen).

I can get the results from a video stored in S3 bucket by using GetFaceDetection API. Now, I want to analyse face using Video Streaming (from Webcam).

I found documentation about Face Recognition:
https://docs.aws.amazon.com/rekognition/latest/dg/recognize-faces-in-a-video-stream.html

The sample code is written in Java. Unfortunately, I am not familiar with Java. I am looking for a sample code in Python.

I summarize my question here:

  1. Does Video Streaming only work with Face Recognition?

  2. I don't have "Index Faces". But, can I still get Face Detection results (Bounding Box, Emotion, Pose, etc). I don't need "Face Similarity" results.

  3. Is there any sample code for Python?

  4. The sample code is about "Creating & Starting Streaming Video Analysis". What about the next step: "Reading Analysis Results". Is there any sample code?

I am new in this field. And I didn't understand the whole process yet. I really appreciate it, if you could answer my question in a simple manner.

Thanks.

MadoS
asked 4 years ago780 views
3 Answers
0

Hi,

Please see answers to your questions below.

1. Does Video Streaming only work with Face Recognition?
The primary use case for the product is face recognition in streaming videos

2. I don't have "Index Faces". But, can I still get Face Detection results (Bounding Box, Emotion, Pose, etc). I don't need "Face Similarity" results.
I think you can try either of the following 1) create an empty collection, not index any faces to it, and pass in that collection as part of you settings when calling CreateStreamProcessor 2) alternately, if you created any collection with faces earlier, you can pass in the collection id, and ignore the 'MatchedFaces' from the output
https://docs.aws.amazon.com/rekognition/latest/dg/streaming-video-kinesis-output.html

3. Is there any sample code for Python?
4. The sample code is about "Creating & Starting Streaming Video Analysis". What about the next step: "Reading Analysis Results". Is there any sample code?
I don't have any python sample code at hand, will have to get back on that. For reading results, we have a page describing what to expect, https://docs.aws.amazon.com/rekognition/latest/dg/streaming-video-kinesis-output.html. The results are pushed to Kinesis data streams, so maybe you can explore reading kinesis data streams using python in general.
https://docs.aws.amazon.com/streams/latest/dev/kinesis-record-processor-implementation-app-py.html
https://aws.amazon.com/blogs/big-data/snakes-in-the-stream-feeding-and-eating-amazon-kinesis-streams-with-python/

Some python reference from boto3

Hopefully the above should at least help you get started.

Thanks.

Edited by: ragibmataws on May 27, 2020 5:03 PM

Edited by: ragibmataws on May 27, 2020 5:40 PM

AWS
answered 4 years ago
0

Thank you very much for your time.

Face Recognition returns Bounding Box, Landmark, Pose, and Quality.

What I am looking for most is "Emotion". Is there any way to get Emotion from Face Recognition?

MadoS
answered 4 years ago
0

Unfortunately we currently don't support emotion detection for faces in streaming video. It is currently restricted to the face features you mentioned.

https://docs.aws.amazon.com/rekognition/latest/dg/streaming-video-kinesis-output-reference-detectedface.html

AWS
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions