Skip to content

zebular13/example-linux-with-twilio

 
 

Repository files navigation

Twilio example for Edge Impulse for Linux

This is an example application that runs an object detection model using Edge Impulse for Linux and alerts you when two objects are seen together (e.g. an elephant and a person). It's based on the webserver example in the Node.js SDK so you have a clear view of what's happening in front of the camera.

To run this example:

  1. Get a development board that supports Edge Impulse for Linux, and follow the setup instructions.

  2. Train an object detection model using Edge Impulse and download it to your device via:

    $ edge-impulse-linux-runner --download twilio-example.eim
    
  3. Install Node.js v12 or higher.

  4. Clone this repository and cd into it:

    $ git clone https://github.com/edgeimpulse/example-linux-with-twilio
    $ cd edge-impulse-linux-with-twilio
    
  5. Install the dependencies:

    $ npm install
    
  6. Set your Twilio account token, secret key, the 'from' and 'to' numbers via:

    $ export TWILIO_AUTH_TOKEN=3ce...
    $ export TWILIO_ACCOUNT_SID=AC305...
    $ export TWILIO_FROM=+162...
    $ export TWILIO_TO=+31624...
    

    Note: You can add the lines above to your ~/.bashrc file so they're loaded automatically.

  7. In webserver-twilio.ts set the objects you want to detect (see the if (bb.find(x => x.label === 'elephant') && bb.find(x => x.label === 'person')) {) line.

  8. Start the application via:

    $ npm run build
    $ node build/webserver-twilio.js twilio-example.eim
    
  9. Open a web browser at http://localhost:4911 to see the webcam image, and keep a close eye to your phone to see the alerts come in!

Demo 1 Demo 2

About

Object detection which sends a message over Twilio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 96.7%
  • JavaScript 2.3%
  • HTML 1.0%