This repository contains Node-RED flow examples that demonstrate how to detect objects using video stream from either DJI Tello Drone or a Raspberry Pi using the Node-RED visual editor.
Have you ever wanted to detect objects using live video stream ? Well if so this repo will show you how to get started.
This example will be using the node-red-contrib-ffmpeg node. This node allows users to stream video from either a tello drone or a raspberry pi. See this repo on instructions on how to video stream
Steps to get started with Tello Drone
-
Install Node-RED
-
Install node-red-contrib-ffmpeg :
npm install node-red-contrib-ffmpeg
-
Install ffmpeg
brew install ffmpeg
once installed run :ffmpeg
-
Train an object detection model - you can follow these instructions on how to do so. You should end up with a
model_web
folder. -
Copy your
mode_web
folder in the directory you installed node red -
In the node-red directory make the following changes to the
settings.js
folder Search and un-comment out the followinghttpAdminRoot: '/editor', httpStatic: '/<homefolder>/.node-red',
-
Run Node-Red by running this command :
node-red
-
Go to
http://127.0.0.1:1880/editor/
in your browser -
Import Tello-Drone flow
-
Turn Tello Wifi on
-
Inject Command and then streamon in the flow
Flow should look like :
- In another tab , go to :
http://127.0.0.1:1880/api/dashboard
Output should look like :
You should see live streaming with tello drone
Steps To get started with Raspberry Pi
1 . Confirm you have Node-RED and ffmpeg installed on Raspberry Pi
-
If you don’t have ffmpeg installed follow these instructions to install ffmpeg on pi
-
Train an object detection model - you can follow these instructions on how to do so. You should end up with a
model_web
folder. -
Copy your
mode_web
folder in the directory you installed node red -
In the node-red directory make the following changes to the
settings.js
folder
Search and un-comment out the following
httpAdminRoot: '/editor',
httpStatic: '/<homefolder>/.node-red',
-
Run Node-Red by running this command :
node-red
-
Import the Raspberry Pi flow
Flow should look like this :
- Deploy and in a different tab go to
http://127.0.0.1:1880/api/dashboard
You should see video stream from Raspberry Pi along with object detection 🎉