Git Product home page Git Product logo

tpu-mobilenetssd's Introduction

TPU-MobilenetSSD

Environment

  1. LattePanda Alpha (Ubuntu16.04) / RaspberryPi3 (Raspbian) / LaptopPC (Ubuntu16.04)
  2. Edge TPU Accelerator (Supports multi-TPU)
  3. USB Camera (Playstationeye)

My articles

1.I tested the operating speed of MobileNet-SSD v2 using Google Edge TPU Accelerator with RaspberryPi3 (USB2.0) and LaptopPC (USB3.1) (MS-COCO)

2.Structure visualization of Tensorflow Lite model files (.tflite)

3.I wanted to speed up the operation of the Edge TPU Accelerator as little as possible, so I tried to generate a .tflite of MobileNetv2-SSDLite (Pascal VOC) and compile it into a TPU model. Part 1

4.Since I wanted to speed up the operation of the Edge TPU Accelerator as little as possible, I transferred and learned MobileNetv2-SSD / MobileNetv1-SSD + MS-COCO with Pascal VOC and generated .tflite. Docker Part 2

5.Since we wanted to speed up the operation of the Edge TPU Accelerator as little as possible, I transferred and learned MS-COCO with Pascal VOC and generated .tflite, Google Colaboratory [GPU]. Part 3

6.Edge TPU Accelerator + custom model MobileNetv2-SSDLite .tflite generation 【Success】 Docker compilation Part.4

7.[150 FPS ++] Connect three Coral Edge TPU accelerators to infer parallelism and get ultra-fast object detection inference performance ーTo the extreme of useless high performanceー

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

01

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

02

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

03 04

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

tpu-mobilenetssd's People

Contributors

pinto0309 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tpu-mobilenetssd's Issues

Raspberry Pi 3 + Google TPU?

Hi,

Thanks for your sharing!

The Core m3 seems more powerful than other SoCs, Do you have plan to try TPU with RP3?

Thanks.

BRs,
Lee

Freezing and tflite transformation of model

Interesting work!
I am trying to set up my hobby project, but need to transform my custom tensorflow model I found(it's also mobilenet). I can't get it running on my edge TPU, I guess I did something wrong in process of transforming model to tflite. Could yu please provide information how you transformed model(freezing and tflite transformation)?

I found freezed model in this script and then transformed it to tflite with

converter = tf.contrib.lite.TFLiteConverter.from_frozen_graph(path_to_pb_file: str, input_arrays= ['input'], output_arrays=['output'])
tflite_model = converter.convert()

Any tips will be greatly appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.