Difference between revisions of "EBC Exercise 49 Setting Up coral"

From eLinux.org
Jump to: navigation, search
m (Test)
m (Installing on Bone: reboot)
Line 27: Line 27:
 
Save the file and run
 
Save the file and run
 
  bash install.sh
 
  bash install.sh
 +
reboot
  
Mine to some 9 and a half minutes.
+
Mine to some 9 and a half minutes.  The reboot seems necessary to get the right USB name to show up.
  
 
== Set up hardware ==
 
== Set up hardware ==

Revision as of 13:58, 4 April 2019

thumb‎ Embedded Linux Class by Mark A. Yoder


Here are instructions on how to run Google's coral ([1])

Install

wget http://storage.googleapis.com/cloud-iot-edge-pretrained-models/edgetpu_api.tar.gz  # 6 seconds
tar xzf edgetpu_api.tar.gz
cd python-tflite-source

Edit last line of install.sh to use python3

bash ./install.sh         # 22 seconds, 33s on Surface

Installing on Bone

This install.sh file checks for Raspberry Pi, but not the Bone. There's a simple edit that can add the bone.

First run

bone$ cat /proc/device-tree/model
TI AM335x BeagleBone Black

Remember the string that is returned. Now edit install.sh. You'll several lines that look almost like:

  elif "$board_version" == "TI AM335x BeagleBone Black"* ; then
   platform="raspberry_pi_3b+"
   echo -e "${GREEN}Recognized as Raspberry Pi 3 B+!${DEFAULT}"

Copy one set of three lines and edit to use the string returned by the cat command.

Save the file and run

bash install.sh
reboot

Mine to some 9 and a half minutes. The reboot seems necessary to get the right USB name to show up.

Set up hardware

Plug in. If you are running a virtual machine, have it capture

Global Unichip Corp.

A then it disappears and the following appears

Google Inc.

On my Surface I had to

  • quit VirtualBox
  • On your host machine, download the VirtualBox Extension Pack from: https://www.virtualbox.org/wiki/Downloads.
  • on your host, login as Administrator
  • run VirtualBox, but don't start a machine
  • go to Extensions and click the + button and add the extension pack you just downloaded
  • go to the USB settings and select the USB3.0 xHCI button
  • logoff as Administrator
  • run VirtualBox and start your machine
  • repeat the plugging in steps above

Test

# From the python-tflite-source directory
cd edgetpu/
python3 demo/classify_image.py \
--model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \
--label test_data/inat_bird_labels.txt \
--image test_data/parrot.jpg

The following took 6 seconds on my x86 Ubuntu virtual machine. 12 seconds on the Bone.




thumb‎ Embedded Linux Class by Mark A. Yoder