aws-samples / amazon-rekognition-video-analyzer

A working prototype for capturing frames off of a live MJPEG video stream, identifying objects in near real-time using deep learning, and triggering actions based on an objects watch list.
Other
368 stars 158 forks source link

Unable to view video frames in localhost #36

Closed Devraj004 closed 6 years ago

Devraj004 commented 6 years ago

This is an awesome project. Thank you for creating such a wonderful coding for us. I need your help to resolve the video on http://localhost:8080/. Although packet are getting send successfully to cloud. Not sure what I am missing.

Regards Devraj

moanany commented 6 years ago

Hi @Devraj004,

Thanks for the feedback!

There could be several reasons why you're not seeing frames in the Web UI. So, you'll need to go through a step-by-step process to figure out what's amiss. Here are a few things to start with:

1) Check for errors in the Cloud Formation console for the Video Analyzer stack (https://console.aws.amazon.com/cloudformation/)

2) Check that network connectivity to AWS from your browser is OK. For example, ensure there are no firewalls preventing outbound communication to AWS endpoints.

3) Check for errors in the Java Script console in Chrome/Firefox Developer Tools

4) Check that the DynamoDB table contains video frame metadata.

Let me know if you find something unusual and have questions about it.

Thanks, Moataz

Devraj004 commented 6 years ago

Thank you Moataz for your quick response.  I have verified all below parameters.

Not sure What could be the issue ? Any thing getting blocked on my my laptop firewall ?

Regards  Devraj

On Thursday, 16 August, 2018, 9:20:57 PM IST, Moataz Anany <notifications@github.com> wrote:  

Hi @Devraj004,

Thanks for the feedback!

There could be several reasons why you're not seeing frames in the Web UI. So, you'll need to go through a step-by-step process to figure out what's amiss. Here are a few things to start with:

Let me know if you find something unusual and have questions about it.

Thanks, Moataz

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

moanany commented 6 years ago

If you're not seeing frame metadata/images in DynamoDB/S3, there could be two potential reasons:

1) The frames never reach Kinesis. I'd verify network connectivity to the Kinesis endpoint.

2) The ImageProcessor function is failing for some reason, and therefore, not inserting metadata/frames into DynamoDB/S3. Check the AWS Lambda logs for the ImageProcessor function, and make sure there are no errors. If it's indeed failing, the first thing to look at is project configuration. A parameter may be configured incorrectly, causing the function to fail.

Hope that helps.

Devraj004 commented 6 years ago

Thank you Moanany. This is interesting.

2018-08-17  10:07:16 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:07:16 Unable to import module 'imageprocessor': No module named pytz  10:07:16 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:07:16 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 21.25 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:07:16 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:07:16 Unable to import module 'imageprocessor': No module named pytz  10:07:16 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:07:16 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 36.32 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:07:17 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:07:17 Unable to import module 'imageprocessor': No module named pytz  10:07:17 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:07:17 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 40.91 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:07:18 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:07:18 Unable to import module 'imageprocessor': No module named pytz  10:07:18 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:07:18 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 17.40 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:07:20 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:07:20 Unable to import module 'imageprocessor': No module named pytz  10:07:20 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:07:20 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 7.60 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:07:23 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:07:23 Unable to import module 'imageprocessor': No module named pytz  10:07:23 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:07:23 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 12.98 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:07:29 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:07:29 Unable to import module 'imageprocessor': No module named pytz  10:07:29 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:07:29 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 5.13 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:07:43 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:07:43 Unable to import module 'imageprocessor': No module named pytz  10:07:43 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:07:43 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 21.15 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:08:14 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:08:14 Unable to import module 'imageprocessor': No module named pytz  10:08:14 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:08:14 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 163.27 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:08:57 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:08:57 Unable to import module 'imageprocessor': No module named pytz  10:08:57 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:08:57 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 180.09 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:09:52 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:09:52 Unable to import module 'imageprocessor': No module named pytz  10:09:52 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:09:52 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 113.50 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:11:04 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:11:04 Unable to import module 'imageprocessor': No module named pytz  10:11:04 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:11:04 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 175.93 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:12:05 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:12:05 Unable to import module 'imageprocessor': No module named pytz  10:12:05 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:12:05 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 64.23 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:12:54 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:12:54 Unable to import module 'imageprocessor': No module named pytz  10:12:54 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:12:54 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 7.33 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:14:01 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:14:01 Unable to import module 'imageprocessor': No module named pytz  10:14:01 END RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b  10:14:01 REPORT RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Duration: 141.27 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 35 MB  10:15:07 START RequestId: fa25b5c7-d056-493c-aa6b-d6767fe1614b Version: $LATEST  10:15:07 Unable to import module 'imageprocessor': No module named pytz Unable to import module 'imageprocessor': No module named pytz

and when i am checking on my laptop pytz is already installed. Requirement already satisfied: pytz in c:\users\xxxx\envs\aws\lib\site-packages (2018.5)

Devraj004 commented 6 years ago

Above logs belongs to AWS Lambda logs for the ImageProcessor function . looks like the pytz function causing the issue. Please help me to hit the last hammer on this issue.

moanany commented 6 years ago

That's the culprit, you need to install pytz into the project directory, not just your python virtualenv. This is required for the 'packagelambda' build command to be able to bundle it with the lambda function.

Here's step 10 from the readme. Check out the second command:

Use Pip to install pytz. Pytz is needed for timezone calculations. Use the following commands:

pip install pytz # Install pytz in your virtual python env

pip install pytz -t <path-to-project-dir>/lambda/imageprocessor/ # Install pytz to be packaged and deployed with the Image Processor lambda function
moanany commented 6 years ago

Install the pytz dependency into project directory, then issue the packagelambda build command followed by updatelambda to fix this.

Devraj004 commented 6 years ago

Hi Moanany, Awesome. I am so happy that finally it works.

That was really a last full of force hammer.

Many thanks for your quick help.

Kind Regards Devraj

moanany commented 6 years ago

@Devraj004 awesome, glad it worked. Enjoy!

Devraj004 commented 6 years ago

Thank you Moanany. Now I am thinking to get the label data in python and if condition matched run another script. For Example if detect a horse in the streaming video then run an another script to play a sound in the remote camera. In the image processor i noticed some watch list but i think that is for Amazon cloud. "label_watch_list" : ["Human", "Pet", "Bag", "Toy"], "label_watch_min_conf" : 90.0, "label_watch_phone_num" : "", "label_watch_sns_topic_arn" : "",

Can I achieve this to run a script on my local PC , perhaps with some additional changes in Build python script ?

Regards Devraj