TPU-MobilenetSSD
TPU-MobilenetSSD copied to clipboard
Edge TPU Accelerator / Multi-TPU + MobileNet-SSD v2 + Python + Async + LattePandaAlpha/RaspberryPi3/LaptopPC
TPU-MobilenetSSD
Environment
- LattePanda Alpha (Ubuntu16.04) / RaspberryPi3 (Raspbian) / LaptopPC (Ubuntu16.04)
- Edge TPU Accelerator (Supports multi-TPU)
- USB Camera (Playstationeye)
My articles
2.Structure visualization of Tensorflow Lite model files (.tflite)
LattePanda Alpha Core m3 + USB 3.0 + Google Edge TPU Accelerator + MobileNet-SSD v2 + Async mode
320x240
about 80 - 90 FPS
https://youtu.be/LERXuDXn0kY
LattePanda Alpha Core m3 + USB 3.0 + Google Edge TPU Accelerator + MobileNet-SSD v2 + Async mode
640x480
about 60 - 80 FPS
https://youtu.be/OFEQHCQ5MsM
Core i7 + USB 3.0 + Google Edge TPU Accelerator / Multi-TPUs x3 + MobileNet-SSD v2 + Async mode
320x240
about 150 FPS++
https://youtu.be/_qE9kmk8gUA
Environment construction procedure
$ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add-
$ echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
$ sudo apt-get update
$ sudo apt-get upgrade edgetpu
$ wget https://dl.google.com/coral/edgetpu_api/edgetpu_api_latest.tar.gz -O edgetpu_api.tar.gz --trust-server-names
$ tar xzf edgetpu_api.tar.gz
$ cd edgetpu_api
$ bash ./install.sh
Usage
MobileNet-SSD-TPU-async.py -> USB camera animation and inference are asynchronous (The frame is slightly off.)
MobileNet-SSD-TPU-sync.py -> USB camera animation and inference are synchronous (The frame does not shift greatly.)
If you use USB3.0 USBHub and connect multiple TPUs, it automatically detects multiple TPUs and processes inferences in parallel at high speed.
$ git clone https://github.com/PINTO0309/TPU-MobilenetSSD.git
$ cd TPU-MobilenetSSD
$ python3 MobileNet-SSD-TPU-async.py
usage: MobileNet-SSD-TPU-async.py [-h] [--model MODEL] [--label LABEL]
[--usbcamno USBCAMNO]
optional arguments:
-h, --help show this help message and exit
--model MODEL Path of the detection model.
--label LABEL Path of the labels file.
--usbcamno USBCAMNO USB Camera number.
Reference
- Get started with the USB Accelerator https://coral.withgoogle.com/tutorials/accelerator
- Models https://coral.withgoogle.com/models/
- Edge TPU Model Compiler https://coral.withgoogle.com/web-compiler/
- API demos https://coral.withgoogle.com/tutorials/edgetpu-api/#api-demos
- Edge TPU Benchmark https://coral.withgoogle.com/tutorials/edgetpu-faq/