|
RASPBERRY PI 3 MODEL B |
x 1 | |
|
Neural compute stick 2Intel
|
x 1 | |
|
Raspberry Pi NoIR Camera V2 |
x 1 |
A. Eye - Watch out for vehicles
This is a getting started guide for beginners to Intel Compute Stick and OpenVINO. I will be using pre-trained model from model zoo. I am going to build a vehicle alert system should. When a vehicle is approaching, Raspberry Pi will speak out the alert. This could be a very good use-case for visually impaired persons or for bikers who often don't see what's coming from behind.
Things you need
Hardwares
- Raspberry Pi 3 ( or 4 ) with 16GB SD card
- Intel Neural Compute Strick 2
- 3.5mm Speaker
- USB Power bank to power Raspberry Pi
- USB Keyboard and Mouse during setup
- HDMI Monitor during setup
Softwares
- BalenaEtcher or Pi Imager to burn SD card with Raspbian OS.
- OpenVINO Toolkit
Let's get started
Prepare SD Card
If you are familiar with Raspberry Pi, then you know first thing is to prepare your SD card with Raspbian OS. You can either use Balena Etcher (download from https://www.balena.io/etcher) or use Pi Imager. I would prefer Pi Imager as it's one less step to follow.
Choose the operating system ( Raspberry pi 3 32 bit ) and choose your SD card to flush. This may take few minutes. Once finished, unplug the SD card from your computer and insert into Raspberry Pi.
Configure Raspberry Pi 3
Connect USB keyboard, mouse and a HDMI monitor to raspberry pi. Connect the power which will turn boot up your Pi desktop. Follow the setup wizard and configure WiFi for your Pi. After reboot, open Raspberry Pi Configuration wizard and enable Camera and SSH. Optionally you can enable VNC viewer if you want to remote access your desktop.
Install OpenVINO Toolkit on Pi
You may follow the official documentation here or follow steps below.
Open Terminal window on your Pi and go to Downloads folder
cd ~/Downloads
and download OpenVINO sdk.
wget --no-check-certificate https://download.01.org/opencv/2020/openvinotoolkit/2020.4/l_openvino_toolkit_runtime_raspbian_p_2020.4.287.tgz
You should see the zip file as below
Then create a folder where OpenVINO will be installed
sudo mkdir -p /opt/intel/openvino
sudo tar -xf l_openvino_toolkit_runtime_raspbian_p_<version>.tgz --strip 1 -C /opt/intel/openvino
sudo apt install cmake
echo "source /opt/intel/openvino/bin/setupvars.sh" >> ~/.bashrc
Close the terminal and open a new one. You should see below message which means your environment variables are setup
Now, it's time to add some USB rule for your NCS 2
sudo usermod -a -G users "$(whoami)"
sh /opt/intel/openvino/install_dependencies/install_NCS_udev_rules.sh
You are almost done ! Plug your NCS 2 stick to one of the USB port of your Pi and move to build process.
cd /home/pi
mkdir OpenVINO && OpenVINO
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" /opt/intel/openvino/deployment_tools/inference_engine/samples/c
make -j2 object_detection_sample_ssd
Now go one level up to OpenVINO folder
cd ..
And download my github repo which contains the python code and pre-trained vehicle detection models from model zoo
git clone https://github.com/just4give/openvio-vehicle-detection.git
cd openvio-vehicle-detection
Then install python dependencies via pip3
pip3 install -r requirements.txt
You all set to run your vehicle detection program. Before you do, there are few other things.
Install Camera Module
Connect your Pi Camera module to Pi and test it to make sure it's working by issuing below command from terminal
raspistill -v -o test.jpg
If all is well, you should see the image preview. If not, please read this document for full configuration.
Configure Audio
Follow this official document to configure audio output for you Pi. Once done run below command from terminal
aplay /home/pi/OpenVINO/openvio-vehicle-detection/alert.wav
All right, if you had success so far, you are ready to run your program for the first time :)
cd /home/pi/OpenVINO/openvio-vehicle-detection
and issue below command
python3 main.py -d MYRIAD -m vehicle-detection-adas-0002.xml -pt 0.9
My threshold is very high and the model was producing some falls vehicles. You may adjust the value based on your ambience light etc.
Congratulations !!! You have setup OpenVINO and ran your first program successfully. There are plenty of interesting and useful pre-trained models to explore -> https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/intel
What's next ? Your imagination has no limit. Learn to train your own models and explore the computer vision world.
A. Eye - Watch out for vehicles
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by mithundotdas
- Mahout - Save The Elephants ?? Save The ElephantsLet's work together and save the beautiful elephants using cutting edge technol...
- Smart Indoor Harvesting Using Wio Terminal & Blynk MotivationThis project is basically designed and programmed by my daughter, Sashrika with little hel...
- A. Eye - Watch out for vehicles This is a getting started guide for beginners to Intel Compute Stick and OpenVINO. I will be using p...
- Touchless ATM using Augmented Reality Stop The SpreadPrevent spreading of COVID-19 is very critical to flatten the curve. Research has fou...
- Basement Monitoring Using Wio Terminal and Blynk MotivationI live in East Coast of USA where most of the houses have basements, some are finished, so...
- Buddy - A personal home office assistance What Problem Are We Talking About ?Corona virus out-break has put our lives upside dow, creating new...
- AI powered thermal camera for safe camping The ProblemI like camping but I am not a "camping enthusiast", I usually camp once or twice a year w...
- Pet Activity Tracker using XIAO BLE Sense & Edge Impulse StoryWhy should human have all the fitness trackers? Our pets deserve more to stay active. I am usin...
- Protect Peatlands for people and planet with help of SensiML The 1997 Indonesia fire burned 9.7– 11.7 million ha on Borneo and Sumatra, destroying 4.5–6 million ...
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
79 1 1 -
-
-
-
Sega Master System RGB Encoder Switcher Z80 QSB v1.2
71 0 0 -
18650 2S2P Battery Charger, Protection and 5V Output Board
106 0 0 -
High Precision Thermal Imager + Infrared Thermometer | OpenTemp
522 0 7 -
Sony PlayStation Multi Output Frequency Oscillator (MOFO) v1
147 0 2 -