Skip to content

Latest commit

 

History

History
48 lines (25 loc) · 1.69 KB

python-app.rst

File metadata and controls

48 lines (25 loc) · 1.69 KB

Client app

Our client app is a lightweight, open source Python script.

It performs two basic tasks:

  1. retrieve a valid video stream. By default, one of the connected USB camera will be chosen, but you can easily modify the client app to open a different camera and even open a video file.
  2. package and send the video stream over https to our computation servers. This part can also be optimized for your needs (image resolution, frame rate, etc...).

If you need help to perform these optimizations, please contact us at support@angus.ai.

Prerequisite

  • you have a working webcam plugged into your PC
  • you have installed OpenCV2 and OpenCV2 python bindings. Please refer to OpenCV documentation to proceed, or check faq chapter.

On Debian-like platform, OpenCV2 comes pre-installed, you just need to run

$ sudo apt-get install python-opencv

Note also that OpenCV2 is not an absolute pre-requisite, the following code sample can easily be adapted to be used with any other way of retrieving successive frames from a video stream.

Client App

Please copy/paste the following code sample in a file and run it.

sceneanalysis_fromwebcam.py

To run it:

$ python yourcopiedfile.py

You should see two green vectors showing what your are looking displayed on your screen:

image

The application displays by default a live view of your stream, with gaze vectors super-imposed. If you need it, it is also possible to display age, gender, emotion, etc... Please refers to the app real-time API here : (scene-analysis-api).