Giter Site home page Giter Site logo

tyoungroy / examples-camera Goto Github PK

View Code? Open in Web Editor NEW

This project forked from google-coral/examples-camera

0.0 1.0 0.0 167 KB

Small code snippets that show how to stream camera images to a Coral device.

License: Apache License 2.0

Shell 8.43% Python 74.64% Makefile 1.54% C++ 15.39%

examples-camera's Introduction

Edge TPU simple camera examples

This repo contains a collection of examples that use camera streams together with the TensorFlow Lite API with a Coral device such as the USB Accelerator or Dev Board.

Installation

  1. First, be sure you have completed the setup instructions for your Coral device. If it's been a while, repeat to be sure you have the latest software.

    Importantly, you should have the latest TensorFlow Lite runtime installed (as per the Python quickstart).

  2. Clone this Git repo onto your computer:

    mkdir google-coral && cd google-coral
    
    git clone https://github.com/google-coral/examples-camera.git --depth 1
    
  3. Download the models:

    cd examples-camera
    
    sh download_models.sh
    

    These canned models will be downloaded and extracted to a new folder all_models.

Further requirements may be needed by the different camera libraries, check the README file for the respective subfolder.

Contents

  • Gstreamer Python examples using gstreamer to obtain camera images. These examples work on Linux using a webcam, Raspberry Pi with the Raspicam and on the Coral DevBoard using the Coral camera. For the former two you will also need a Coral USB Accelerator to run the models.
  • Raspicam Python example using picamera. This is only intended for Raspberry Pi and will require a Coral USB Accelerator. Use install_requirements.sh to make sure all the dependencies are present.
  • PyGame Python example using pygame to obtain camera frames. Use install_requirements.sh to make sure all the dependencies are present.
  • OpenCV Python example using OpenCV to obtain camera frames. Use install_requirements.sh to make sure all the dependencies are present.
  • NativeApp C++ example using gstreamer to obtain camera frames. See README in the nativeapp directory on how to compile for the Coral DevBoard.

Canned models

For all the demos in this repository you can change the model and the labels file by using the flags flags --model and --labels. Be sure to use the models labeled _edgetpu, as those are compiled for the accelerator - otherwise the model will run on the CPU and be much slower.

For classification you need to select one of the classification models and its corresponding labels file:

inception_v1_224_quant_edgetpu.tflite, imagenet_labels.txt
inception_v2_224_quant_edgetpu.tflite, imagenet_labels.txt
inception_v3_299_quant_edgetpu.tflite, imagenet_labels.txt
inception_v4_299_quant_edgetpu.tflite, imagenet_labels.txt
mobilenet_v1_1.0_224_quant_edgetpu.tflite, imagenet_labels.txt
mobilenet_v2_1.0_224_quant_edgetpu.tflite, imagenet_labels.txt

mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite, inat_bird_labels.txt
mobilenet_v2_1.0_224_inat_insect_quant_edgetpu.tflite, inat_insect_labels.txt
mobilenet_v2_1.0_224_inat_plant_quant_edgetpu.tflite, inat_plant_labels.txt

For detection you need to select one of the SSD detection models and its corresponding labels file:

mobilenet_ssd_v1_coco_quant_postprocess_edgetpu.tflite, coco_labels.txt
mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite, coco_labels.txt
mobilenet_ssd_v2_face_quant_postprocess_edgetpu.tflite, coco_labels.txt

examples-camera's People

Contributors

arnoutdevos avatar davidp94 avatar enmasse avatar fjp avatar manderfeld avatar mbrooksx avatar mtyka avatar scottamain avatar

Watchers

 avatar

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.