This is repository will provide a framework for using OpenCV with an Edge TPU such as Coral.ai for use both in develpment and deployment. It has been made in such a way, that you can develope and test with ease on your local machine - and use Docker to deploy on your hardware like for example the Raspbery Pi.
This framework is specifically tuned to work in a microservice environment, providing new capabilities to Drones using the ROS ecosystem.
This framework has been tested to run on the
Running these different OS's
- Ubuntu 20.04
- Raspbian 2020-02-13 armhf
- Raspbian 2020-02-13 aarch64
- macOS Catalina 10.15.04
Using various cameras
- PLAYSTATION Eye
- Raspberry Pi Camera Module v2
- Facetime Camera
- Lenovo Thinkvision Camera X1
The idea is to provide tools for you to develop your own applications, using these examples to get you going - faster. There are some very good guides, how-to's and tutorials that you can use if you want to read more.
- Containerizing a Tensorflow Lite Edge-TPU ML Application with Hardware Access on Raspbian
- Benchmarking Edge Computing
- Detect Objects Using Your Webcam
- Docker Machine with USB support on Windows/macOS
- Building Multi-Arch Images for Arm and x86 with Docker Desktop
To use the Raspberry Pi Camera Module v2 on the Rasbery Pi as a standard USB camera, you must first load the driver using the modprobe command
sudo modprobe bcm2835-v4l2
or add bcm2835-v4l2
to /etc/modules
. This will expose the camera as a video device on /dev/video0
.
We have provided a set of multi-arch docker images as a baseline that provide the needed OpenCV and Numpy libraries. Feel free to use you own, but the process of esablishing baseline images is very involved. The images can be found here.
The repository is a set of demonstrators, use them for testing your setup.
.
├── 1-usbcam-test # Test that your camera is attached, and usable through Docker
├── 2-python-test # Test that OpenCV is able to reach your camera, also through Docker
├── 3-tpu-test # Test that OpenCV works, and the Edge TPU device works, also though Docker
├── LICENSE
└── README.md
If you want to develope your software without having to worry about Docker, you must follow the guides nessecary for setting up e.g. Python, the Coral USB adapter, OpenCV etc. for your specific operating system. Once you are satisfied you can then build the docker image containing your code, and deploy it on your Raspberry Pi or drone.
This project is Financed in part by the Institutional and Educational Support Administration. Smart monitering af infrastruktur og miljø (digiMON)