This project is discontiuned until further notice.
Raspberry Pi TensorFlow machine learning object detecting blind spot camera and warning system for vehicles
Made for the PA Pi Competition 2019
Cyclists and pedestrians are 15 times more likely than drivers to be killed on UK roads. In a society where we’re trying to desperately to promote environmentally friendly modes of transport, we’re instead unwillingly discouraging them with the safety risks. The cyclist safety movement usually focuses on the cyclist, wearing high-visibility clothing and covering bikes with flashing lights. However, these methods are only effective when seen. Many cyclists get seriously injured or even killed in blind spots, especially when the vehicles are turning, hence for the need of our project; an object detecting blind spot camera that warns both drivers and those at risk in the blind spot.
When a bike or pedestrian enters the blindspot (both identified in code as a “person”), the driver will be notified through an audible tone and text-to-speech message*. The pedestrian or bike at risk will be warning through an 8x8 LED matrix hat attached to the Pi, placed in view of the vehicle’s blind spot that will flash a warning when detected, alerting the pedestrian or cyclist of the risk.
*Text-to-speech features are not present in v1 due to compatibility issues
A video summary of this project
Final Software Tweaks Stream in which this project is completed
Video of this project working is coming soon.
Editing the object detection code using nano. Programming using Visual Studio Code.
Requirements:
Raspberry Pi 3 (different models may work but not at a frame rate that would be considered effective or safe for this project)
A 32 GB+ SD card with respectable speed. We suggest SanDisk Extreme microSD cards for this project.
A USB webcam with at least 640x480 in resolution that has drivers capable of taking still frames
Speaker
Pimoroni Unicorn HAT - purchace
Time required: About 15 mins installation if flashing image provided. Over a day if you want to manually build and install TensorFlow.
WARNING: It is important that the Raspberry Pi is fitted with a heatsink or else it is highly likely that the Pi will overheat, perform poorly and power off (or even potentially damage your hardware)!
First, download the latest system image from the Google Drive link on the latest release. Then, flash the SD card to your Pi using the tool of your choice, put the SD card into the Pi, plug it in and wait for the device to initialize (can take a few mins). Once initialized, the UnicornHat will scroll "Ready".
Follow this tutorial to install TensorFlow onto your Pi, along with all other requirements. Then run:
cd (YOUR TENSORFLOW DIRECTORY)/models/research/object_detection
sudo pip3 install unicornhat
sudo pip3 install bitarray
git clone https://github.com/topshed/UnicornHatScroll
git clone https://github.com/nuast/rpiTensorflowBlindspot
rm utils/visualization_utils.py
mv visualization_utils.py utils
Run the main script as superuser (i.e using sudo) and check for errors.
sudo Obj*.py --usbcam
When fully set up, plug in the Pi and it should boot into the Python script which will take one to two mins to initalise.
Project start: Friday 1st March
Installation and building of Tensorflow and object models: Wednesday 6th March - Saturday 10th March
Programming: Monday, March 10th - Saturday, March 16th
Deadline: Monday, March 18th
This project was programmed, tested, documented and completed in just over two weeks by @ed6767, @retroaspie and @DRagaven and is provided under the MIT Licence.